org.apache.cocoon
Interface RequestListener

All Superinterfaces:
Component

public interface RequestListener
extends Component

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(Environment environment)
          This method is called when a request has completed.
 void onRequestException(Environment environment, Throwable throwable)
          This method is called when an exception has occurred processing the request.
 void onRequestStart(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

static final String ROLE
Method Detail

onRequestStart

void onRequestStart(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

void onRequestEnd(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

void onRequestException(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-2010 The Apache Software Foundation. All Rights Reserved.