org.apache.camel.processor
Class CatchProcessor
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.processor.DelegateProcessor
org.apache.camel.processor.CatchProcessor
- All Implemented Interfaces:
- Navigate, Processor, Service
public class CatchProcessor
- extends DelegateProcessor
A processor which catches exceptions.
- Version:
- $Revision: 766610 $
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop |
CatchProcessor
public CatchProcessor(List<Class> exceptions,
Processor processor,
Predicate onWhen,
Predicate handled)
toString
public String toString()
- Overrides:
toString
in class DelegateProcessor
catches
public boolean catches(Exchange exchange,
Throwable exception)
- Whether this catch processor catch the given thrown exception
- Parameters:
exchange
- the current exchangeexception
- the thrown exception
- Returns:
- true if this processor catches it, false otherwise.
handles
public boolean handles(Exchange exchange)
- Whether this catch processor handles the exception it have caught
- Parameters:
exchange
- the current exchange
- Returns:
- true if this processor handles it, false otherwise.
getExceptions
public List<Class> getExceptions()
matchesWhen
protected boolean matchesWhen(Exchange exchange)
- Strategy method for matching the exception type with the current exchange.
This default implementation will match as:
- Always true if no when predicate on the exception type
- Otherwise the when predicate is matches against the current exchange
- Parameters:
exchange
- the current Exchange
- Returns:
- true if matched, false otherwise.
Copyright © 2009 Apache Software Foundation. All Rights Reserved.