|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Restlet
org.restlet.resource.Finder
org.restlet.ext.spring.SpringFinder
org.restlet.ext.spring.SpringBeanFinder
public class SpringBeanFinder
An alternative to SpringFinder
which uses Spring's BeanFactory
mechanism to load a prototype bean by name.
If both a BeanFactory
and a ApplicationContext
are provided,
the bean will be looked up first in the application context and then in the
bean factory.
Concurrency note: instances of this class or its subclasses can be invoked by
several threads at the same time and therefore must be thread-safe. You
should be especially careful when storing state in member variables.
Constructor Summary | |
---|---|
SpringBeanFinder()
Default constructor. |
|
SpringBeanFinder(Router router,
BeanFactory beanFactory,
String beanName)
Constructor. |
Method Summary | |
---|---|
ServerResource |
create()
Creates a new instance of the ServerResource class designated by
the "targetClass" property. |
ApplicationContext |
getApplicationContext()
Returns the parent application context. |
BeanFactory |
getBeanFactory()
Returns the parent bean factory. |
String |
getBeanName()
Returns the bean name. |
Context |
getContext()
|
Router |
getRouter()
Returns the associated router. |
void |
setApplicationContext(ApplicationContext applicationContext)
Sets the parent application context |
void |
setBeanFactory(BeanFactory beanFactory)
Sets the parent bean factory. |
void |
setBeanName(String beanName)
Sets the bean name. |
void |
setRouter(Router router)
Sets the associated router. |
Methods inherited from class org.restlet.ext.spring.SpringFinder |
---|
create, create |
Methods inherited from class org.restlet.resource.Finder |
---|
createFinder, find, getTargetClass, handle, setTargetClass, toString |
Methods inherited from class org.restlet.Restlet |
---|
createFinder, finalize, getApplication, getAuthor, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SpringBeanFinder()
public SpringBeanFinder(Router router, BeanFactory beanFactory, String beanName)
router
- The associated router used to retrieve the context.beanFactory
- The Spring bean factory.beanName
- The bean name.Method Detail |
---|
public ServerResource create()
SpringFinder
ServerResource
class designated by
the "targetClass" property. This method is intended to be configured as a
lookup method in Spring.
create
in class SpringFinder
public ApplicationContext getApplicationContext()
public BeanFactory getBeanFactory()
public String getBeanName()
public Context getContext()
getContext
in class Restlet
public Router getRouter()
public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
applicationContext
- The parent context.public void setBeanFactory(BeanFactory beanFactory)
setBeanFactory
in interface BeanFactoryAware
beanFactory
- The parent bean factory.public void setBeanName(String beanName)
beanName
- The bean name.public void setRouter(Router router)
router
- The associated router.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |