@Factory
@Internal
@Bean(typed={NettyEmbeddedServerFactory.class,DefaultNettyEmbeddedServerFactory.class})
public class DefaultNettyEmbeddedServerFactory
extends java.lang.Object
implements NettyEmbeddedServerFactory, NettyEmbeddedServices
NettyEmbeddedServerFactory.| Modifier | Constructor and Description |
|---|---|
protected |
DefaultNettyEmbeddedServerFactory(io.micronaut.context.ApplicationContext applicationContext,
io.micronaut.http.server.RouteExecutor routeExecutor,
io.micronaut.http.codec.MediaTypeCodecRegistry mediaTypeCodecRegistry,
io.micronaut.web.router.resource.StaticResourceResolver staticResourceResolver,
java.util.concurrent.ThreadFactory nettyThreadFactory,
HttpCompressionStrategy httpCompressionStrategy,
io.micronaut.http.netty.channel.EventLoopGroupFactory eventLoopGroupFactory,
io.micronaut.http.netty.channel.EventLoopGroupRegistry eventLoopGroupRegistry)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
NettyEmbeddedServer |
build(NettyHttpServerConfiguration configuration)
Builds a
NettyEmbeddedServer for the given configuration. |
protected NettyEmbeddedServer |
buildDefaultServer(NettyHttpServerConfiguration configuration)
Builds the default server configuration.
|
io.netty.channel.EventLoopGroup |
createEventLoopGroup(io.micronaut.http.netty.channel.EventLoopGroupConfiguration config)
Creates the event loop group configuration.
|
io.netty.channel.EventLoopGroup |
createEventLoopGroup(int numThreads,
java.util.concurrent.ExecutorService executorService,
java.lang.Integer ioRatio)
Creates the event loop group configuration.
|
io.micronaut.context.ApplicationContext |
getApplicationContext() |
io.micronaut.http.netty.channel.converters.ChannelOptionFactory |
getChannelOptionFactory() |
io.micronaut.http.netty.channel.EventLoopGroupRegistry |
getEventLoopGroupRegistry() |
<E> io.micronaut.context.event.ApplicationEventPublisher<E> |
getEventPublisher(java.lang.Class<E> eventClass)
Get an event publisher for the server for the given type.
|
io.micronaut.scheduling.executor.ExecutorSelector |
getExecutorSelector() |
HttpCompressionStrategy |
getHttpCompressionStrategy() |
io.micronaut.http.codec.MediaTypeCodecRegistry |
getMediaTypeCodecRegistry() |
java.util.List<io.netty.channel.ChannelOutboundHandler> |
getOutboundHandlers() |
io.micronaut.http.server.binding.RequestArgumentSatisfier |
getRequestArgumentSatisfier() |
io.micronaut.http.server.RouteExecutor |
getRouteExecutor() |
io.netty.channel.socket.ServerSocketChannel |
getServerSocketChannelInstance(io.micronaut.http.netty.channel.EventLoopGroupConfiguration workerConfig)
Gets the server socket channel instance.
|
ServerSslBuilder |
getServerSslBuilder() |
io.micronaut.web.router.resource.StaticResourceResolver |
getStaticResourceResolver() |
io.micronaut.websocket.context.WebSocketBeanRegistry |
getWebSocketBeanRegistry() |
protected void |
setChannelOptionFactory(io.micronaut.http.netty.channel.converters.ChannelOptionFactory channelOptionFactory)
Configures the channel option factory.
|
protected void |
setOutboundHandlers(java.util.List<io.netty.channel.ChannelOutboundHandler> outboundHandlers)
Sets the outbound handlers.
|
protected void |
setServerSslBuilder(ServerSslBuilder serverSslBuilder)
Configures the
ServerSslBuilder the server ssl builder. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRouterprotected DefaultNettyEmbeddedServerFactory(io.micronaut.context.ApplicationContext applicationContext,
io.micronaut.http.server.RouteExecutor routeExecutor,
io.micronaut.http.codec.MediaTypeCodecRegistry mediaTypeCodecRegistry,
io.micronaut.web.router.resource.StaticResourceResolver staticResourceResolver,
@Named(value="netty")
java.util.concurrent.ThreadFactory nettyThreadFactory,
HttpCompressionStrategy httpCompressionStrategy,
io.micronaut.http.netty.channel.EventLoopGroupFactory eventLoopGroupFactory,
io.micronaut.http.netty.channel.EventLoopGroupRegistry eventLoopGroupRegistry)
applicationContext - The app ctxrouteExecutor - The route executormediaTypeCodecRegistry - The media type codecstaticResourceResolver - The static resource resolvernettyThreadFactory - The netty thread factoryhttpCompressionStrategy - The http compression strategyeventLoopGroupFactory - The event loop group factoryeventLoopGroupRegistry - The event loop group registry@NonNull public NettyEmbeddedServer build(@NonNull NettyHttpServerConfiguration configuration)
NettyEmbeddedServerFactoryNettyEmbeddedServer for the given configuration.build in interface NettyEmbeddedServerFactoryconfiguration - The configuration, never nullNettyEmbeddedServer instance@Singleton @Primary @NonNull protected NettyEmbeddedServer buildDefaultServer(@NonNull NettyHttpServerConfiguration configuration)
configuration - The server configurationNettyEmbeddedServer instancepublic java.util.List<io.netty.channel.ChannelOutboundHandler> getOutboundHandlers()
getOutboundHandlers in interface NettyEmbeddedServicespublic io.micronaut.context.ApplicationContext getApplicationContext()
getApplicationContext in interface NettyEmbeddedServicespublic io.micronaut.http.server.binding.RequestArgumentSatisfier getRequestArgumentSatisfier()
getRequestArgumentSatisfier in interface NettyEmbeddedServicesRequestArgumentSatisfierpublic io.micronaut.http.server.RouteExecutor getRouteExecutor()
getRouteExecutor in interface NettyEmbeddedServicesRouteExecutorpublic io.micronaut.http.codec.MediaTypeCodecRegistry getMediaTypeCodecRegistry()
getMediaTypeCodecRegistry in interface NettyEmbeddedServicesMediaTypeCodecRegistrypublic io.micronaut.web.router.resource.StaticResourceResolver getStaticResourceResolver()
getStaticResourceResolver in interface NettyEmbeddedServicesStaticResourceResolverpublic io.micronaut.scheduling.executor.ExecutorSelector getExecutorSelector()
getExecutorSelector in interface NettyEmbeddedServicespublic ServerSslBuilder getServerSslBuilder()
getServerSslBuilder in interface NettyEmbeddedServicesnull if none is configuredCertificateProvidedSslBuilderpublic io.micronaut.http.netty.channel.converters.ChannelOptionFactory getChannelOptionFactory()
getChannelOptionFactory in interface NettyEmbeddedServicespublic HttpCompressionStrategy getHttpCompressionStrategy()
getHttpCompressionStrategy in interface NettyEmbeddedServicespublic io.micronaut.websocket.context.WebSocketBeanRegistry getWebSocketBeanRegistry()
getWebSocketBeanRegistry in interface NettyEmbeddedServicespublic io.micronaut.http.netty.channel.EventLoopGroupRegistry getEventLoopGroupRegistry()
getEventLoopGroupRegistry in interface NettyEmbeddedServicespublic io.netty.channel.EventLoopGroup createEventLoopGroup(io.micronaut.http.netty.channel.EventLoopGroupConfiguration config)
NettyEmbeddedServicescreateEventLoopGroup in interface NettyEmbeddedServicesconfig - The configpublic io.netty.channel.socket.ServerSocketChannel getServerSocketChannelInstance(io.micronaut.http.netty.channel.EventLoopGroupConfiguration workerConfig)
NettyEmbeddedServicesgetServerSocketChannelInstance in interface NettyEmbeddedServicesworkerConfig - The worker configServerSocketChannelpublic <E> io.micronaut.context.event.ApplicationEventPublisher<E> getEventPublisher(java.lang.Class<E> eventClass)
NettyEmbeddedServicesgetEventPublisher in interface NettyEmbeddedServicesE - The event generic typeeventClass - The event publisher@NonNull
public io.netty.channel.EventLoopGroup createEventLoopGroup(int numThreads,
@NonNull
java.util.concurrent.ExecutorService executorService,
java.lang.Integer ioRatio)
NettyEmbeddedServicescreateEventLoopGroup in interface NettyEmbeddedServicesnumThreads - The number of threadsexecutorService - The executor serviceioRatio - The I/O ratio@Inject
protected void setChannelOptionFactory(@Nullable
io.micronaut.http.netty.channel.converters.ChannelOptionFactory channelOptionFactory)
channelOptionFactory - The channel option factory.@Inject
protected void setServerSslBuilder(@Nullable
ServerSslBuilder serverSslBuilder)
ServerSslBuilder the server ssl builder.serverSslBuilder - The builder@Inject protected void setOutboundHandlers(java.util.List<io.netty.channel.ChannelOutboundHandler> outboundHandlers)
outboundHandlers - The ChannelOutboundHandler instances