Class JdkHttpHandlerContainer
java.lang.Object
org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer
- All Implemented Interfaces:
com.sun.net.httpserver.HttpHandler, Container
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsFields inherited from interface Container
DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT -
Constructor Summary
ConstructorsConstructorDescriptionJdkHttpHandlerContainer(javax.ws.rs.core.Application application) Create new lightweight Java SE HTTP server container.JdkHttpHandlerContainer(javax.ws.rs.core.Application application, Object parentContext) Create new lightweight Java SE HTTP server container. -
Method Summary
Modifier and TypeMethodDescriptionGet the Jersey server-side application handler associated with the container.private URIgetBaseUri(com.sun.net.httpserver.HttpExchange exchange, String decodedBasePath, String scheme) Return an immutable representation of the currentconfiguration.private URIgetRequestUri(com.sun.net.httpserver.HttpExchange exchange, URI baseUri) private javax.ws.rs.core.SecurityContextgetSecurityContext(Principal principal, boolean isSecure) private StringgetServerAddress(URI baseUri) voidhandle(com.sun.net.httpserver.HttpExchange exchange) (package private) voidInform this container that the server has been started.(package private) voidInform 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 Details
-
LOGGER
-
appHandler
-
-
Constructor Details
-
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, 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 Details
-
handle
- Specified by:
handlein interfacecom.sun.net.httpserver.HttpHandler- Throws:
IOException
-
getBaseUri
-
getRequestUri
-
getServerAddress
- Throws:
URISyntaxException
-
getSecurityContext
-
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
Description copied from interface:ContainerReload the hosted Jersey application using a newconfiguration. -
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.
-