org.apache.camel.fabric
Class FabricTracer

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.fabric.FabricTracer
All Implemented Interfaces:
Service, ShutdownableService, InterceptStrategy

@ManagedResource(value="FabricTracer")
public class FabricTracer
extends ServiceSupport
implements InterceptStrategy


Constructor Summary
FabricTracer(CamelContext camelContext)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 List<FabricTracerEventMessage> dumpAllTracedMessages()
           
 String dumpAllTracedMessagesAsXml()
           
 List<FabricTracerEventMessage> dumpTracedMessages(String nodeId)
           
 String dumpTracedMessagesAsXml(String nodeId)
           
 int getQueueSize()
           
 long getTraceCounter()
           
 boolean isEnabled()
           
 void resetTraceCounter()
           
 void setEnabled(boolean enabled)
           
 void setQueueSize(int queueSize)
           
 boolean shouldTrace(ProcessorDefinition<?> definition)
          Whether or not to trace the given processor definition.
 Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition, Processor target, Processor nextTarget)
          This method is invoked by ProcessorDefinition.wrapProcessor(RouteContext, Processor) to give the implementor an opportunity to wrap the target processor in a route.
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FabricTracer

public FabricTracer(CamelContext camelContext)
Method Detail

wrapProcessorInInterceptors

public Processor wrapProcessorInInterceptors(CamelContext context,
                                             ProcessorDefinition<?> definition,
                                             Processor target,
                                             Processor nextTarget)
                                      throws Exception
Description copied from interface: InterceptStrategy
This method is invoked by ProcessorDefinition.wrapProcessor(RouteContext, Processor) to give the implementor an opportunity to wrap the target processor in a route.

Important: See the class javadoc for advice on letting interceptor be compatible with the asynchronous routing engine.

Specified by:
wrapProcessorInInterceptors in interface InterceptStrategy
Parameters:
context - Camel context
definition - the model this interceptor represents
target - the processor to be wrapped
nextTarget - the next processor to be routed to
Returns:
processor wrapped with an interceptor or not wrapped.
Throws:
Exception - can be thrown

shouldTrace

public boolean shouldTrace(ProcessorDefinition<?> definition)
Whether or not to trace the given processor definition.

Parameters:
definition - the processor definition
Returns:
true to trace, false to skip tracing

isEnabled

@ManagedAttribute(description="Is tracing enabled")
public boolean isEnabled()

setEnabled

@ManagedAttribute(description="Is tracing enabled")
public void setEnabled(boolean enabled)

getQueueSize

@ManagedAttribute(description="Number of traced messages to keep in FIFO queue")
public int getQueueSize()

setQueueSize

@ManagedAttribute(description="Number of traced messages to keep in FIFO queue")
public void setQueueSize(int queueSize)

getTraceCounter

@ManagedAttribute(description="Number of total traced messages")
public long getTraceCounter()

resetTraceCounter

@ManagedOperation(description="Resets the trace counter")
public void resetTraceCounter()

dumpTracedMessages

@ManagedOperation(description="Dumps the traced messages for the given node")
public List<FabricTracerEventMessage> dumpTracedMessages(String nodeId)

dumpTracedMessagesAsXml

@ManagedOperation(description="Dumps the traced messages for the given node in xml format")
public String dumpTracedMessagesAsXml(String nodeId)

dumpAllTracedMessages

@ManagedOperation(description="Dumps the traced messages for all nodes")
public List<FabricTracerEventMessage> dumpAllTracedMessages()

dumpAllTracedMessagesAsXml

@ManagedOperation(description="Dumps the traced messages for all nodes in xml format")
public String dumpAllTracedMessagesAsXml()

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception


Apache CAMEL