Interface ContainerProvider
-
- All Known Implementing Classes:
JdkHttpHandlerContainerProvider
,JettyHttpContainerProvider
,SimpleContainerProvider
@Contract @ConstrainedTo(SERVER) public interface ContainerProvider
Service-provider interface for creating container instances. If supported by the provider, a container instance of the requested Java type will be created.The created container is responsible for listening on a communication chanel for new client requests, dispatching these requests to the registered
Jersey application handler
using the handler'sApplicationHandler.handle(org.glassfish.jersey.server.ContainerRequest)
handle(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, provided the type is not
Object
. A provider may also support mapping of sub-types of a type (provided the type is notObject
). It is expected that each provider supports mapping for distinct set of types and subtypes so that different providers do not conflict with each other.An implementation can identify itself by placing a Java service provider configuration file (if not already present) -
org.glassfish.jersey.server.spi.ContainerProvider
- in the resource directoryMETA-INF/services
, and adding the fully qualified service-provider-class of the implementation in the file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
createContainer(java.lang.Class<T> type, javax.ws.rs.core.Application application)
Create an container of a given type.
-
-
-
Method Detail
-
createContainer
<T> T createContainer(java.lang.Class<T> type, javax.ws.rs.core.Application application) throws javax.ws.rs.ProcessingException
Create an container of a given type.- Type Parameters:
T
- the type of the container.- Parameters:
type
- the type of the container.application
- JAX-RS / Jersey application.- Returns:
- the container, otherwise
null
if the provider does not support the requestedtype
. - Throws:
javax.ws.rs.ProcessingException
- if there is an error creating the container.
-
-