@Factory @Internal @Bean(typed={NettyEmbeddedServerFactory.class,DefaultNettyEmbeddedServerFactory.class}) public class DefaultNettyEmbeddedServerFactory extends Object implements NettyEmbeddedServerFactory, NettyEmbeddedServices
NettyEmbeddedServerFactory.| Modifier | Constructor and Description |
|---|---|
protected |
DefaultNettyEmbeddedServerFactory(ApplicationContext applicationContext,
RouteExecutor routeExecutor,
MediaTypeCodecRegistry mediaTypeCodecRegistry,
StaticResourceResolver staticResourceResolver,
ThreadFactory nettyThreadFactory,
HttpCompressionStrategy httpCompressionStrategy,
EventLoopGroupFactory eventLoopGroupFactory,
EventLoopGroupRegistry eventLoopGroupRegistry)
Default constructor.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRouterprotected DefaultNettyEmbeddedServerFactory(ApplicationContext applicationContext, RouteExecutor routeExecutor, MediaTypeCodecRegistry mediaTypeCodecRegistry, StaticResourceResolver staticResourceResolver, @Named(value="netty") 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.
Note that the returned server instance should be closed gracefully by calling the NettyEmbeddedServer.stop() method.
build in interface NettyEmbeddedServerFactoryconfiguration - The configuration, never nullNettyEmbeddedServer instance@NonNull public NettyEmbeddedServer build(@NonNull NettyHttpServerConfiguration configuration, @Nullable ServerSslConfiguration sslConfiguration)
NettyEmbeddedServerFactoryNettyEmbeddedServer for the given configuration.
Note that the returned server instance should be closed gracefully by calling the NettyEmbeddedServer.stop() method.
build in interface NettyEmbeddedServerFactoryconfiguration - The configuration, never nullsslConfiguration - The SSL configuration, can be null if SSL is not requiredNettyEmbeddedServer instance@Singleton @Primary @NonNull protected NettyEmbeddedServer buildDefaultServer(@NonNull NettyHttpServerConfiguration configuration)
configuration - The server configurationNettyEmbeddedServer instancepublic 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(Class<E> eventClass)
NettyEmbeddedServicesgetEventPublisher in interface NettyEmbeddedServicesE - The event generic typeeventClass - The event publisher@NonNull public io.netty.channel.EventLoopGroup createEventLoopGroup(int numThreads, @NonNull ExecutorService executorService, 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