| org.restlet.Finder org.restlet.ext.spring.SpringFinder
SpringFinder | public class SpringFinder extends Finder (Code) | | Finder that is specialized for easier usage by Spring wiring services. The idea
is to create a singleton Spring bean based on that SpringFinder and configure
it using Spring's "lookup-method" element to return instances of a
"prototype" bean for
SpringFinder.createResource() . Finally, attach the
SpringFinder to your Router. When the createResource() method is invoked, a
new instance of your prototype bean will be created and returned.
A sample xml for "lookup-method":
<bean id="myFinder" class="org.restlet.ext.spring.SpringFinder">
<lookup-method name="createResource" bean="myResource"/>
</bean>
<bean id="myResource" class="com.mycompany.rest.resource.MyResource" scope="prototype">
<property name="aProperty" value="anotherOne"/>
<property name="oneMore" value="true"/>
</bean>
Note that the Code Generation Library
(cglib) will be required in order to use the Spring's lookup method
mechanism.
author: Jerome Louvel (contact@noelios.com) |
SpringFinder | public SpringFinder()(Code) | | Constructor.
|
SpringFinder | public SpringFinder(Context context)(Code) | | Constructor.
Parameters: context - The context. |
SpringFinder | public SpringFinder(Context context, Class<? extends Resource> targetClass)(Code) | | Constructor.
Parameters: context - The context. Parameters: targetClass - The target resource class. |
|
|