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

      • 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
        Parameters:
        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.
        Parameters:
        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.
        Parameters:
        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.
        Parameters:
        idleTimeoutSeconds - - How many seconds to cleanup client connection. default value -1 meaning no idle timeout.
      • setChannelHandlers

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

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

        Parameters:
        channelHandlers - the additional ChannelHandlers.
      • setHttpChannelHandlers

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

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

        Parameters:
        httpChannelHandlers - the additional ChannelHandlers.
      • setChannelOptions

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

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