Apache CXF API

org.apache.cxf.jaxrs.spring
Class SpringResourceFactory

java.lang.Object
  extended by org.apache.cxf.jaxrs.spring.SpringResourceFactory
All Implemented Interfaces:
ResourceProvider, 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
SpringResourceFactory()
           
SpringResourceFactory(String name)
           
 
Method Summary
 org.springframework.context.ApplicationContext getApplicationContext()
           
 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
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setBeanId(String serviceBeanId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
getInstance in interface ResourceProvider
Parameters:
m - the current request message
Returns:
resource instance

isSingleton

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

Specified by:
isSingleton in interface ResourceProvider
Returns:

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

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.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:
getResourceClass in interface ResourceProvider
Returns:

Apache CXF API

Apache CXF