com.sun.jersey.spi.resource
Interface ResourceProvider


public interface ResourceProvider

A provider that manages the creation of resource class instances. A provider instance is specific to a particular class of a resource.

It is the responsibility of a ResourceProvider to perform injection onto the properties of a resource. If injection is required then declare an injectable field of the type InjectableProviderContext annotated with Context and create a ResourceClassInjector instance to be used to perform injection onto the provided resource. This may be performed in the init method.


Method Summary
 java.lang.Object getInstance(ComponentProvider provider, HttpContext context)
          Called to obtain an instance of a resource class.
 void init(ComponentProvider provider, ComponentProvider resourceProvider, AbstractResource resource)
          Specifies the class of the resource that the provider instance will manage access to.
 

Method Detail

init

void init(ComponentProvider provider,
          ComponentProvider resourceProvider,
          AbstractResource resource)
Specifies the class of the resource that the provider instance will manage access to.

Parameters:
provider - the component provider
resourceProvider - the component provider for resource classes
resource - the abstract resource

getInstance

java.lang.Object getInstance(ComponentProvider provider,
                             HttpContext context)
Called to obtain an instance of a resource class.

Parameters:
provider - the component provider
context - the HTTP context
Returns:
an initialized instance of the supplied class


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.