Package org.glassfish.jersey.jdkhttp
Class JdkHttpHandlerContainer
- java.lang.Object
-
- org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJdkHttpHandlerContainer.ResponseWriter
-
Field Summary
Fields Modifier and Type Field Description private ApplicationHandlerappHandlerprivate static java.util.logging.LoggerLOGGER-
Fields inherited from interface org.glassfish.jersey.server.spi.Container
DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT
-
-
Constructor Summary
Constructors Constructor Description JdkHttpHandlerContainer(javax.ws.rs.core.Application application)Create new lightweight Java SE HTTP server container.JdkHttpHandlerContainer(javax.ws.rs.core.Application application, java.lang.Object parentContext)Create new lightweight Java SE HTTP server container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationHandlergetApplicationHandler()Get the Jersey server-side application handler associated with the container.private java.net.URIgetBaseUri(com.sun.net.httpserver.HttpExchange exchange, java.lang.String decodedBasePath, java.lang.String scheme)ResourceConfiggetConfiguration()Return an immutable representation of the currentconfiguration.private java.net.URIgetRequestUri(com.sun.net.httpserver.HttpExchange exchange, java.net.URI baseUri)private javax.ws.rs.core.SecurityContextgetSecurityContext(java.security.Principal principal, boolean isSecure)private java.lang.StringgetServerAddress(java.net.URI baseUri)voidhandle(com.sun.net.httpserver.HttpExchange exchange)(package private) voidonServerStart()Inform this container that the server has been started.(package private) voidonServerStop()Inform this container that the server is being stopped.voidreload()Reload the hosted Jersey application using the currentconfiguration.voidreload(ResourceConfig configuration)Reload the hosted Jersey application using a newconfiguration.
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
appHandler
private volatile ApplicationHandler appHandler
-
-
Constructor Detail
-
JdkHttpHandlerContainer
JdkHttpHandlerContainer(javax.ws.rs.core.Application application)
Create new lightweight Java SE HTTP server container.- Parameters:
application- JAX-RS / Jersey application to be deployed on the container.
-
JdkHttpHandlerContainer
JdkHttpHandlerContainer(javax.ws.rs.core.Application application, java.lang.Object parentContext)Create new lightweight Java SE HTTP server container.- Parameters:
application- JAX-RS / Jersey application to be deployed on the container.parentContext- DI provider specific context with application's registered bindings.
-
-
Method Detail
-
handle
public void handle(com.sun.net.httpserver.HttpExchange exchange) throws java.io.IOException- Specified by:
handlein interfacecom.sun.net.httpserver.HttpHandler- Throws:
java.io.IOException
-
getBaseUri
private java.net.URI getBaseUri(com.sun.net.httpserver.HttpExchange exchange, java.lang.String decodedBasePath, java.lang.String scheme)
-
getRequestUri
private java.net.URI getRequestUri(com.sun.net.httpserver.HttpExchange exchange, java.net.URI baseUri)
-
getServerAddress
private java.lang.String getServerAddress(java.net.URI baseUri) throws java.net.URISyntaxException- Throws:
java.net.URISyntaxException
-
getSecurityContext
private javax.ws.rs.core.SecurityContext getSecurityContext(java.security.Principal principal, boolean isSecure)
-
getConfiguration
public ResourceConfig getConfiguration()
Description copied from interface:ContainerReturn an immutable representation of the currentconfiguration.- Specified by:
getConfigurationin interfaceContainer- Returns:
- current configuration of the hosted Jersey application.
-
reload
public void reload()
Description copied from interface:ContainerReload the hosted Jersey application using the currentconfiguration.
-
reload
public void reload(ResourceConfig configuration)
Description copied from interface:ContainerReload the hosted Jersey application using a newconfiguration.
-
getApplicationHandler
public ApplicationHandler getApplicationHandler()
Description copied from interface:ContainerGet the Jersey server-side application handler associated with the container.- Specified by:
getApplicationHandlerin interfaceContainer- Returns:
- Jersey server-side application handler associated with the container.
-
onServerStart
void onServerStart()
Inform this container that the server has been started. This method must be implicitly called after the server containing this container is started.
-
onServerStop
void onServerStop()
Inform this container that the server is being stopped. This method must be implicitly called before the server containing this container is stopped.
-
-