com.noelios.restlet.component
Class ComponentHelper

java.lang.Object
  extended by org.restlet.util.Helper
      extended by com.noelios.restlet.ChainHelper
          extended by com.noelios.restlet.component.ComponentHelper

public class ComponentHelper
extends ChainHelper

Component helper.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
ComponentHelper(Component component)
          Constructor.
 
Method Summary
 Context createContext(String loggerName)
          Creates a new context.
protected  StatusFilter createStatusFilter(Component component)
          Creates a new status filter.
 ClientRouter getClientRouter()
          Returns the internal client router.
protected  Component getComponent()
          Returns the helped component.
 ServerRouter getServerRouter()
          Returns the internal host router.
 void handle(Request request, Response response)
          Handles a call.
 void start()
          Start callback.
 void stop()
          Stop callback.
 
Methods inherited from class com.noelios.restlet.ChainHelper
addFilter, createLogFilter, getFirst, getParentContext, setFirst
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentHelper

public ComponentHelper(Component component)
Constructor.

Parameters:
component - The helper component.
Method Detail

createContext

public Context createContext(String loggerName)
Creates a new context.

Specified by:
createContext in class Helper
Parameters:
loggerName - The JDK's logger name to use for contextual logging.
Returns:
The new context.

getClientRouter

public ClientRouter getClientRouter()
Returns the internal client router.

Returns:
the internal client router.

getComponent

protected Component getComponent()
Returns the helped component.

Returns:
The helped component.

getServerRouter

public ServerRouter getServerRouter()
Returns the internal host router.

Returns:
the internal host router.

handle

public void handle(Request request,
                   Response response)
Handles a call.

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

start

public void start()
           throws Exception
Start callback.

Specified by:
start in class Helper
Throws:
Exception

createStatusFilter

protected StatusFilter createStatusFilter(Component component)
Creates a new status filter. Allows overriding.

Parameters:
component - The parent component.
Returns:
The new status filter.

stop

public void stop()
          throws Exception
Stop callback.

Specified by:
stop in class Helper
Throws:
Exception


Copyright © 2005-2007 Noelios Consulting.