Class TemplateDispatcher

  • All Implemented Interfaces:
    org.restlet.Uniform
    Direct Known Subclasses:
    ChildClientDispatcher, ComponentClientDispatcher, ComponentServerDispatcher

    public class TemplateDispatcher
    extends org.restlet.routing.Filter
    Filter that resolves URI templates in the target resource URI reference using the request attributes. 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.
    Author:
    Jerome Louvel
    • Field Summary

      • Fields inherited from class org.restlet.routing.Filter

        CONTINUE, SKIP, STOP
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void afterHandle​(org.restlet.Request request, org.restlet.Response response)
      If the response entity comes back with no identifier, automatically set the request's resource reference's identifier.
      int beforeHandle​(org.restlet.Request request, org.restlet.Response response)
      Handles the call after resolving any URI template on the request's target resource reference.
      • Methods inherited from class org.restlet.routing.Filter

        doHandle, 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
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TemplateDispatcher

        public TemplateDispatcher()
    • Method Detail

      • afterHandle

        protected void afterHandle​(org.restlet.Request request,
                                   org.restlet.Response response)
        If the response entity comes back with no identifier, automatically set the request's resource reference's identifier. This is very useful to resolve relative references in XSLT for example.
        Overrides:
        afterHandle in class org.restlet.routing.Filter
        Parameters:
        request - The request to handle.
        response - The response to update.
      • beforeHandle

        public int beforeHandle​(org.restlet.Request request,
                                org.restlet.Response response)
        Handles the call after resolving any URI template on the request's target resource reference.
        Overrides:
        beforeHandle in class org.restlet.routing.Filter
        Parameters:
        request - The request to handle.
        response - The response to update.
        Returns:
        The continuation status. Either Filter.CONTINUE or Filter.SKIP or Filter.STOP.