Package io.micronaut.http.server.netty
Interface NettyEmbeddedServices
- All Known Implementing Classes:
DefaultNettyEmbeddedServerFactory
Internal interface with services required by the
NettyHttpServer
.
e- Since:
- 3.1.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionio.netty.channel.EventLoopGroup
createEventLoopGroup
(int numThreads, ExecutorService executorService, Integer ioRatio) Creates the event loop group configuration.io.netty.channel.EventLoopGroup
Creates the event loop group configuration.default io.netty.channel.Channel
getChannelInstance
(NettyChannelType type, EventLoopGroupConfiguration workerConfig) Gets the domain server socket channel instance.default io.netty.channel.ServerChannel
getDomainServerChannelInstance
(EventLoopGroupConfiguration workerConfig) Gets the domain server socket channel instance.<E> ApplicationEventPublisher<E>
getEventPublisher
(Class<E> eventClass) Get an event publisher for the server for the given type.default ExecutorSelector
List<io.netty.channel.ChannelOutboundHandler>
default RequestArgumentSatisfier
default Router
io.netty.channel.socket.ServerSocketChannel
getServerSocketChannelInstance
(EventLoopGroupConfiguration workerConfig) Gets the server socket channel instance.Optional<io.netty.channel.SimpleChannelInboundHandler<NettyHttpRequest<?>>>
getWebSocketUpgradeHandler
(NettyEmbeddedServer embeddedServer)
-
Method Details
-
getOutboundHandlers
- Returns:
- The channel outbound handlers
-
getApplicationContext
- Returns:
- The application context
-
getRequestArgumentSatisfier
- Returns:
- The request argument satisfier
- See Also:
-
getRouteExecutor
- Returns:
- The route executor
- See Also:
-
getMediaTypeCodecRegistry
- Returns:
- The media type code registry
- See Also:
-
getStaticResourceResolver
- Returns:
- The static resource resolver
- See Also:
-
getExecutorSelector
- Returns:
- The executor resolver
-
getServerSslBuilder
- Returns:
- The server SSL builder or
null
if none is configured - See Also:
-
getChannelOptionFactory
- Returns:
- The channel option factory
-
getHttpCompressionStrategy
- Returns:
- The http compression strategy
-
getWebSocketUpgradeHandler
Optional<io.netty.channel.SimpleChannelInboundHandler<NettyHttpRequest<?>>> getWebSocketUpgradeHandler(NettyEmbeddedServer embeddedServer) - Parameters:
embeddedServer
- The server- Returns:
- The websocket upgrade handler if present
-
getEventLoopGroupRegistry
- Returns:
- The event loop group registry.
-
getRouter
- Returns:
- Obtains the router
-
createEventLoopGroup
@NonNull io.netty.channel.EventLoopGroup createEventLoopGroup(@NonNull EventLoopGroupConfiguration config) Creates the event loop group configuration.- Parameters:
config
- The config- Returns:
- The event loop group config
-
createEventLoopGroup
@NonNull io.netty.channel.EventLoopGroup createEventLoopGroup(int numThreads, @NonNull ExecutorService executorService, @Nullable Integer ioRatio) Creates the event loop group configuration.- Parameters:
numThreads
- The number of threadsexecutorService
- The executor serviceioRatio
- The I/O ratio- Returns:
- The event loop group
-
getServerSocketChannelInstance
@NonNull io.netty.channel.socket.ServerSocketChannel getServerSocketChannelInstance(@NonNull EventLoopGroupConfiguration workerConfig) Gets the server socket channel instance.- Parameters:
workerConfig
- The worker config- Returns:
- The
ServerSocketChannel
-
getDomainServerChannelInstance
@NonNull default io.netty.channel.ServerChannel getDomainServerChannelInstance(@NonNull EventLoopGroupConfiguration workerConfig) Gets the domain server socket channel instance.- Parameters:
workerConfig
- The worker config- Returns:
- The
DomainSocketChannel
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
getChannelInstance
@NonNull default io.netty.channel.Channel getChannelInstance(NettyChannelType type, @NonNull EventLoopGroupConfiguration workerConfig) Gets the domain server socket channel instance.- Parameters:
type
- The channel type to returnworkerConfig
- The worker config- Returns:
- The channel
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
getEventPublisher
Get an event publisher for the server for the given type.- Type Parameters:
E
- The event generic type- Parameters:
eventClass
- The event publisher- Returns:
- The event publisher
-