public class SpringFinder extends Finder
create()
. Finally, attach the SpringFinder to
your Router. When the create()
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="create" 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.
Constructor and Description |
---|
SpringFinder()
Constructor.
|
SpringFinder(Context context)
Constructor.
|
SpringFinder(Context context,
Class<? extends ServerResource> targetClass)
Constructor.
|
SpringFinder(Restlet restlet)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ServerResource |
create()
Creates a new instance of the
ServerResource class designated by
the "targetClass" property. |
ServerResource |
create(Class<? extends ServerResource> targetClass,
Request request,
Response response)
Calls the
create() method that can be configured as a lookup
method in Spring. |
ServerResource |
create(Request request,
Response response)
Creates a new instance of the
ServerResource subclass designated
by the "targetClass" property. |
createFinder, find, getTargetClass, handle, setTargetClass, toString
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner, start, stop
public SpringFinder()
public SpringFinder(Context context)
context
- The parent context.public SpringFinder(Context context, Class<? extends ServerResource> targetClass)
context
- The context.targetClass
- The target resource class.public SpringFinder(Restlet restlet)
restlet
- The parent Restlet.public ServerResource create()
ServerResource
class designated by
the "targetClass" property. This method is intended to be configured as a
lookup method in Spring.public ServerResource create(Class<? extends ServerResource> targetClass, Request request, Response response)
create()
method that can be configured as a lookup
method in Spring. Overriding this method was necessary for direct calls
to it, for example by unit tests.public ServerResource create(Request request, Response response)
Finder
ServerResource
subclass designated
by the "targetClass" property. The default behavior is to invoke the
Finder.create(Class, Request, Response)
with the "targetClass" property
as a parameter.Copyright © 2005–2016. All rights reserved.