|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.processor.exceptionpolicy.DefaultExceptionPolicyStrategy
public class DefaultExceptionPolicyStrategy
The default strategy used in Camel to resolve the ExceptionType
that should
handle the thrown exception.
filter(org.apache.camel.model.ExceptionType, Class, Throwable)
method. ExceptionType
has a when defined with an expression the type is also matches against
the current exchange using the matchesWhen(org.apache.camel.model.ExceptionType, org.apache.camel.Exchange)
method. This can be used to for more fine grained matching, so you can e.g. define multiple sets of
exception types with the same exception class(es) but have a predicate attached to select which to select at runtime.
Constructor Summary | |
---|---|
DefaultExceptionPolicyStrategy()
|
Method Summary | |
---|---|
protected Iterator<Throwable> |
createExceptionIterator(Throwable exception)
Strategy method creating the iterator to walk the exception in the order Camel should use for find the ExceptionType should be used. |
protected boolean |
filter(ExceptionType type,
Class exceptionClass,
Throwable exception)
Strategy to filter the given type exception class with the thrown exception |
ExceptionType |
getExceptionPolicy(Map<ExceptionPolicyKey,ExceptionType> exceptionPolicices,
Exchange exchange,
Throwable exception)
Resolves the ExceptionType that should handle the thrown exception. |
protected boolean |
matchesWhen(ExceptionType type,
Exchange exchange)
Strategy method for matching the exception type with the current exchange. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultExceptionPolicyStrategy()
Method Detail |
---|
public ExceptionType getExceptionPolicy(Map<ExceptionPolicyKey,ExceptionType> exceptionPolicices, Exchange exchange, Throwable exception)
ExceptionPolicyStrategy
ExceptionType
that should handle the thrown exception.
getExceptionPolicy
in interface ExceptionPolicyStrategy
exceptionPolicices
- the configured exception policies to resolve fromexchange
- the exchangeexception
- the exception that was thrown
protected boolean filter(ExceptionType type, Class exceptionClass, Throwable exception)
type
- the exception typeexceptionClass
- the current exception class for testingexception
- the thrown exception
protected boolean matchesWhen(ExceptionType type, Exchange exchange)
type
- the exception typeexchange
- the current Exchange
protected Iterator<Throwable> createExceptionIterator(Throwable exception)
ExceptionType
should be used.
The default iterator will walk from the bottom upwards
(the last caused by going upwards to the exception)
exception
- the exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |