Class NettyHttpContainerProvider

    • Constructor Detail

      • NettyHttpContainerProvider

        public NettyHttpContainerProvider()
    • Method Detail

      • createServer

        public static io.netty.channel.Channel createServer​(URI baseUri,
                                                            org.glassfish.jersey.netty.httpserver.NettyHttpContainer container,
                                                            io.netty.handler.ssl.SslContext sslContext,
                                                            boolean block)
                                                     throws ProcessingException
        Create and start Netty server.
        Parameters:
        baseUri - base uri.
        container - Jersey container.
        sslContext - Netty SSL context (can be null).
        block - when true, this method will block until the server is stopped. When false, the execution will end immediately after the server is started.
        Returns:
        Netty channel instance.
        Throws:
        ProcessingException - when there is an issue with creating new container.
      • createServer

        public static io.netty.channel.Channel createServer​(URI baseUri,
                                                            ResourceConfig configuration,
                                                            io.netty.handler.ssl.SslContext sslContext,
                                                            boolean block)
                                                     throws ProcessingException
        Create and start Netty server.
        Parameters:
        baseUri - base uri.
        configuration - Jersey configuration.
        sslContext - Netty SSL context (can be null).
        block - when true, this method will block until the server is stopped. When false, the execution will end immediately after the server is started.
        Returns:
        Netty channel instance.
        Throws:
        ProcessingException - when there is an issue with creating new container.
      • createServer

        public static io.netty.channel.Channel createServer​(URI baseUri,
                                                            ResourceConfig configuration,
                                                            boolean block)
                                                     throws ProcessingException
        Create and start Netty server.
        Parameters:
        baseUri - base uri.
        configuration - Jersey configuration.
        block - when true, this method will block until the server is stopped. When false, the execution will end immediately after the server is started.
        Returns:
        Netty channel instance.
        Throws:
        ProcessingException - when there is an issue with creating new container.
      • createHttp2Server

        public static io.netty.channel.Channel createHttp2Server​(URI baseUri,
                                                                 ResourceConfig configuration,
                                                                 io.netty.handler.ssl.SslContext sslContext)
                                                          throws ProcessingException
        Create and start Netty HTTP/2 server.

        The server is capable of connection upgrade to HTTP/2. HTTP/1.x request will be server as they were used to.

        Note that this implementation cannot be more experimental. Any contributions / feedback is welcomed.

        Parameters:
        baseUri - base uri.
        configuration - Jersey configuration.
        sslContext - Netty SslContext.
        Returns:
        Netty channel instance.
        Throws:
        ProcessingException - when there is an issue with creating new container.