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
Constructors Constructor Description SpringResourceFactory()SpringResourceFactory(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoCallPreDestroy()org.springframework.context.ApplicationContextgetApplicationContext()ObjectgetInstance(Message m)Returns the resource instance which will handle the current requestClass<?>getResourceClass()Returns the Class of the resourceprotected voidinitInstance(Message m, Object instance)booleanisCallPostConstruct()booleanisCallPreDestroy()booleanisSingleton()Indicates if the managed resource is a singletonvoidreleaseInstance(Message m, Object o)Releases the resource instance if neededvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetBeanId(String serviceBeanId)voidsetCallPostConstruct(boolean callPostConstruct)voidsetCallPreDestroy(boolean callPreDestroy)voidsetPostConstructMethodName(String postConstructMethodName)voidsetPreDestroyMethodName(String preDestroyMethodName)
-
-
-
Constructor Detail
-
SpringResourceFactory
public SpringResourceFactory()
-
SpringResourceFactory
public SpringResourceFactory(String name)
-
-
Method Detail
-
getInstance
public Object getInstance(Message m)
Returns the resource instance which will handle the current request- Specified by:
getInstancein interfaceResourceProvider- Parameters:
m- the current request message- Returns:
- resource instance
-
isSingleton
public boolean isSingleton()
Indicates if the managed resource is a singleton- Specified by:
isSingletonin interfaceResourceProvider- Returns:
-
releaseInstance
public void releaseInstance(Message m, Object o)
Releases the resource instance if needed- Specified by:
releaseInstancein 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setBeanId
public void setBeanId(String serviceBeanId)
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()
-
getResourceClass
public Class<?> getResourceClass()
Returns the Class of the resource- Specified by:
getResourceClassin interfaceResourceProvider- Returns:
-
setCallPostConstruct
public void setCallPostConstruct(boolean callPostConstruct)
-
isCallPostConstruct
public boolean isCallPostConstruct()
-
setCallPreDestroy
public void setCallPreDestroy(boolean callPreDestroy)
-
isCallPreDestroy
public boolean isCallPreDestroy()
-
setPreDestroyMethodName
public void setPreDestroyMethodName(String preDestroyMethodName)
-
setPostConstructMethodName
public void setPostConstructMethodName(String postConstructMethodName)
-
-