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

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

public class ErrorHandlerHelper
extends AbstractLogEnabled
implements Serviceable

Helps to call error handlers from PipelineNode and PipelinesNode.

Version:
$Id: ErrorHandlerHelper.java 280345 2005-09-12 14:25:56Z cziegeler $
Author:
Jürgen Seitz, Björn Lütkemeier

Field Summary
protected  Logger handledErrorsLogger
          Logger for handled errors
 
Constructor Summary
ErrorHandlerHelper()
           
 
Method Summary
 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()
           
 Processor.InternalPipelineDescription prepareErrorHandler(Exception ex, Environment env, InvokeContext context)
          Prepare error handler for the internal pipeline error handling.
 void service(ServiceManager manager)
          The component manager is used to create notifying builders.
 
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

service

public void service(ServiceManager manager)
The component manager is used to create notifying builders.

Specified by:
service in interface Serviceable

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 Processor.InternalPipelineDescription 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-2005 The Apache Software Foundation. All Rights Reserved.