com.sun.jersey.api.core
Interface ResourceContext


public interface ResourceContext

The resource context provides access to instances of resource classes.

This interface can be injected using the Context annotation.

The resource context can be utilized when instances of managed resource classes are to be returned by sub-resource locator methods. Such instances will be injected and managed within the declared scope just like instances of root resource classes.

Author:
Martin Grotzke

Method Summary
<T> T
getResource(java.lang.Class<T> c)
          Provides an instance of the given resource class.
 

Method Detail

getResource

<T> T getResource(java.lang.Class<T> c)
              throws ContainerException
Provides an instance of the given resource class.

Type Parameters:
T - the type of the resource class
Parameters:
c - the resource class
Returns:
an instance if it could be resolved, otherwise null.
Throws:
ContainerException - if the resource class cannot be found.


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