Package org.glassfish.jersey.simple
Class SimpleContainer
- java.lang.Object
-
- org.glassfish.jersey.simple.SimpleContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSimpleContainer.ResponseWriterprivate static classSimpleContainer.SimpleBinderAn internal binder to enable Simple HTTP container specific types injection.private static classSimpleContainer.SimpleRequestReferencingFactoryReferencing factory for Simple request.private static classSimpleContainer.SimpleResponseReferencingFactoryReferencing factory for Simple response.private static classSimpleContainer.TimeoutDispatcherprivate static classSimpleContainer.TimeoutTimer
-
Field Summary
Fields Modifier and Type Field Description private ApplicationHandlerappHandlerprivate static ExtendedLoggerloggerprivate java.lang.reflect.TypeRequestTYPEprivate java.lang.reflect.TypeResponseTYPEprivate java.util.concurrent.ScheduledExecutorServicescheduler-
Fields inherited from interface org.glassfish.jersey.server.spi.Container
DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT
-
-
Constructor Summary
Constructors Constructor Description SimpleContainer(javax.ws.rs.core.Application application)Create a new Simple framework HTTP container.SimpleContainer(javax.ws.rs.core.Application application, java.lang.Object parentContext)Create a new Simple framework HTTP container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclose(org.simpleframework.http.Response response)ApplicationHandlergetApplicationHandler()Get the Jersey server-side application handler associated with the container.private java.net.URIgetBaseUri(org.simpleframework.http.Request request)ResourceConfiggetConfiguration()Return an immutable representation of the currentconfiguration.private java.net.URIgetRequestUri(org.simpleframework.http.Request request, java.net.URI baseUri)private javax.ws.rs.core.SecurityContextgetSecurityContext(org.simpleframework.http.Request request)private java.lang.StringgetServerAddress(java.net.URI baseUri)voidhandle(org.simpleframework.http.Request request, org.simpleframework.http.Response response)(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 ExtendedLogger logger
-
RequestTYPE
private final java.lang.reflect.Type RequestTYPE
-
ResponseTYPE
private final java.lang.reflect.Type ResponseTYPE
-
scheduler
private volatile java.util.concurrent.ScheduledExecutorService scheduler
-
appHandler
private volatile ApplicationHandler appHandler
-
-
Constructor Detail
-
SimpleContainer
SimpleContainer(javax.ws.rs.core.Application application, java.lang.Object parentContext)Create a new Simple framework HTTP container.- Parameters:
application- JAX-RS / Jersey application to be deployed on Simple framework HTTP container.parentContext- DI provider specific context with application's registered bindings.
-
SimpleContainer
SimpleContainer(javax.ws.rs.core.Application application)
Create a new Simple framework HTTP container.- Parameters:
application- JAX-RS / Jersey application to be deployed on Simple framework HTTP container.
-
-
Method Detail
-
handle
public void handle(org.simpleframework.http.Request request, org.simpleframework.http.Response response)- Specified by:
handlein interfaceorg.simpleframework.http.core.Container
-
getRequestUri
private java.net.URI getRequestUri(org.simpleframework.http.Request request, java.net.URI baseUri)
-
getServerAddress
private java.lang.String getServerAddress(java.net.URI baseUri) throws java.net.URISyntaxException- Throws:
java.net.URISyntaxException
-
getBaseUri
private java.net.URI getBaseUri(org.simpleframework.http.Request request)
-
getSecurityContext
private javax.ws.rs.core.SecurityContext getSecurityContext(org.simpleframework.http.Request request)
-
close
private void close(org.simpleframework.http.Response response)
-
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.
-
-