org.apache.camel.processor
Class ErrorHandlerSupport

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.ErrorHandlerSupport
All Implemented Interfaces:
Processor, ErrorHandler, Service
Direct Known Subclasses:
DeadLetterChannel, LoggingErrorHandler

public abstract class ErrorHandlerSupport
extends ServiceSupport
implements ErrorHandler

Support class for ErrorHandler implementations.

Version:
$Revision: 1767 $

Constructor Summary
ErrorHandlerSupport()
           
 
Method Summary
 void addExceptionPolicy(ExceptionType exceptionType)
           
static ExceptionPolicyStrategy createDefaultExceptionPolicyStrategy()
          Creates the default exception policy strategy to use.
protected  boolean customProcessorForException(Exchange exchange, Throwable exception)
          Attempts to invoke the handler for this particular exception if one is available
protected  ExceptionType getExceptionPolicy(Exchange exchange, Throwable exception)
          Attempts to find the best suited ExceptionType to be used for handling the given thrown exception.
 void setExceptionPolicy(ExceptionPolicyStrategy exceptionPolicy)
          Sets the strategy to use for resolving the ExceptionType to use for handling thrown exceptions.
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doStart, doStop, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Processor
process
 

Constructor Detail

ErrorHandlerSupport

public ErrorHandlerSupport()
Method Detail

addExceptionPolicy

public void addExceptionPolicy(ExceptionType exceptionType)

customProcessorForException

protected boolean customProcessorForException(Exchange exchange,
                                              Throwable exception)
                                       throws Exception
Attempts to invoke the handler for this particular exception if one is available

Throws:
Exception

getExceptionPolicy

protected ExceptionType getExceptionPolicy(Exchange exchange,
                                           Throwable exception)
Attempts to find the best suited ExceptionType to be used for handling the given thrown exception.

Parameters:
exchange - the exchange
exception - the exception that was thrown
Returns:
the best exception type to handle this exception, null if none found.

setExceptionPolicy

public void setExceptionPolicy(ExceptionPolicyStrategy exceptionPolicy)
Sets the strategy to use for resolving the ExceptionType to use for handling thrown exceptions.


createDefaultExceptionPolicyStrategy

public static ExceptionPolicyStrategy createDefaultExceptionPolicyStrategy()
Creates the default exception policy strategy to use.



Copyright © 2009 IONA Open Source Community. All Rights Reserved.