Package org.jboss.resteasy.plugins.server.netty

## Class NettyJaxrsServer

- java.lang.Object
- - org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer

- All Implemented Interfaces:
    `EmbeddedJaxrsServer<NettyJaxrsServer>`
  Direct Known Subclasses:
    `CdiNettyJaxrsServer`

      public class NettyJaxrsServer
      extends Object
      implements EmbeddedJaxrsServer<NettyJaxrsServer>

  An HTTP server that sends back the content of the received HTTP request in a pretty plaintext form.
  Version:
    $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
  Author:
    The Netty Project, Andy Taylor (andy.taylor@jboss.org), Trustin Lee, Norman Maurer

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected io.netty.bootstrap.ServerBootstrap` | `bootstrap` |
    `protected int` | `configuredPort` |
    `protected ResteasyDeployment` | `deployment` |
    `protected SecurityDomain` | `domain` |
    `protected String` | `hostname` |
    `protected String` | `root` |
    `protected int` | `runtimePort` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NettyJaxrsServer()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected RequestDispatcher` | `createRequestDispatcher()` |
    `NettyJaxrsServer` | `deploy()` |
    `ResteasyDeployment` | `getDeployment()` |
    `String` | `getHostname()` |
    `int` | `getIdleTimeout()` |
    `int` | `getPort()` |
    `SniConfiguration` | `getSniConfiguration()` |
    `NettyJaxrsServer` | `setBacklog​(int backlog)` |
    `NettyJaxrsServer` | `setChannelHandlers​(List<io.netty.channel.ChannelHandler> channelHandlers)` | Add additional `ChannelHandler`s to the `ServerBootstrap`.
    `NettyJaxrsServer` | `setChannelOptions​(Map<io.netty.channel.ChannelOption,​Object> channelOptions)` | Add Netty `ChannelOption`s to the `ServerBootstrap`.
    `NettyJaxrsServer` | `setChildChannelOptions​(Map<io.netty.channel.ChannelOption,​Object> channelOptions)` | Add child options to the `ServerBootstrap`.
    `NettyJaxrsServer` | `setDeployment​(ResteasyDeployment deployment)` |
    `NettyJaxrsServer` | `setExecutorThreadCount​(int executorThreadCount)` | Set the number of threads to use for the EventExecutor.
    `NettyJaxrsServer` | `setHostname​(String hostname)` |
    `NettyJaxrsServer` | `setHttpChannelHandlers​(List<io.netty.channel.ChannelHandler> httpChannelHandlers)` | Add additional `ChannelHandler`s to the `ServerBootstrap`.
    `NettyJaxrsServer` | `setIdleTimeout​(int idleTimeoutSeconds)` | Set the idle timeout.
    `NettyJaxrsServer` | `setIoWorkerCount​(int ioWorkerCount)` | Specify the worker count to use.
    `NettyJaxrsServer` | `setMaxChunkSize​(int maxChunkSize)` |
    `NettyJaxrsServer` | `setMaxHeaderSize​(int maxHeaderSize)` |
    `NettyJaxrsServer` | `setMaxInitialLineLength​(int maxInitialLineLength)` |
    `NettyJaxrsServer` | `setMaxRequestSize​(int maxRequestSize)` | Set the max.
    `NettyJaxrsServer` | `setPort​(int port)` |
    `NettyJaxrsServer` | `setRootResourcePath​(String rootResourcePath)` |
    `NettyJaxrsServer` | `setSecurityDomain​(SecurityDomain sc)` |
    `NettyJaxrsServer` | `setSniConfiguration​(SniConfiguration sniConfiguration)` |
    `NettyJaxrsServer` | `setSSLContext​(SSLContext sslContext)` |
    `NettyJaxrsServer` | `start()` |
    `void` | `stop()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### bootstrap

          protected io.netty.bootstrap.ServerBootstrap bootstrap

    - #### hostname

          protected String hostname

    - #### configuredPort

          protected int configuredPort

    - #### runtimePort

          protected int runtimePort

    - #### deployment

          protected ResteasyDeployment deployment

    - #### root

          protected String root

    - #### domain

          protected SecurityDomain domain

  - ### Constructor Detail

    - #### NettyJaxrsServer

          public NettyJaxrsServer()

  - ### Method Detail

    - #### deploy

          public NettyJaxrsServer deploy()

      Specified by:
        `deploy` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### start

          public NettyJaxrsServer start()

      Specified by:
        `start` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### stop

          public void stop()

      Specified by:
        `stop` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### getDeployment

          public ResteasyDeployment getDeployment()

      Specified by:
        `getDeployment` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### setDeployment

          public NettyJaxrsServer setDeployment​(ResteasyDeployment deployment)

      Specified by:
        `setDeployment` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### setPort

          public NettyJaxrsServer setPort​(int port)

      Specified by:
        `setPort` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### getPort

          public int getPort()

    - #### setHostname

          public NettyJaxrsServer setHostname​(String hostname)

      Specified by:
        `setHostname` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### getHostname

          public String getHostname()

    - #### setRootResourcePath

          public NettyJaxrsServer setRootResourcePath​(String rootResourcePath)

      Specified by:
        `setRootResourcePath` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### setSecurityDomain

          public NettyJaxrsServer setSecurityDomain​(SecurityDomain sc)

      Specified by:
        `setSecurityDomain` in interface `EmbeddedJaxrsServer<NettyJaxrsServer>`

    - #### setSSLContext

          public NettyJaxrsServer setSSLContext​(SSLContext sslContext)

    - #### setSniConfiguration

          public NettyJaxrsServer setSniConfiguration​(SniConfiguration sniConfiguration)

    - #### getSniConfiguration

          public SniConfiguration getSniConfiguration()

    - #### 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)

    - #### setBacklog

          public NettyJaxrsServer setBacklog​(int backlog)

    - #### 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 `ChannelHandler`s to the `ServerBootstrap`.

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

      Parameters:
        `channelHandlers` - the additional `ChannelHandler`s.

    - #### setHttpChannelHandlers

          public NettyJaxrsServer setHttpChannelHandlers​(List<io.netty.channel.ChannelHandler> httpChannelHandlers)

      Add additional `ChannelHandler`s to the `ServerBootstrap`.

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

      Parameters:
        `httpChannelHandlers` - the additional `ChannelHandler`s.

    - #### setChannelOptions

          public NettyJaxrsServer setChannelOptions​(Map<io.netty.channel.ChannelOption,​Object> channelOptions)

      Add Netty `ChannelOption`s to the `ServerBootstrap`.
      Parameters:
        `channelOptions` - the additional `ChannelOption`s.
      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 `ChannelOption`s.
      See Also:
        `ServerBootstrap.childOption(io.netty.channel.ChannelOption, Object)`

    - #### createRequestDispatcher

          protected RequestDispatcher createRequestDispatcher()