com.noelios.restlet.application
Class ApplicationHelper

java.lang.Object
  extended by org.restlet.util.Helper
      extended by com.noelios.restlet.application.ApplicationHelper

public class ApplicationHelper
extends Helper

Application implementation.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
ApplicationHelper(Application application, Context parentContext)
          Constructor.
 
Method Summary
 Context createContext(String loggerName)
          Creates a new context.
protected  Filter createDecoderFilter(Application application)
          Creates a new decoder filter.
protected  Filter createLogFilter(Context context, LogService logService)
          Creates a new log filter.
protected  Filter createStatusFilter(Application application)
          Creates a new status filter.
protected  Filter createTunnelFilter(Application application)
          Creates a new tunnel filter.
 Application getApplication()
          Returns the application to help.
 Context getParentContext()
          Returns the parent context, typically the component's context.
 void handle(Request request, Response response)
          Allows filtering before processing by the next Restlet.
 void start()
          Start hook.
 void stop()
          Stop callback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationHelper

public ApplicationHelper(Application application,
                         Context parentContext)
Constructor.

Parameters:
application - The application to help.
parentContext - The parent context, typically the component's context.
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.

handle

public void handle(Request request,
                   Response response)
Allows filtering before processing by the next Restlet. Does nothing by default.

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

getApplication

public Application getApplication()
Returns the application to help.

Returns:
The application to help.

getParentContext

public Context getParentContext()
Returns the parent context, typically the component's context.

Returns:
The parent context.

start

public void start()
           throws Exception
Start hook.

Specified by:
start in class Helper
Throws:
Exception

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.

createDecoderFilter

protected Filter createDecoderFilter(Application application)
Creates a new decoder filter. Allows overriding.

Parameters:
application - The parent application.
Returns:
The new decoder filter.

createStatusFilter

protected Filter createStatusFilter(Application application)
Creates a new status filter. Allows overriding.

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

createTunnelFilter

protected Filter createTunnelFilter(Application application)
Creates a new tunnel filter. Allows overriding.

Parameters:
application - The parent application.
Returns:
The new tunnel filter.

stop

public void stop()
          throws Exception
Stop callback.

Specified by:
stop in class Helper
Throws:
Exception


Copyright © 2005-2007 Noelios Technologies.