@Contract @ConstrainedTo(value=SERVER) public interface ContainerProvider
Jersey application handler using the handler's
ApplicationHandler.apply(org.glassfish.jersey.server.ContainerRequest)
apply(requestContext)} method and sending the responses provided by the
application back to the client.
A provider shall support a one-to-one mapping between a type that is not of
the type Object. A provider may support
more than one one-to-one mapping or a mapping of sub-types of a type
(that is not of the type Object). A provider shall not conflict with other
providers.
An implementation (a service-provider) identifies itself by registering a proper
HK2 ContainterProvider contract binding in a custom HK2 binder configured
in the Jersey application handler.
Alternatively, the implementation can identify itself by placing a provider-configuration
file (if not already present), org.glassfish.jersey.server.spi.ContainerProvider
in the resource directory META-INF/services, and adding the fully
qualified service-provider-class of the implementation in the file.| Modifier and Type | Method and Description |
|---|---|
<T> T |
createContainer(Class<T> type,
ApplicationHandler appHandler)
Create an container of a given type.
|
<T> T createContainer(Class<T> type, ApplicationHandler appHandler) throws ProcessingException
T - the type of the container.type - the type of the container.appHandler - the Web application handler the container delegates to
for the handling of HTTP requests.type.ProcessingException - if there is an error creating the container.Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.