com.noelios.restlet.application
Class ApplicationStatusFilter

java.lang.Object
  extended by org.restlet.Uniform
      extended by org.restlet.Restlet
          extended by org.restlet.Filter
              extended by com.noelios.restlet.StatusFilter
                  extended by com.noelios.restlet.application.ApplicationStatusFilter

public class ApplicationStatusFilter
extends StatusFilter

Status filter that tries to obtain ouput representation from an application.

Author:
Jerome Louvel (contact@noelios.com)

Constructor Summary
ApplicationStatusFilter(Application application)
          Constructor.
 
Method Summary
 Application getApplication()
          Returns the application.
 Representation getRepresentation(Status status, Request request, Response response)
          Returns a representation for the given status.
In order to customize the default representation, this method can be overriden.
 Status getStatus(Throwable throwable, Request request, Response response)
          Returns a status for a given exception or error.
 
Methods inherited from class com.noelios.restlet.StatusFilter
afterHandle, doHandle
 
Methods inherited from class org.restlet.Filter
beforeHandle, getNext, handle, hasNext, setNext, setNext
 
Methods inherited from class org.restlet.Restlet
getContext, getLogger, init, isStarted, isStopped, setContext, start, stop
 
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

ApplicationStatusFilter

public ApplicationStatusFilter(Application application)
Constructor.

Parameters:
application - The application.
Method Detail

getApplication

public Application getApplication()
Returns the application.

Returns:
The application.

getRepresentation

public Representation getRepresentation(Status status,
                                        Request request,
                                        Response response)
Description copied from class: StatusFilter
Returns a representation for the given status.
In order to customize the default representation, this method can be overriden.

Overrides:
getRepresentation in class StatusFilter
Parameters:
status - The status to represent.
request - The request handled.
response - The response updated.
Returns:
The representation of the given status.

getStatus

public Status getStatus(Throwable throwable,
                        Request request,
                        Response response)
Description copied from class: StatusFilter
Returns a status for a given exception or error. By default it returns an Status.SERVER_ERROR_INTERNAL status and logs a severe message.
In order to customize the default behavior, this method can be overriden.

Overrides:
getStatus in class StatusFilter
Parameters:
throwable - The exception or error caught.
request - The request handled.
response - The response updated.
Returns:
The representation of the given status.


Copyright © 2005-2007 Noelios Technologies.