org.apache.camel.processor.interceptor
Class Tracer

java.lang.Object
  extended by org.apache.camel.processor.interceptor.Tracer
All Implemented Interfaces:
InterceptStrategy

public class Tracer
extends Object
implements InterceptStrategy

An interceptor strategy for tracing routes

Version:
$Revision: 62931 $

Constructor Summary
Tracer()
           
 
Method Summary
 TraceFormatter getFormatter()
           
 LoggingLevel getLogLevel()
           
 String getLogName()
           
 Predicate getTraceFilter()
           
static Tracer getTracer(CamelContext context)
          A helper method to return the Tracer instance for a given CamelContext if one is enabled
 boolean isEnabled()
           
 boolean isTraceExceptions()
           
 boolean isTraceInterceptors()
           
 boolean isTraceOutExchanges()
           
 void setEnabled(boolean flag)
           
 void setFormatter(TraceFormatter formatter)
           
 void setLogLevel(LoggingLevel logLevel)
          Sets the logging level to output tracing.
 void setLogName(String logName)
          Sets the logging name to use.
 void setTraceExceptions(boolean traceExceptions)
          Sets whether thrown exceptions should be traced
 void setTraceFilter(Predicate traceFilter)
          Sets a predicate to be used as filter when tracing
 void setTraceInterceptors(boolean traceInterceptors)
          Sets whether interceptors should be traced or not
 void setTraceOutExchanges(boolean traceOutExchanges)
          Sets whether exchanges coming out of processors should be traced
 Processor wrapProcessorInInterceptors(ProcessorType processorType, Processor target)
          This method is invoked by ProcessorType.wrapProcessor(RouteContext, Processor) to give the implementor an opportunity to wrap the target processor in a route.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tracer

public Tracer()
Method Detail

getTracer

public static Tracer getTracer(CamelContext context)
A helper method to return the Tracer instance for a given CamelContext if one is enabled

Parameters:
context - the camel context the tracer is connected to
Returns:
the tracer or null if none can be found

wrapProcessorInInterceptors

public Processor wrapProcessorInInterceptors(ProcessorType processorType,
                                             Processor target)
                                      throws Exception
Description copied from interface: InterceptStrategy
This method is invoked by ProcessorType.wrapProcessor(RouteContext, Processor) to give the implementor an opportunity to wrap the target processor in a route.

Specified by:
wrapProcessorInInterceptors in interface InterceptStrategy
Parameters:
processorType - the object that invokes this method
target - the processor to be wrapped
Returns:
processor wrapped with an interceptor or not wrapped
Throws:
Exception - can be thrown

getFormatter

public TraceFormatter getFormatter()

setFormatter

public void setFormatter(TraceFormatter formatter)

setEnabled

public void setEnabled(boolean flag)

isEnabled

public boolean isEnabled()

isTraceInterceptors

public boolean isTraceInterceptors()

setTraceInterceptors

public void setTraceInterceptors(boolean traceInterceptors)
Sets whether interceptors should be traced or not


getTraceFilter

public Predicate getTraceFilter()

setTraceFilter

public void setTraceFilter(Predicate traceFilter)
Sets a predicate to be used as filter when tracing


getLogLevel

public LoggingLevel getLogLevel()

setLogLevel

public void setLogLevel(LoggingLevel logLevel)
Sets the logging level to output tracing. Will use INFO level by default.


isTraceExceptions

public boolean isTraceExceptions()

setTraceExceptions

public void setTraceExceptions(boolean traceExceptions)
Sets whether thrown exceptions should be traced


getLogName

public String getLogName()

setLogName

public void setLogName(String logName)
Sets the logging name to use. Will default use org.apache.camel.processor.interceptor.TraceInterceptor.


setTraceOutExchanges

public void setTraceOutExchanges(boolean traceOutExchanges)
Sets whether exchanges coming out of processors should be traced


isTraceOutExchanges

public boolean isTraceOutExchanges()


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