Package org.apache.cxf.jaxrs.spring
Class SpringResourceFactory
java.lang.Object
org.apache.cxf.jaxrs.spring.SpringResourceFactory
- All Implemented Interfaces:
ResourceProvider
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class SpringResourceFactory
extends Object
implements ResourceProvider, org.springframework.context.ApplicationContextAware
The ResourceProvider implementation which delegates to
ApplicationContext to manage the life-cycle of the resource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
org.springframework.context.ApplicationContext
getInstance
(org.apache.cxf.message.Message m) Returns the resource instance which will handle the current requestClass<?>
Returns the Class of the resourceprotected void
initInstance
(org.apache.cxf.message.Message m, Object instance) boolean
boolean
boolean
Indicates if the managed resource is a singletonvoid
releaseInstance
(org.apache.cxf.message.Message m, Object o) Releases the resource instance if neededvoid
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
void
setCallPostConstruct
(boolean callPostConstruct) void
setCallPreDestroy
(boolean callPreDestroy) void
setPostConstructMethodName
(String postConstructMethodName) void
setPreDestroyMethodName
(String preDestroyMethodName)
-
Constructor Details
-
SpringResourceFactory
public SpringResourceFactory() -
SpringResourceFactory
-
-
Method Details
-
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
-
initInstance
-
isSingleton
public boolean isSingleton()Indicates if the managed resource is a singleton- Specified by:
isSingleton
in interfaceResourceProvider
- Returns:
-
releaseInstance
Releases the resource instance if needed- Specified by:
releaseInstance
in interfaceResourceProvider
- Parameters:
m
- the current request messageo
- resource instance
-
doCallPreDestroy
protected boolean doCallPreDestroy() -
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
setBeanId
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext() -
getResourceClass
Returns the Class of the resource- Specified by:
getResourceClass
in interfaceResourceProvider
- Returns:
-
setCallPostConstruct
public void setCallPostConstruct(boolean callPostConstruct) -
isCallPostConstruct
public boolean isCallPostConstruct() -
setCallPreDestroy
public void setCallPreDestroy(boolean callPreDestroy) -
isCallPreDestroy
public boolean isCallPreDestroy() -
setPreDestroyMethodName
-
setPostConstructMethodName
-