@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(ApplicationContext applicationContext,
RouteExecutor routeExecutor,
MediaTypeCodecRegistry mediaTypeCodecRegistry,
StaticResourceResolver staticResourceResolver,
java.util.concurrent.ThreadFactory nettyThreadFactory,
HttpCompressionStrategy httpCompressionStrategy,
EventLoopGroupFactory eventLoopGroupFactory,
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(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.
|
ApplicationContext |
getApplicationContext() |
ChannelOptionFactory |
getChannelOptionFactory() |
EventLoopGroupRegistry |
getEventLoopGroupRegistry() |
<E> ApplicationEventPublisher<E> |
getEventPublisher(java.lang.Class<E> eventClass)
Get an event publisher for the server for the given type.
|
ExecutorSelector |
getExecutorSelector() |
HttpCompressionStrategy |
getHttpCompressionStrategy() |
MediaTypeCodecRegistry |
getMediaTypeCodecRegistry() |
java.util.List<io.netty.channel.ChannelOutboundHandler> |
getOutboundHandlers() |
RequestArgumentSatisfier |
getRequestArgumentSatisfier() |
RouteExecutor |
getRouteExecutor() |
io.netty.channel.socket.ServerSocketChannel |
getServerSocketChannelInstance(EventLoopGroupConfiguration workerConfig)
Gets the server socket channel instance.
|
ServerSslBuilder |
getServerSslBuilder() |
StaticResourceResolver |
getStaticResourceResolver() |
WebSocketBeanRegistry |
getWebSocketBeanRegistry() |
protected void |
setChannelOptionFactory(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(ApplicationContext applicationContext, RouteExecutor routeExecutor, MediaTypeCodecRegistry mediaTypeCodecRegistry, StaticResourceResolver staticResourceResolver, @Named(value="netty") java.util.concurrent.ThreadFactory nettyThreadFactory, HttpCompressionStrategy httpCompressionStrategy, EventLoopGroupFactory eventLoopGroupFactory, 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 ApplicationContext getApplicationContext()
getApplicationContext in interface NettyEmbeddedServicespublic RequestArgumentSatisfier getRequestArgumentSatisfier()
getRequestArgumentSatisfier in interface NettyEmbeddedServicesRequestArgumentSatisfierpublic RouteExecutor getRouteExecutor()
getRouteExecutor in interface NettyEmbeddedServicesRouteExecutorpublic MediaTypeCodecRegistry getMediaTypeCodecRegistry()
getMediaTypeCodecRegistry in interface NettyEmbeddedServicesMediaTypeCodecRegistrypublic StaticResourceResolver getStaticResourceResolver()
getStaticResourceResolver in interface NettyEmbeddedServicesStaticResourceResolverpublic ExecutorSelector getExecutorSelector()
getExecutorSelector in interface NettyEmbeddedServicespublic ServerSslBuilder getServerSslBuilder()
getServerSslBuilder in interface NettyEmbeddedServicesnull if none is configuredCertificateProvidedSslBuilderpublic ChannelOptionFactory getChannelOptionFactory()
getChannelOptionFactory in interface NettyEmbeddedServicespublic HttpCompressionStrategy getHttpCompressionStrategy()
getHttpCompressionStrategy in interface NettyEmbeddedServicespublic WebSocketBeanRegistry getWebSocketBeanRegistry()
getWebSocketBeanRegistry in interface NettyEmbeddedServicespublic EventLoopGroupRegistry getEventLoopGroupRegistry()
getEventLoopGroupRegistry in interface NettyEmbeddedServicespublic io.netty.channel.EventLoopGroup createEventLoopGroup(EventLoopGroupConfiguration config)
NettyEmbeddedServicescreateEventLoopGroup in interface NettyEmbeddedServicesconfig - The configpublic io.netty.channel.socket.ServerSocketChannel getServerSocketChannelInstance(EventLoopGroupConfiguration workerConfig)
NettyEmbeddedServicesgetServerSocketChannelInstance in interface NettyEmbeddedServicesworkerConfig - The worker configServerSocketChannelpublic <E> 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 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