Class NettyJaxrsServer

    • Field Detail

      • bootstrap

        protected io.netty.bootstrap.ServerBootstrap bootstrap
      • hostname

        protected String hostname
      • configuredPort

        protected int configuredPort
      • runtimePort

        protected int runtimePort
    • Constructor Detail

      • NettyJaxrsServer

        public NettyJaxrsServer()
    • Method Detail

      • start

        public void start​( configuration)
        Description copied from interface: EmbeddedServer
        Starts the server synchronously.
        Specified by:
        start in interface EmbeddedJaxrsServer<NettyJaxrsServer>
        Specified by:
        start in interface EmbeddedServer
        configuration - the configuration used to configure the server
      • getPort

        public int getPort()
      • getHostname

        public String getHostname()
      • setIoWorkerCount

        public NettyJaxrsServer setIoWorkerCount​(int ioWorkerCount)
        Specify the worker count to use. For more information about this please see the javadocs of EventLoopGroup
        ioWorkerCount - worker count
      • setExecutorThreadCount

        public NettyJaxrsServer setExecutorThreadCount​(int executorThreadCount)
        Set the number of threads to use for the EventExecutor. For more information please see the javadocs of EventExecutor. If you want to disable the use of the EventExecutor specify a value <= 0. This should only be done if you are 100% sure that you don't have any blocking code in there.
        executorThreadCount - thread count
      • setMaxRequestSize

        public NettyJaxrsServer setMaxRequestSize​(int maxRequestSize)
        Set the max. request size in bytes. If this size is exceed we will send a "413 Request Entity Too Large" to the client.
        maxRequestSize - the max request size. This is 10mb by default.
      • setMaxInitialLineLength

        public NettyJaxrsServer setMaxInitialLineLength​(int maxInitialLineLength)
      • setMaxHeaderSize

        public NettyJaxrsServer setMaxHeaderSize​(int maxHeaderSize)
      • setMaxChunkSize

        public NettyJaxrsServer setMaxChunkSize​(int maxChunkSize)
      • getIdleTimeout

        public int getIdleTimeout()
      • setIdleTimeout

        public NettyJaxrsServer setIdleTimeout​(int idleTimeoutSeconds)
        Set the idle timeout. Set this value to turn on idle connection cleanup. If there is no traffic within idleTimeoutSeconds, it'll close connection.
        idleTimeoutSeconds - - How many seconds to cleanup client connection. default value -1 meaning no idle timeout.
      • setChannelHandlers

        public NettyJaxrsServer setChannelHandlers​(List<> channelHandlers)
        Add additional ChannelHandlers to the ServerBootstrap.

        The additional channel handlers are being added before the HTTP handling.

        channelHandlers - the additional ChannelHandlers.
      • setHttpChannelHandlers

        public NettyJaxrsServer setHttpChannelHandlers​(List<> httpChannelHandlers)
        Add additional ChannelHandlers to the ServerBootstrap.

        The additional channel handlers are being added after the HTTP handling.

        httpChannelHandlers - the additional ChannelHandlers.
      • setChannelOptions

        public NettyJaxrsServer setChannelOptions​(Map<,​Object> channelOptions)
        Add Netty ChannelOptions to the ServerBootstrap.
        channelOptions - the additional ChannelOptions.
        See Also:
        AbstractBootstrap.option(, Object)
      • setChildChannelOptions

        public NettyJaxrsServer setChildChannelOptions​(Map<,​Object> channelOptions)
        Add child options to the ServerBootstrap.
        channelOptions - the additional child ChannelOptions.
        See Also:
        ServerBootstrap.childOption(, Object)