use of io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration in project micronaut-core by micronaut-projects.
the class DefaultHttpContentProcessorResolver method getServerConfiguration.
private NettyHttpServerConfiguration getServerConfiguration() {
NettyHttpServerConfiguration nettyHttpServerConfiguration = this.nettyServerConfiguration;
if (nettyHttpServerConfiguration == null) {
synchronized (this) {
// double check
nettyHttpServerConfiguration = this.nettyServerConfiguration;
if (nettyHttpServerConfiguration == null) {
nettyHttpServerConfiguration = serverConfiguration.get();
this.nettyServerConfiguration = nettyHttpServerConfiguration;
}
}
}
return nettyHttpServerConfiguration;
}
use of io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration in project micronaut-core by micronaut-projects.
the class TestNettySecondaryServer method secondaryServer.
@Named("secondary")
@Bean(preDestroy = "stop")
@Requires(property = "NettyMultiServerSpec", value = StringUtils.TRUE)
NettyEmbeddedServer secondaryServer() {
NettyEmbeddedServer embeddedServer = embeddedServerFactory.build(new NettyHttpServerConfiguration(applicationConfiguration));
embeddedServer.start();
return embeddedServer;
}
use of io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration in project micronaut-core by micronaut-projects.
the class SecondaryNettyServer method nettyEmbeddedServer.
@Named(SERVER_ID)
@Context
// <2>
@Bean(preDestroy = "close")
@Requires(beans = Environment.class)
NettyEmbeddedServer nettyEmbeddedServer(NettyEmbeddedServerFactory serverFactory) {
// <3>
// configure server programmatically
final NettyHttpServerConfiguration configuration = // <4>
new NettyHttpServerConfiguration();
// <5>
final ServerSslConfiguration sslConfiguration = new ServerSslConfiguration();
sslConfiguration.setBuildSelfSigned(true);
sslConfiguration.setEnabled(true);
// random port
sslConfiguration.setPort(-1);
// <6>
final NettyEmbeddedServer embeddedServer = serverFactory.build(configuration, sslConfiguration);
// <7>
embeddedServer.start();
// <8>
return embeddedServer;
}
Aggregations