org.apache.cocoon
Interface RequestListener


public interface RequestListener

This is called from with Cocoon#process(Environment), before any requests are passed onto the Processor and after the request has been processed. It allows all requests to be logged or monitored. NB Cocoon does not require an instance of this Component to function, but if there is one it will be used.


Field Summary
static String ROLE
           
 
Method Summary
 void onRequestEnd(org.apache.cocoon.environment.Environment environment)
          This method is called when a request has completed.
 void onRequestException(org.apache.cocoon.environment.Environment environment, Throwable throwable)
          This method is called when an exception has occurred processing the request.
 void onRequestStart(org.apache.cocoon.environment.Environment environment)
          In this method you can call, for example: Request req=ObjectModelHelper.getRequest(env.getObjectModel()); And then, you could use the following: req.getRequestURI() req.getQueryString() req.getSession().getId() req.getLocale().getLanguage().toString()
 

Field Detail

ROLE

public static final String ROLE
Method Detail

onRequestStart

public void onRequestStart(org.apache.cocoon.environment.Environment environment)

In this method you can call, for example: Request req=ObjectModelHelper.getRequest(env.getObjectModel()); And then, you could use the following:

Parameters:
environment - as supplied to Processor#process(Environment) from within Cocoon#process(Environment).

onRequestEnd

public void onRequestEnd(org.apache.cocoon.environment.Environment environment)

This method is called when a request has completed. This method is called before the response is committed.

Parameters:
environment - as supplied to Processor#process(Environment) from within Cocoon#process(Environment).

onRequestException

public void onRequestException(org.apache.cocoon.environment.Environment environment,
                               Throwable throwable)

This method is called when an exception has occurred processing the request.

Parameters:
environment - as supplied to Processor#process(Environment) from within Cocoon#process(Environment).
throwable - the error that occurred processing the request.


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.