org.objectledge.pipeline
Class ErrorHandlingPipeline

java.lang.Object
  extended by org.objectledge.pipeline.ErrorHandlingPipeline
All Implemented Interfaces:
Valve

public class ErrorHandlingPipeline
extends Object
implements Valve

A Pipeline composed of three sequences of Valves that provides error handling along the lines of Java try/catch/finally rules.

The pipeline is constructed from three subpipelines (arrays of Valve objects). The subpiplines serve three functions:

  1. The try pipeline is used for normal execution of processing.
  2. The catch pipline is executed in case of an uncatched exception thrown in the try pipeline. It is basically used to handle problems which may occure in normal processing. An example problem to be handled, is the discovery of an unathorized access to the webapplication. In this case the catch pipeline should redirect the user to a view containing the description of the problem and a login form.
  3. The finally pipeline is executed always. It is used to execute cleanup actions after both successfull execution of the try pipeline and the errorneous execution of the try pipeline which triggered the catch pipeline.

Version:
$Id: ErrorHandlingPipeline.java,v 1.5 2005/07/22 17:19:44 pablo Exp $
Author:
rafal@caltha.pl

Field Summary
private  Valve[] catchValves
           
private  Valve[] finallyValves
           
private  org.jcontainer.dna.Logger logger
           
static String PIPELINE_EXCEPTION
          key to store the exception in the context.
private  Valve[] tryValves
           
 
Constructor Summary
ErrorHandlingPipeline(org.jcontainer.dna.Logger logger, Valve[] tryValves, Valve[] catchValves, Valve[] finallyValves)
          Constructs a new instance of the pipeline.
 
Method Summary
 void process(Context context)
          Runs the connected valves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PIPELINE_EXCEPTION

public static final String PIPELINE_EXCEPTION
key to store the exception in the context.

See Also:
Constant Field Values

logger

private org.jcontainer.dna.Logger logger

tryValves

private Valve[] tryValves

catchValves

private Valve[] catchValves

finallyValves

private Valve[] finallyValves
Constructor Detail

ErrorHandlingPipeline

public ErrorHandlingPipeline(org.jcontainer.dna.Logger logger,
                             Valve[] tryValves,
                             Valve[] catchValves,
                             Valve[] finallyValves)
Constructs a new instance of the pipeline.

Parameters:
logger - the logger.
tryValves - the valves to be used in the try stage.
catchValves - the valves to be used in the catch stage.
finallyValves - the valves to be used in the finaly stage.
Method Detail

process

public void process(Context context)
Runs the connected valves.

Specified by:
process in interface Valve
Parameters:
context - the context.


Copyright © 2003-2006 objectledge.org. All Rights Reserved.