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

## Class ReactorNettyJaxrsServer

- java.lang.Object
- - org.jboss.resteasy.plugins.server.reactor.netty.ReactorNettyJaxrsServer

- All Implemented Interfaces:
    `EmbeddedJaxrsServer<ReactorNettyJaxrsServer>`

      public class ReactorNettyJaxrsServer
      extends Object
      implements EmbeddedJaxrsServer<ReactorNettyJaxrsServer>

  A server adapter built on top of reactor-netty. Similar to the adapter built on top of netty4, this adapter will ultimately run on Netty rails. Leveraging reactor-netty brings 3 main benefits, which are: 1. Reactor-netty's HttpServer + handle(req, resp) API is a little closer match to how a normal HTTP server works. Basically, it should be easier for an HTTP web server person to maintain compared to a raw Netty implementation. However, this assumes you don't have to delve into reactor-netty! 2. Reactor Netty puts a reactor facade on top of Netty. The Observable+Iterable programming paradigm is more general purpose than Netty's IO-centric Channel concept. In theory, it should be more beneficial to learn:) 3. When paired with a Netty-based client (e.g. the JAX-RS client powered by reactor-netty), the threadpool can be efficiently shared between the client and the server.

- - ### Field Summary

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

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ReactorNettyJaxrsServer` | `deploy()` |
    `ResteasyDeployment` | `getDeployment()` |
    `String` | `getHostname()` |
    `int` | `getPort()` |
    `ReactorNettyJaxrsServer` | `setCleanUpTasks​(List<Runnable> cleanUpTasks)` | Sets clean up tasks that are needed immediately after `Dispatcher.invoke(org.jboss.resteasy.spi.HttpRequest, org.jboss.resteasy.spi.HttpResponse)` yet before any asynchronous asynchronous work is continued by the reactor-netty server.
    `ReactorNettyJaxrsServer` | `setClientAuth​(io.netty.handler.ssl.ClientAuth clientAuth)` |
    `void` | `setDecoderSpecFn​(UnaryOperator<reactor.netty.http.server.HttpRequestDecoderSpec> decoderSpecFn)` |
    `ReactorNettyJaxrsServer` | `setDeployment​(ResteasyDeployment deployment)` |
    `ReactorNettyJaxrsServer` | `setHostname​(String hostname)` |
    `ReactorNettyJaxrsServer` | `setIdleTimeout​(Duration idleTimeout)` |
    `ReactorNettyJaxrsServer` | `setPort​(int port)` |
    `ReactorNettyJaxrsServer` | `setRootResourcePath​(String rootResourcePath)` |
    `ReactorNettyJaxrsServer` | `setSecurityDomain​(SecurityDomain sc)` |
    `ReactorNettyJaxrsServer` | `setSSLContext​(SSLContext sslContext)` |
    `ReactorNettyJaxrsServer` | `start()` |
    `void` | `startAndBlock()` | Calling this method will block the current thread.
    `void` | `stop()` |

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

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

- - ### Field Detail

    - #### hostname

          protected String hostname

    - #### configuredPort

          protected int configuredPort

    - #### runtimePort

          protected int runtimePort

    - #### root

          protected String root

    - #### deployment

          protected ResteasyDeployment deployment

    - #### domain

          protected SecurityDomain domain

  - ### Constructor Detail

    - #### ReactorNettyJaxrsServer

          public ReactorNettyJaxrsServer()

  - ### Method Detail

    - #### deploy

          public ReactorNettyJaxrsServer deploy()

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

    - #### start

          public ReactorNettyJaxrsServer start()

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

    - #### startAndBlock

          public void startAndBlock()

      Calling this method will block the current thread.

    - #### stop

          public void stop()

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

    - #### getDeployment

          public ResteasyDeployment getDeployment()

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

    - #### setDeployment

          public ReactorNettyJaxrsServer setDeployment​(ResteasyDeployment deployment)

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

    - #### setPort

          public ReactorNettyJaxrsServer setPort​(int port)

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

    - #### getPort

          public int getPort()

    - #### setHostname

          public ReactorNettyJaxrsServer setHostname​(String hostname)

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

    - #### getHostname

          public String getHostname()

    - #### setRootResourcePath

          public ReactorNettyJaxrsServer setRootResourcePath​(String rootResourcePath)

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

    - #### setSecurityDomain

          public ReactorNettyJaxrsServer setSecurityDomain​(SecurityDomain sc)

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

    - #### setIdleTimeout

          public ReactorNettyJaxrsServer setIdleTimeout​(Duration idleTimeout)

    - #### setSSLContext

          public ReactorNettyJaxrsServer setSSLContext​(SSLContext sslContext)

    - #### setClientAuth

          public ReactorNettyJaxrsServer setClientAuth​(io.netty.handler.ssl.ClientAuth clientAuth)

    - #### setCleanUpTasks

          public ReactorNettyJaxrsServer setCleanUpTasks​(List<Runnable> cleanUpTasks)

      Sets clean up tasks that are needed immediately after `Dispatcher.invoke(org.jboss.resteasy.spi.HttpRequest, org.jboss.resteasy.spi.HttpResponse)` yet before any asynchronous asynchronous work is continued by the reactor-netty server. Since these run on the Netty event loop threads, it is important that they run fast (not block). It is expected that you take special care with exceptions. This is useful in certain cases where servlet Filters have options that are hard to achieve with the pure JAX-RS API, such as: `doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) { establishThreadLocals(); chain.doFilter(req, resp, chain); clearThreadLocals(); }`
      Parameters:
        `cleanUpTasks` - List of clean up tasks
      Returns:
        ReactorNettyJaxrsServer

    - #### setDecoderSpecFn

          public void setDecoderSpecFn​(UnaryOperator<reactor.netty.http.server.HttpRequestDecoderSpec> decoderSpecFn)

      Parameters:
        `decoderSpecFn` -