com.noelios.restlet
Class ChainHelper<T extends Restlet>

java.lang.Object
  extended by org.restlet.util.Helper<T>
      extended by com.noelios.restlet.ChainHelper<T>
Direct Known Subclasses:
ApplicationHelper, ComponentHelper

public abstract class ChainHelper<T extends Restlet>
extends Helper<T>

Chain helper serving as base class for Application and Component helpers.

Author:
Jerome Louvel

Constructor Summary
ChainHelper(T helped)
          Constructor.
 
Method Summary
protected  void addFilter(Filter filter)
          Adds a new filter to the chain.
 void clear()
          Clears the chain.
protected  Filter createLogFilter(Context context, LogService logService)
          Creates a new log filter.
protected  Restlet getFirst()
          Returns the first Restlet.
protected  Filter getLast()
          Returns the last Filter.
 void handle(Request request, Response response)
           
protected  void setFirst(Restlet first)
          Sets the first Restlet.
protected  void setLast(Filter last)
          Sets the last Filter.
protected  void setNext(Restlet next)
          Sets the next Restlet after the chain.
 
Methods inherited from class org.restlet.util.Helper
getAttributes, getContext, getHelped, getHelpedParameters, getLogger, setHelped, start, stop, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainHelper

public ChainHelper(T helped)
Constructor.

Parameters:
helped - The helped Restlet.
Method Detail

addFilter

protected void addFilter(Filter filter)
Adds a new filter to the chain.

Parameters:
filter - The filter to add.

clear

public void clear()
Clears the chain. Sets the first and last filters to null.


createLogFilter

protected Filter createLogFilter(Context context,
                                 LogService logService)
Creates a new log filter. Allows overriding.

Parameters:
context - The context.
logService - The log service descriptor.
Returns:
The new log filter.

getFirst

protected Restlet getFirst()
Returns the first Restlet.

Returns:
the first Restlet.

getLast

protected Filter getLast()
Returns the last Filter.

Returns:
the last Filter.

handle

public void handle(Request request,
                   Response response)
Overrides:
handle in class Helper<T extends Restlet>

setFirst

protected void setFirst(Restlet first)
Sets the first Restlet.

Parameters:
first - The first Restlet.

setLast

protected void setLast(Filter last)
Sets the last Filter.

Parameters:
last - The last Filter.

setNext

protected void setNext(Restlet next)
Sets the next Restlet after the chain.

Parameters:
next - The Restlet to process after the chain.


Copyright © 2005-2008 Noelios Technologies.