public abstract class ErrorHandlerSupport extends ChildServiceSupport implements ErrorHandler
ErrorHandler
implementations.Modifier and Type | Field and Description |
---|---|
protected Map<ExceptionPolicyKey,OnExceptionDefinition> |
exceptionPolicies |
protected ExceptionPolicyStrategy |
exceptionPolicy |
protected org.slf4j.Logger |
log |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
ErrorHandlerSupport() |
Modifier and Type | Method and Description |
---|---|
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.
|
addChildService, removeChildService, shutdown, start, start, stop
doResume, doShutdown, doStart, doStop, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, suspend
protected final org.slf4j.Logger log
protected final Map<ExceptionPolicyKey,OnExceptionDefinition> exceptionPolicies
protected ExceptionPolicyStrategy exceptionPolicy
public void addExceptionPolicy(RouteContext routeContext, OnExceptionDefinition exceptionType)
protected OnExceptionDefinition getExceptionPolicy(Exchange exchange, Throwable exception)
OnExceptionDefinition
to be used for handling the given thrown exception.exchange
- the exchangeexception
- the exception that was thrownpublic void setExceptionPolicy(ExceptionPolicyStrategy exceptionPolicy)
OnExceptionDefinition
to use
for handling thrown exceptions.public static ExceptionPolicyStrategy createDefaultExceptionPolicyStrategy()
public abstract boolean supportTransacted()
public boolean isDeadLetterChannel()
public abstract Processor getOutput()
Apache Camel