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: 45325 $

Field Summary
 
Fields inherited from class org.apache.camel.processor.DelegateProcessor
processor
 
Constructor Summary
TraceInterceptor(ProcessorType node, Processor target, TraceFormatter formatter)
           
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()
           
 LoggingLevel getLevel()
           
 org.apache.commons.logging.Log getLog()
           
 Logger getLogger()
           
 ProcessorType getNode()
           
 Predicate getTraceFilter()
           
 boolean isTraceExceptions()
           
protected  void logException(Exchange exchange, Throwable throwable)
           
protected  void logExchange(Exchange exchange)
           
 void process(Exchange exchange)
          Processes the message exchange
 void setFormatter(TraceFormatter formatter)
           
 void setLevel(LoggingLevel level)
           
 void setLog(org.apache.commons.logging.Log log)
           
 void setTraceExceptions(boolean traceExceptions)
           
 void setTraceFilter(Predicate traceFilter)
           
protected  boolean shouldLogExchange(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, 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)

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()

getTraceFilter

public Predicate getTraceFilter()

setTraceFilter

public void setTraceFilter(Predicate traceFilter)

isTraceExceptions

public boolean isTraceExceptions()

setTraceExceptions

public void setTraceExceptions(boolean traceExceptions)

getLogger

public Logger getLogger()

getFormatter

public TraceFormatter getFormatter()

setFormatter

public void setFormatter(TraceFormatter formatter)

getLevel

public LoggingLevel getLevel()

getLog

public org.apache.commons.logging.Log getLog()

setLog

public void setLog(org.apache.commons.logging.Log log)

setLevel

public void setLevel(LoggingLevel level)

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



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