Apache CXF API

org.apache.cxf.jaxrs.lifecycle
Class SingletonResourceProvider

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

public class SingletonResourceProvider
extends Object
implements ResourceProvider

The default singleton resource provider which returns the same resource instance per every request


Constructor Summary
SingletonResourceProvider(Object o)
           
SingletonResourceProvider(Object o, boolean callPostConstruct)
           
 
Method Summary
 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

SingletonResourceProvider

public SingletonResourceProvider(Object o,
                                 boolean callPostConstruct)

SingletonResourceProvider

public SingletonResourceProvider(Object o)
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

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