org.apache.camel.processor
Class ErrorHandlerSupport

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.support.ChildServiceSupport
          extended by org.apache.camel.processor.ErrorHandlerSupport
All Implemented Interfaces:
Processor, ErrorHandler, Service, ShutdownableService, StatefulService, SuspendableService
Direct Known Subclasses:
RedeliveryErrorHandler

public abstract class ErrorHandlerSupport
extends ChildServiceSupport
implements ErrorHandler

Support class for ErrorHandler implementations.

Version:

Field Summary
protected  Map<ExceptionPolicyKey,OnExceptionDefinition> exceptionPolicies
           
protected  ExceptionPolicyStrategy exceptionPolicy
           
protected  org.slf4j.Logger log
           
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
ErrorHandlerSupport()
           
 
Method Summary
 void addExceptionPolicy(RouteContext routeContext, OnExceptionDefinition exceptionType)
           
static ExceptionPolicyStrategy createDefaultExceptionPolicyStrategy()
          Creates the default exception policy strategy to use.
protected  OnExceptionDefinition getExceptionPolicy(Exchange exchange, Throwable exception)
          Attempts to find the best suited OnExceptionDefinition to be used for handling the given thrown exception.
abstract  Processor getOutput()
          Gets the output
 boolean isDeadLetterChannel()
          Whether this error handler handles exhausted errors by moving the exchange to a dead letter channel.
 void setExceptionPolicy(ExceptionPolicyStrategy exceptionPolicy)
          Sets the strategy to use for resolving the OnExceptionDefinition to use for handling thrown exceptions.
abstract  boolean supportTransacted()
          Whether this error handler supports transacted exchanges or not.
 
Methods inherited from class org.apache.camel.support.ChildServiceSupport
addChildService, removeChildService, shutdown, start, start, stop
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doStart, doStop, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, suspend
 
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
 

Field Detail

log

protected final org.slf4j.Logger log

exceptionPolicies

protected final Map<ExceptionPolicyKey,OnExceptionDefinition> exceptionPolicies

exceptionPolicy

protected ExceptionPolicyStrategy exceptionPolicy
Constructor Detail

ErrorHandlerSupport

public ErrorHandlerSupport()
Method Detail

addExceptionPolicy

public void addExceptionPolicy(RouteContext routeContext,
                               OnExceptionDefinition exceptionType)

getExceptionPolicy

protected OnExceptionDefinition getExceptionPolicy(Exchange exchange,
                                                   Throwable exception)
Attempts to find the best suited OnExceptionDefinition 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 OnExceptionDefinition to use for handling thrown exceptions.


createDefaultExceptionPolicyStrategy

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


supportTransacted

public abstract boolean supportTransacted()
Whether this error handler supports transacted exchanges or not.


isDeadLetterChannel

public boolean isDeadLetterChannel()
Whether this error handler handles exhausted errors by moving the exchange to a dead letter channel.


getOutput

public abstract Processor getOutput()
Gets the output



Apache Camel