Apache CXF API

org.apache.cxf.jaxrs.lifecycle
Class PerRequestResourceProvider

java.lang.Object
  extended by org.apache.cxf.jaxrs.lifecycle.PerRequestResourceProvider
All Implemented Interfaces:
ResourceProvider

public class PerRequestResourceProvider
extends Object
implements ResourceProvider

The default per-request resource provider which creates a new resource instance per every request


Constructor Summary
PerRequestResourceProvider(Class<?> clazz)
           
 
Method Summary
protected  Object createInstance(Message m)
           
 Object getInstance(Message m)
          Returns the resource instance which will handle the current request
 Class<?> getResourceClass()
          Returns the Class of the resource
 boolean isSingleton()
          Indicates if the managed resource is a singleton
 void releaseInstance(Message m, Object o)
          Releases the resource instance if needed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerRequestResourceProvider

public PerRequestResourceProvider(Class<?> clazz)
Method Detail

isSingleton

public boolean isSingleton()
Indicates if the managed resource is a singleton

Specified by:
isSingleton in interface ResourceProvider
Returns:

getInstance

public Object getInstance(Message m)
Returns the resource instance which will handle the current request

Specified by:
getInstance in interface ResourceProvider
Parameters:
m - the current request message
Returns:
resource instance

createInstance

protected Object createInstance(Message m)

releaseInstance

public void releaseInstance(Message m,
                            Object o)
Releases the resource instance if needed

Specified by:
releaseInstance in interface ResourceProvider
Parameters:
m - the current request message
o - resource instance

getResourceClass

public Class<?> getResourceClass()
Returns the Class of the resource

Specified by:
getResourceClass in interface ResourceProvider
Returns:

Apache CXF API

Apache CXF