Package org.apache.cxf.jaxrs.lifecycle
Class SingletonResourceProvider
java.lang.Object
org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider
- All Implemented Interfaces:
ResourceProvider
The default singleton resource provider which returns
the same resource instance per every request
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInstance
(org.apache.cxf.message.Message m) Returns the resource instance which will handle the current requestClass<?>
Returns the Class of the resourcevoid
init
(org.apache.cxf.endpoint.Endpoint ep) boolean
Indicates if the managed resource is a singletonvoid
releaseInstance
(org.apache.cxf.message.Message m, Object o) Releases the resource instance if needed
-
Constructor Details
-
SingletonResourceProvider
-
SingletonResourceProvider
-
-
Method Details
-
init
public void init(org.apache.cxf.endpoint.Endpoint ep) -
isSingleton
public boolean isSingleton()Indicates if the managed resource is a singleton- Specified by:
isSingleton
in interfaceResourceProvider
- Returns:
-
getInstance
Returns the resource instance which will handle the current request- Specified by:
getInstance
in interfaceResourceProvider
- Parameters:
m
- the current request message- Returns:
- resource instance
-
releaseInstance
Releases the resource instance if needed- Specified by:
releaseInstance
in interfaceResourceProvider
- Parameters:
m
- the current request messageo
- resource instance
-
getResourceClass
Returns the Class of the resource- Specified by:
getResourceClass
in interfaceResourceProvider
- Returns:
-