com.noelios.restlet
Class TemplateDispatcher

java.lang.Object
  extended by org.restlet.Uniform
      extended by com.noelios.restlet.TemplateDispatcher
Direct Known Subclasses:
ChildClientDispatcher, ComponentClientDispatcher, ComponentServerDispatcher

public class TemplateDispatcher
extends Uniform

Base call dispatcher capable of resolving target resource URI templates. 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

Constructor Summary
TemplateDispatcher(Context context)
          Constructor.
 
Method Summary
protected  void doHandle(Request request, Response response)
          Actually handles the call.
 Context getContext()
          Returns the context.
 java.util.logging.Logger getLogger()
          Returns the context's logger.
 void handle(Request request, Response response)
          Handles the call after resolving any URI template on the request's target resource reference.
 
Methods inherited from class org.restlet.Uniform
delete, delete, get, get, handle, head, head, options, options, post, post, put, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateDispatcher

public TemplateDispatcher(Context context)
Constructor.

Parameters:
context - The context.
Method Detail

doHandle

protected void doHandle(Request request,
                        Response response)
Actually handles the call. Since this method only sets the request's original reference (Request.getOriginalRef() with the the targetted one, it must be overriden by subclasses.

Parameters:
request - The request to handle.
response - The response to update.

getContext

public Context getContext()
Returns the context.

Returns:
The context.

getLogger

public java.util.logging.Logger getLogger()
Returns the context's logger.

Returns:
The context's logger.

handle

public void handle(Request request,
                   Response response)
Handles the call after resolving any URI template on the request's target resource reference.

Specified by:
handle in class Uniform
Parameters:
request - The request to handle.
response - The response to update.


Copyright © 2005-2008 Noelios Technologies.