Class DefaultNettyEmbeddedServerFactory

    • Constructor Detail

      • DefaultNettyEmbeddedServerFactory

        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,
                                                    @Named("netty")
                                                    java.util.concurrent.ThreadFactory nettyThreadFactory,
                                                    HttpCompressionStrategy httpCompressionStrategy,
                                                    io.micronaut.http.netty.channel.EventLoopGroupFactory eventLoopGroupFactory,
                                                    io.micronaut.http.netty.channel.EventLoopGroupRegistry eventLoopGroupRegistry)
        Default constructor.
        Parameters:
        applicationContext - The app ctx
        routeExecutor - The route executor
        mediaTypeCodecRegistry - The media type codec
        staticResourceResolver - The static resource resolver
        nettyThreadFactory - The netty thread factory
        httpCompressionStrategy - The http compression strategy
        eventLoopGroupFactory - The event loop group factory
        eventLoopGroupRegistry - The event loop group registry
    • Method Detail

      • getOutboundHandlers

        public java.util.List<io.netty.channel.ChannelOutboundHandler> getOutboundHandlers()
        Specified by:
        getOutboundHandlers in interface NettyEmbeddedServices
        Returns:
        The channel outbound handlers
      • getRequestArgumentSatisfier

        public io.micronaut.http.server.binding.RequestArgumentSatisfier getRequestArgumentSatisfier()
        Specified by:
        getRequestArgumentSatisfier in interface NettyEmbeddedServices
        Returns:
        The request argument satisfier
        See Also:
        RequestArgumentSatisfier
      • getRouteExecutor

        public io.micronaut.http.server.RouteExecutor getRouteExecutor()
        Specified by:
        getRouteExecutor in interface NettyEmbeddedServices
        Returns:
        The route executor
        See Also:
        RouteExecutor
      • getMediaTypeCodecRegistry

        public io.micronaut.http.codec.MediaTypeCodecRegistry getMediaTypeCodecRegistry()
        Specified by:
        getMediaTypeCodecRegistry in interface NettyEmbeddedServices
        Returns:
        The media type code registry
        See Also:
        MediaTypeCodecRegistry
      • getStaticResourceResolver

        public io.micronaut.web.router.resource.StaticResourceResolver getStaticResourceResolver()
        Specified by:
        getStaticResourceResolver in interface NettyEmbeddedServices
        Returns:
        The static resource resolver
        See Also:
        StaticResourceResolver
      • getExecutorSelector

        public io.micronaut.scheduling.executor.ExecutorSelector getExecutorSelector()
        Specified by:
        getExecutorSelector in interface NettyEmbeddedServices
        Returns:
        The executor resolver
      • getChannelOptionFactory

        public io.micronaut.http.netty.channel.converters.ChannelOptionFactory getChannelOptionFactory()
        Specified by:
        getChannelOptionFactory in interface NettyEmbeddedServices
        Returns:
        The channel option factory
      • getWebSocketBeanRegistry

        public io.micronaut.websocket.context.WebSocketBeanRegistry getWebSocketBeanRegistry()
        Specified by:
        getWebSocketBeanRegistry in interface NettyEmbeddedServices
        Returns:
        The websocket bean registry
      • getEventLoopGroupRegistry

        public io.micronaut.http.netty.channel.EventLoopGroupRegistry getEventLoopGroupRegistry()
        Specified by:
        getEventLoopGroupRegistry in interface NettyEmbeddedServices
        Returns:
        The event loop group registry.
      • createEventLoopGroup

        public io.netty.channel.EventLoopGroup createEventLoopGroup​(io.micronaut.http.netty.channel.EventLoopGroupConfiguration config)
        Description copied from interface: NettyEmbeddedServices
        Creates the event loop group configuration.
        Specified by:
        createEventLoopGroup in interface NettyEmbeddedServices
        Parameters:
        config - The config
        Returns:
        The event loop group config
      • getServerSocketChannelInstance

        public io.netty.channel.socket.ServerSocketChannel getServerSocketChannelInstance​(io.micronaut.http.netty.channel.EventLoopGroupConfiguration workerConfig)
        Description copied from interface: NettyEmbeddedServices
        Gets the server socket channel instance.
        Specified by:
        getServerSocketChannelInstance in interface NettyEmbeddedServices
        Parameters:
        workerConfig - The worker config
        Returns:
        The ServerSocketChannel
      • getDomainServerChannelInstance

        public io.netty.channel.ServerChannel getDomainServerChannelInstance​(io.micronaut.http.netty.channel.EventLoopGroupConfiguration workerConfig)
        Description copied from interface: NettyEmbeddedServices
        Gets the domain server socket channel instance.
        Specified by:
        getDomainServerChannelInstance in interface NettyEmbeddedServices
        Parameters:
        workerConfig - The worker config
        Returns:
        The DomainSocketChannel
      • getEventPublisher

        public <E> io.micronaut.context.event.ApplicationEventPublisher<E> getEventPublisher​(java.lang.Class<E> eventClass)
        Description copied from interface: NettyEmbeddedServices
        Get an event publisher for the server for the given type.
        Specified by:
        getEventPublisher in interface NettyEmbeddedServices
        Type Parameters:
        E - The event generic type
        Parameters:
        eventClass - The event publisher
        Returns:
        The event publisher
      • createEventLoopGroup

        @NonNull
        public io.netty.channel.EventLoopGroup createEventLoopGroup​(int numThreads,
                                                                    @NonNull
                                                                    java.util.concurrent.ExecutorService executorService,
                                                                    java.lang.Integer ioRatio)
        Description copied from interface: NettyEmbeddedServices
        Creates the event loop group configuration.
        Specified by:
        createEventLoopGroup in interface NettyEmbeddedServices
        Parameters:
        numThreads - The number of threads
        executorService - The executor service
        ioRatio - The I/O ratio
        Returns:
        The event loop group
      • setChannelOptionFactory

        @Inject
        protected void setChannelOptionFactory​(@Nullable
                                               io.micronaut.http.netty.channel.converters.ChannelOptionFactory channelOptionFactory)
        Configures the channel option factory.
        Parameters:
        channelOptionFactory - The channel option factory.
      • setServerSslBuilder

        @Inject
        protected void setServerSslBuilder​(@Nullable
                                           ServerSslBuilder serverSslBuilder)
        Configures the ServerSslBuilder the server ssl builder.
        Parameters:
        serverSslBuilder - The builder
      • setOutboundHandlers

        @Inject
        protected void setOutboundHandlers​(java.util.List<io.netty.channel.ChannelOutboundHandler> outboundHandlers)
        Sets the outbound handlers.
        Parameters:
        outboundHandlers - The ChannelOutboundHandler instances