Package org.restlet.engine.component
Class ComponentServerDispatcher
- java.lang.Object
-
- org.restlet.Restlet
-
- org.restlet.routing.Filter
-
- org.restlet.engine.util.TemplateDispatcher
-
- org.restlet.engine.component.ComponentServerDispatcher
-
- All Implemented Interfaces:
Uniform
public class ComponentServerDispatcher extends TemplateDispatcher
Component server 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 ComponentServerDispatcher(ComponentContext componentContext)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbeforeHandle(Request request, Response response)Handles the call after resolving any URI template on the request's target resource reference.protected intdoHandle(Request request, Response response)Handles the call by distributing it to the next Restlet.private ComponentContextgetComponentContext()Returns the component context.-
Methods inherited from class org.restlet.engine.util.TemplateDispatcher
afterHandle
-
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
-
ComponentServerDispatcher
public ComponentServerDispatcher(ComponentContext componentContext)
Constructor.- Parameters:
componentContext- The component context.
-
-
Method Detail
-
beforeHandle
public int beforeHandle(Request request, Response response)
Description copied from class:TemplateDispatcherHandles the call after resolving any URI template on the request's target resource reference.- Overrides:
beforeHandlein classTemplateDispatcher- Parameters:
request- The request to handle.response- The response to update.- Returns:
- The continuation status. Either
Filter.CONTINUEorFilter.SKIPorFilter.STOP.
-
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.
-
getComponentContext
private ComponentContext getComponentContext()
Returns the component context.- Returns:
- The component context.
-
-