org.apache.cocoon.components.treeprocessor.sitemap
Class ErrorHandlerHelper

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper
All Implemented Interfaces:
Composable, LogEnabled

public class ErrorHandlerHelper
extends AbstractLogEnabled
implements Composable

Helps to call error handlers from PipelineNode and PipelinesNode.

Version:
$Id: ErrorHandlerHelper.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Jürgen Seitz, Björn Lütkemeier

Field Summary
protected  Logger handledErrorsLogger
          Logger for handled errors
 
Constructor Summary
ErrorHandlerHelper()
           
 
Method Summary
 void compose(ComponentManager manager)
          The component manager is used to create notifying builders.
 void enableLogging(Logger logger)
           
 boolean invokeErrorHandler(Exception ex, Environment env, InvokeContext context)
          Handle error.
 boolean invokeErrorHandler(ProcessingNode node, Exception ex, Environment env, InvokeContext context)
          Handle error using specified error handler processing node.
 boolean isEmpty()
           
 boolean isExternal()
           
 boolean isInternal()
           
 ProcessingPipeline prepareErrorHandler(Exception ex, Environment env, InvokeContext context)
          Prepare error handler for the internal pipeline error handling.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handledErrorsLogger

protected Logger handledErrorsLogger
Logger for handled errors

Constructor Detail

ErrorHandlerHelper

public ErrorHandlerHelper()
Method Detail

enableLogging

public void enableLogging(Logger logger)
Specified by:
enableLogging in interface LogEnabled
Overrides:
enableLogging in class AbstractLogEnabled

compose

public void compose(ComponentManager manager)
The component manager is used to create notifying builders.

Specified by:
compose in interface Composable

isEmpty

public boolean isEmpty()
Returns:
true if has no error handler nodes set

isInternal

public boolean isInternal()

isExternal

public boolean isExternal()

invokeErrorHandler

public boolean invokeErrorHandler(Exception ex,
                                  Environment env,
                                  InvokeContext context)
                           throws Exception
Handle error.

Throws:
Exception

prepareErrorHandler

public ProcessingPipeline prepareErrorHandler(Exception ex,
                                              Environment env,
                                              InvokeContext context)
                                       throws Exception
Prepare error handler for the internal pipeline error handling.

If building pipeline only, error handling pipeline will be built and returned. If building and executing pipeline, error handling pipeline will be built and executed.

Throws:
Exception

invokeErrorHandler

public boolean invokeErrorHandler(ProcessingNode node,
                                  Exception ex,
                                  Environment env,
                                  InvokeContext context)
                           throws Exception
Handle error using specified error handler processing node.

Throws:
Exception


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.