Class ErrorHandlerSupport
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.ChildServiceSupport
org.apache.camel.processor.errorhandler.ErrorHandlerSupport
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Processor,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.ErrorHandler,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
- Direct Known Subclasses:
NoErrorHandler,RedeliveryErrorHandler
public abstract class ErrorHandlerSupport
extends org.apache.camel.support.ChildServiceSupport
implements org.apache.camel.spi.ErrorHandler
Support class for
ErrorHandler implementations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.camel.support.processor.DefaultExchangeFormatterprotected Map<ExceptionPolicyKey, ExceptionPolicy> protected ExceptionPolicyStrategyFields inherited from class org.apache.camel.support.ChildServiceSupport
childServicesFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorHandler(org.apache.camel.Processor errorHandler) voidaddExceptionPolicy(ExceptionPolicyKey key, ExceptionPolicy policy) abstract org.apache.camel.spi.ErrorHandlerclone(org.apache.camel.Processor output) Clones the current error handler and changes the outputprotected ExceptionPolicygetExceptionPolicy(org.apache.camel.Exchange exchange, Throwable exception) Attempts to find the best suitedExceptionPolicyto be used for handling the given thrown exception.abstract org.apache.camel.ProcessorGets the outputbooleanWhether this error handler handles exhausted errors by moving the exchange to a dead letter channel.abstract booleanWhether this error handler supports transacted exchanges or not.Methods inherited from class org.apache.camel.support.ChildServiceSupport
addChildService, removeChildService, shutdown, start, stopMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Processor
processMethods inherited from interface org.apache.camel.Service
build, close, initMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
DEFAULT_EXCHANGE_FORMATTER
protected static final org.apache.camel.support.processor.DefaultExchangeFormatter DEFAULT_EXCHANGE_FORMATTER -
exceptionPolicy
-
exceptionPolicies
-
-
Constructor Details
-
ErrorHandlerSupport
public ErrorHandlerSupport()
-
-
Method Details
-
addErrorHandler
public void addErrorHandler(org.apache.camel.Processor errorHandler) -
addExceptionPolicy
-
getExceptionPolicy
protected ExceptionPolicy getExceptionPolicy(org.apache.camel.Exchange exchange, Throwable exception) Attempts to find the best suitedExceptionPolicyto be used for handling the given thrown exception.- Parameters:
exchange- the exchangeexception- the exception that was thrown- Returns:
- the best exception type to handle this exception, null if none found.
-
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 org.apache.camel.Processor getOutput()Gets the output -
clone
public abstract org.apache.camel.spi.ErrorHandler clone(org.apache.camel.Processor output) Clones the current error handler and changes the output
-