org.apache.camel.processor.interceptor
Class TraceInterceptor

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

public class TraceInterceptor
extends DelegateProcessor
implements ExchangeFormatter

An interceptor for debugging and tracing routes

Version:
$Revision: 61064 $

Field Summary
 
Fields inherited from class org.apache.camel.processor.DelegateProcessor
processor
 
Constructor Summary
TraceInterceptor(ProcessorType node, Processor target, TraceFormatter formatter)
          Deprecated. will be removed in Camel 2.0
TraceInterceptor(ProcessorType node, Processor target, TraceFormatter formatter, Tracer tracer)
           
TraceInterceptor(ProcessorType node, Processor target, Tracer tracer)
           
 
Method Summary
 Object format(Exchange exchange)
          Generates a string representation of the exchange
 TraceFormatter getFormatter()
           
 Logger getLogger()
           
 ProcessorType getNode()
           
protected  void logException(Exchange exchange, Throwable throwable)
           
protected  void logExchange(Exchange exchange)
           
 void process(Exchange exchange)
          Processes the message exchange
protected  boolean shouldLogException(Exchange exchange)
          Returns true if the given exchange should be logged when an exception was thrown
protected  boolean shouldLogExchange(Exchange exchange)
          Returns true if the given exchange should be logged in the trace list
protected  boolean shouldLogNode(ProcessorType node)
          Returns true if the given node should be logged in the trace list
 boolean shouldTraceOutExchanges()
          Returns whether exchanges coming out of processors should be traced
 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

TraceInterceptor

public TraceInterceptor(ProcessorType node,
                        Processor target,
                        TraceFormatter formatter,
                        Tracer tracer)

TraceInterceptor

public TraceInterceptor(ProcessorType node,
                        Processor target,
                        TraceFormatter formatter)
Deprecated. will be removed in Camel 2.0


TraceInterceptor

public TraceInterceptor(ProcessorType node,
                        Processor target,
                        Tracer tracer)
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.

format

public Object format(Exchange exchange)
Description copied from interface: ExchangeFormatter
Generates a string representation of the exchange

Specified by:
format in interface ExchangeFormatter

getNode

public ProcessorType getNode()

getLogger

public Logger getLogger()

getFormatter

public TraceFormatter getFormatter()

logExchange

protected void logExchange(Exchange exchange)

logException

protected void logException(Exchange exchange,
                            Throwable throwable)

shouldLogExchange

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


shouldLogException

protected boolean shouldLogException(Exchange exchange)
Returns true if the given exchange should be logged when an exception was thrown


shouldTraceOutExchanges

public boolean shouldTraceOutExchanges()
Returns whether exchanges coming out of processors should be traced


shouldLogNode

protected boolean shouldLogNode(ProcessorType node)
Returns true if the given node should be logged in the trace list



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