|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.support.ServiceSupport org.apache.camel.processor.interceptor.BacklogTracer
public class BacklogTracer
A tracer used for message tracing, storing a copy of the message details in a backlog.
This tracer allows to store message tracers per node in the Camel routes. The tracers is stored in a backlog queue (FIFO based) which allows to pull the traced messages on demand.
Field Summary | |
---|---|
static int |
MAX_BACKLOG_SIZE
|
Fields inherited from class org.apache.camel.support.ServiceSupport |
---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
Constructor Summary | |
---|---|
BacklogTracer(CamelContext camelContext)
|
Method Summary | |
---|---|
void |
addDefinition(ProcessorDefinition<?> definition)
|
void |
clear()
|
static BacklogTracer |
createTracer(CamelContext context)
Creates a new backlog tracer. |
protected void |
doShutdown()
Implementations override this method to perform customized shutdown. |
protected void |
doStart()
Implementations override this method to support customized start/stop. |
protected void |
doStop()
Implementations override this method to support customized start/stop. |
List<BacklogTracerEventMessage> |
dumpAllTracedMessages()
|
String |
dumpAllTracedMessagesAsXml()
|
List<BacklogTracerEventMessage> |
dumpTracedMessages(String nodeId)
|
String |
dumpTracedMessagesAsXml(String nodeId)
|
int |
getBacklogSize()
|
static BacklogTracer |
getBacklogTracer(CamelContext context)
A helper method to return the BacklogTracer instance if one is enabled |
int |
getBodyMaxChars()
|
Queue<DefaultBacklogTracerEventMessage> |
getQueue()
|
long |
getTraceCounter()
|
String |
getTraceFilter()
|
String |
getTracePattern()
|
long |
incrementTraceCounter()
|
boolean |
isBodyIncludeFiles()
|
boolean |
isBodyIncludeStreams()
|
boolean |
isEnabled()
|
boolean |
isRemoveOnDump()
|
void |
resetTraceCounter()
|
void |
setBacklogSize(int backlogSize)
|
void |
setBodyIncludeFiles(boolean bodyIncludeFiles)
|
void |
setBodyIncludeStreams(boolean bodyIncludeStreams)
|
void |
setBodyMaxChars(int bodyMaxChars)
|
void |
setEnabled(boolean enabled)
|
void |
setRemoveOnDump(boolean removeOnDump)
|
void |
setTraceFilter(String filter)
|
void |
setTracePattern(String tracePattern)
|
boolean |
shouldTrace(ProcessorDefinition<?> definition,
Exchange exchange)
Whether or not to trace the given processor definition. |
Processor |
wrapProcessorInInterceptors(CamelContext context,
ProcessorDefinition<?> definition,
Processor target,
Processor nextTarget)
Deprecated. |
Methods inherited from class org.apache.camel.support.ServiceSupport |
---|
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_BACKLOG_SIZE
Constructor Detail |
---|
public BacklogTracer(CamelContext camelContext)
Method Detail |
---|
public void addDefinition(ProcessorDefinition<?> definition)
public Queue<DefaultBacklogTracerEventMessage> getQueue()
@Deprecated public Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition, Processor target, Processor nextTarget) throws Exception
InterceptStrategy
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.
wrapProcessorInInterceptors
in interface InterceptStrategy
context
- Camel contextdefinition
- the model this interceptor representstarget
- the processor to be wrappednextTarget
- the next processor to be routed to
Exception
- can be thrownpublic static BacklogTracer createTracer(CamelContext context)
context
- Camel context
public static BacklogTracer getBacklogTracer(CamelContext context)
public boolean shouldTrace(ProcessorDefinition<?> definition, Exchange exchange)
definition
- the processor definitionexchange
- the exchange
public boolean isEnabled()
public void setEnabled(boolean enabled)
public int getBacklogSize()
public void setBacklogSize(int backlogSize)
public boolean isRemoveOnDump()
public void setRemoveOnDump(boolean removeOnDump)
public int getBodyMaxChars()
public void setBodyMaxChars(int bodyMaxChars)
public boolean isBodyIncludeStreams()
public void setBodyIncludeStreams(boolean bodyIncludeStreams)
public boolean isBodyIncludeFiles()
public void setBodyIncludeFiles(boolean bodyIncludeFiles)
public String getTracePattern()
public void setTracePattern(String tracePattern)
public String getTraceFilter()
public void setTraceFilter(String filter)
public long getTraceCounter()
public void resetTraceCounter()
public List<BacklogTracerEventMessage> dumpTracedMessages(String nodeId)
public String dumpTracedMessagesAsXml(String nodeId)
public List<BacklogTracerEventMessage> dumpAllTracedMessages()
public String dumpAllTracedMessagesAsXml()
public void clear()
public long incrementTraceCounter()
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.
doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.
doStop
in class ServiceSupport
Exception
ServiceSupport.doStart()
protected void doShutdown() throws Exception
ServiceSupport
doShutdown
in class ServiceSupport
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |