org.apache.camel.processor.interceptor
Class DebugInterceptor

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

public class DebugInterceptor
extends DelegateProcessor

An interceptor for debugging and tracing routes

Version:
$Revision: 45367 $

Field Summary
 
Fields inherited from class org.apache.camel.processor.DelegateProcessor
processor
 
Constructor Summary
DebugInterceptor(ProcessorType node, Processor target, List<Exchange> exchanges, List<ExceptionEvent> exceptions)
           
 
Method Summary
protected  void addTraceExchange(Exchange exchange)
          Strategy method to store the exchange in a trace log if it is enabled
protected  void checkForBreakpoint(Exchange exchange)
          Stategy method to wait for a breakpoint if one is set
protected  Exchange copyExchange(Exchange previousExchange)
           
 Breakpoint getBreakpoint()
           
 List<ExceptionEvent> getExceptions()
           
 List<Exchange> getExchanges()
           
 ProcessorType getNode()
           
 Predicate getTraceFilter()
           
 boolean isEnabled()
           
 boolean isTraceExceptions()
           
protected  void onException(Exchange exchange, Throwable e)
          Fired when an exception is thrown when processing the underlying processor
 void process(Exchange exchange)
          Processes the message exchange
 void setEnabled(boolean flag)
           
 void setTraceExceptions(boolean traceExceptions)
           
 void setTraceFilter(Predicate traceFilter)
           
protected  boolean shouldTraceExchange(Exchange exchange)
          Returns true if the given exchange should be logged in the trace list
 String toString()
           
 
Methods inherited from class org.apache.camel.processor.DelegateProcessor
doStart, doStop, getProcessor, proceed, processNext, setProcessor
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DebugInterceptor

public DebugInterceptor(ProcessorType node,
                        Processor target,
                        List<Exchange> exchanges,
                        List<ExceptionEvent> exceptions)
Method Detail

toString

public String toString()
Overrides:
toString in class DelegateProcessor

process

public void process(Exchange exchange)
             throws Exception
Description copied from interface: Processor
Processes the message exchange

Specified by:
process in interface Processor
Overrides:
process in class DelegateProcessor
Throws:
Exception - if an internal processing error has occurred.

getNode

public ProcessorType getNode()

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean flag)

getExchanges

public List<Exchange> getExchanges()

getExceptions

public List<ExceptionEvent> getExceptions()

getBreakpoint

public Breakpoint getBreakpoint()

getTraceFilter

public Predicate getTraceFilter()

setTraceFilter

public void setTraceFilter(Predicate traceFilter)

isTraceExceptions

public boolean isTraceExceptions()

setTraceExceptions

public void setTraceExceptions(boolean traceExceptions)

checkForBreakpoint

protected void checkForBreakpoint(Exchange exchange)
Stategy method to wait for a breakpoint if one is set


onException

protected void onException(Exchange exchange,
                           Throwable e)
Fired when an exception is thrown when processing the underlying processor


addTraceExchange

protected void addTraceExchange(Exchange exchange)
Strategy method to store the exchange in a trace log if it is enabled


copyExchange

protected Exchange copyExchange(Exchange previousExchange)

shouldTraceExchange

protected boolean shouldTraceExchange(Exchange exchange)
Returns true if the given exchange should be logged in the trace list



Copyright © 2008 IONA Open Source Community. All Rights Reserved.