Package org.jboss.resteasy.plugins.server.sun.http

## Class SunHttpJaxrsServer

- java.lang.Object
- - org.jboss.resteasy.plugins.server.sun.http.SunHttpJaxrsServer

- All Implemented Interfaces:
    `EmbeddedJaxrsServer<SunHttpJaxrsServer>`

      public class SunHttpJaxrsServer
      extends Object
      implements EmbeddedJaxrsServer<SunHttpJaxrsServer>

  com.sun.net.httpserver.HttpServer adapter for Resteasy. You may instead want to create and manage your own HttpServer. Use the HttpContextBuilder class in this case to build and register a specific HttpContext.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected int` | `configuredPort` |
    `protected HttpContextBuilder` | `context` |
    `protected ResteasyDeployment` | `deployment` |
    `protected com.sun.net.httpserver.HttpServer` | `httpServer` |
    `protected int` | `runtimePort` |

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SunHttpJaxrsServer` | `deploy()` |
    `ResteasyDeployment` | `getDeployment()` |
    `int` | `getPort()` | Gets port number of this HttpServer.
    `SunHttpJaxrsServer` | `setDeployment​(ResteasyDeployment deployment)` |
    `SunHttpJaxrsServer` | `setHostname​(String hostname)` |
    `SunHttpJaxrsServer` | `setHttpServer​(com.sun.net.httpserver.HttpServer httpServer)` | If you do not provide an HttpServer instance, one will be created on startup
    `SunHttpJaxrsServer` | `setPort​(int port)` | Value is ignored if HttpServer property is set.
    `SunHttpJaxrsServer` | `setRootResourcePath​(String rootResourcePath)` |
    `SunHttpJaxrsServer` | `setSecurityDomain​(SecurityDomain securityDomain)` | Setting a security domain will turn on Basic Authentication
    `SunHttpJaxrsServer` | `start()` |
    `void` | `stop()` |

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

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

- - ### Field Detail

    - #### context

          protected HttpContextBuilder context

    - #### httpServer

          protected com.sun.net.httpserver.HttpServer httpServer

    - #### configuredPort

          protected int configuredPort

    - #### runtimePort

          protected int runtimePort

    - #### deployment

          protected ResteasyDeployment deployment

  - ### Constructor Detail

    - #### SunHttpJaxrsServer

          public SunHttpJaxrsServer()

  - ### Method Detail

    - #### deploy

          public SunHttpJaxrsServer deploy()

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

    - #### start

          public SunHttpJaxrsServer start()

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

    - #### stop

          public void stop()

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

    - #### getDeployment

          public ResteasyDeployment getDeployment()

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

    - #### setDeployment

          public SunHttpJaxrsServer setDeployment​(ResteasyDeployment deployment)

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

    - #### setPort

          public SunHttpJaxrsServer setPort​(int port)

      Value is ignored if HttpServer property is set. Default value is 8080
      Specified by:
        `setPort` in interface `EmbeddedJaxrsServer<SunHttpJaxrsServer>`
      Parameters:
        `port` -

    - #### getPort

          public int getPort()

      Gets port number of this HttpServer.
      Returns:
        port number.

    - #### setHostname

          public SunHttpJaxrsServer setHostname​(String hostname)

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

    - #### setSecurityDomain

          public SunHttpJaxrsServer setSecurityDomain​(SecurityDomain securityDomain)

      Setting a security domain will turn on Basic Authentication
      Specified by:
        `setSecurityDomain` in interface `EmbeddedJaxrsServer<SunHttpJaxrsServer>`
      Parameters:
        `securityDomain` -

    - #### setRootResourcePath

          public SunHttpJaxrsServer setRootResourcePath​(String rootResourcePath)

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

    - #### setHttpServer

          public SunHttpJaxrsServer setHttpServer​(com.sun.net.httpserver.HttpServer httpServer)

      If you do not provide an HttpServer instance, one will be created on startup
      Parameters:
        `httpServer` -