com.sun.ws.rest.spi.container
Interface ContainerProvider<T>


public interface ContainerProvider<T>

Service-provider interface for creating container instances.

A container instance will be created according to the the supporting generic type of the container.

A provider shall support a one-to-one mapping between a type that is 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 placing a provider-configuration file (if not already present), "com.sun.research.ws.rest.spi.container.ContainerProvider" in the resource directory META-INF/services, and including the fully qualified service-provider-class of the implementation in the file.


Method Summary
 T createContainer(java.lang.Class<T> type, ResourceConfig resourceConfig, WebApplication application)
          Create an container of type T.
 

Method Detail

createContainer

T createContainer(java.lang.Class<T> type,
                  ResourceConfig resourceConfig,
                  WebApplication application)
                  throws ContainerException
Create an container of type T.

The container provider is responsible for initiating the Web application with the resource configuration.

Parameters:
type - the type of the container.
resourceConfig - the resource configuration.
application - the Web application the container delegates to for the handling of a HTTP request.
Returns:
the container, otherwise null if the provider does not support the requested type.
Throws:
ContainerException - if there is an error creating the container.