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 intconfiguredPortprotected HttpContextBuildercontextprotected ResteasyDeploymentdeploymentprotected com.sun.net.httpserver.HttpServerhttpServerprotected intruntimePort
-
Constructor Summary
Constructors Constructor Description SunHttpJaxrsServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SunHttpJaxrsServerdeploy()ResteasyDeploymentgetDeployment()intgetPort()Gets port number of this HttpServer.SunHttpJaxrsServersetDeployment(ResteasyDeployment deployment)SunHttpJaxrsServersetHostname(String hostname)SunHttpJaxrsServersetHttpServer(com.sun.net.httpserver.HttpServer httpServer)If you do not provide an HttpServer instance, one will be created on startupSunHttpJaxrsServersetPort(int port)Value is ignored if HttpServer property is set.SunHttpJaxrsServersetRootResourcePath(String rootResourcePath)SunHttpJaxrsServersetSecurityDomain(SecurityDomain securityDomain)Setting a security domain will turn on Basic AuthenticationSunHttpJaxrsServerstart()voidstop()
-
-
-
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
-
-
Method Detail
-
deploy
public SunHttpJaxrsServer deploy()
- Specified by:
deployin interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>
-
start
public SunHttpJaxrsServer start()
- Specified by:
startin interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>
-
stop
public void stop()
- Specified by:
stopin interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>
-
getDeployment
public ResteasyDeployment getDeployment()
- Specified by:
getDeploymentin interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>
-
setDeployment
public SunHttpJaxrsServer setDeployment(ResteasyDeployment deployment)
- Specified by:
setDeploymentin interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>
-
setPort
public SunHttpJaxrsServer setPort(int port)
Value is ignored if HttpServer property is set. Default value is 8080- Specified by:
setPortin interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>- Parameters:
port-
-
getPort
public int getPort()
Gets port number of this HttpServer.- Returns:
- port number.
-
setHostname
public SunHttpJaxrsServer setHostname(String hostname)
- Specified by:
setHostnamein interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>
-
setSecurityDomain
public SunHttpJaxrsServer setSecurityDomain(SecurityDomain securityDomain)
Setting a security domain will turn on Basic Authentication- Specified by:
setSecurityDomainin interfaceEmbeddedJaxrsServer<SunHttpJaxrsServer>- Parameters:
securityDomain-
-
setRootResourcePath
public SunHttpJaxrsServer setRootResourcePath(String rootResourcePath)
- Specified by:
setRootResourcePathin interfaceEmbeddedJaxrsServer<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-
-
-