Package org.restlet.engine.component
Class ComponentClientDispatcher
- java.lang.Object
-
- org.restlet.Restlet
-
- org.restlet.routing.Filter
-
- org.restlet.engine.util.TemplateDispatcher
-
- org.restlet.engine.component.ComponentClientDispatcher
-
- All Implemented Interfaces:
Uniform
public class ComponentClientDispatcher extends TemplateDispatcher
Component client dispatcher. 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 as member variables.
-
-
Field Summary
Fields Modifier and Type Field Description private ComponentContextcomponentContextThe component context.
-
Constructor Summary
Constructors Constructor Description ComponentClientDispatcher(ComponentContext componentContext)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intdoHandle(Request request, Response response)Handles the call by distributing it to the next Restlet.private ComponentgetComponent()Returns the parent component.private ComponentContextgetComponentContext()Returns the component context.-
Methods inherited from class org.restlet.engine.util.TemplateDispatcher
afterHandle, beforeHandle
-
Methods inherited from class org.restlet.routing.Filter
getNext, handle, hasNext, setNext, setNext, start, stop
-
Methods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
-
-
-
-
Field Detail
-
componentContext
private ComponentContext componentContext
The component context.
-
-
Constructor Detail
-
ComponentClientDispatcher
public ComponentClientDispatcher(ComponentContext componentContext)
Constructor.- Parameters:
componentContext- The component context.
-
-
Method Detail
-
doHandle
protected int doHandle(Request request, Response response)
Description copied from class:FilterHandles the call by distributing it to the next Restlet. If no Restlet is attached, then aStatus.SERVER_ERROR_INTERNALstatus is returned. ReturnsFilter.CONTINUEby default.- Overrides:
doHandlein classFilter- Parameters:
request- The request to handle.response- The response to update.- Returns:
- The continuation status. Either
Filter.CONTINUEorFilter.STOP.
-
getComponent
private Component getComponent()
Returns the parent component.- Returns:
- The parent component.
-
getComponentContext
private ComponentContext getComponentContext()
Returns the component context.- Returns:
- The component context.
-
-