org.apache.camel.processor
Class CatchProcessor

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.DelegateProcessor
          extended by org.apache.camel.processor.CatchProcessor
All Implemented Interfaces:
Navigate, Processor, Service

public class CatchProcessor
extends DelegateProcessor

A processor which catches exceptions.

Version:
$Revision: 766610 $

Field Summary
 
Fields inherited from class org.apache.camel.processor.DelegateProcessor
processor
 
Constructor Summary
CatchProcessor(List<Class> exceptions, Processor processor, Predicate onWhen, Predicate handled)
           
 
Method Summary
 boolean catches(Exchange exchange, Throwable exception)
          Whether this catch processor catch the given thrown exception
 List<Class> getExceptions()
           
 boolean handles(Exchange exchange)
          Whether this catch processor handles the exception it have caught
protected  boolean matchesWhen(Exchange exchange)
          Strategy method for matching the exception type with the current exchange.
 String toString()
           
 
Methods inherited from class org.apache.camel.processor.DelegateProcessor
doStart, doStop, getProcessor, hasNext, next, proceed, process, processNext, setProcessor
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CatchProcessor

public CatchProcessor(List<Class> exceptions,
                      Processor processor,
                      Predicate onWhen,
                      Predicate handled)
Method Detail

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 exchange
exception - 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:

Parameters:
exchange - the current Exchange
Returns:
true if matched, false otherwise.


Copyright © 2009 Apache Software Foundation. All Rights Reserved.