T - the wrapped tracerpublic abstract class QueueTracer<T extends AbstractTracer> extends AbstractTracer
AbstractTracer but does so by wrapping and delegating to another AbstractTracer. In particular the
current tracing context will be automatically cleared when calling wayout() and the method stack remains empty afterwards. Thus the tracer
can be reused for another thread's tracing context without any danger to create a memory leak.
AbstractTracer.Exception| Modifier and Type | Field and Description |
|---|---|
protected T |
tracer
Some tracer.
|
VERSION| Constructor and Description |
|---|
QueueTracer(String name,
T tracer)
Constructor expects the tracer name and the to be wrapped tracer instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearCurrentTracingContext()
Delegates to the corresponding method of the wrapped tracer.
|
void |
close()
Closes the wrapped tracer.
|
TraceMethod |
entry(String returnType,
Class clazz,
String methodSignature)
Delegates to the corresponding method of the wrapped tracer.
|
TraceMethod |
entry(String returnType,
Object object,
String methodSignature)
Delegates to the corresponding method of the wrapped tracer.
|
int |
getBufferSize()
Delegates to the corresponding method of the wrapped tracer.
|
Object |
getSyncObject()
Delegates to the corresponding method of the wrapped tracer.
|
protected AbstractThreadMap |
getThreadMap()
Delegates to the corresponding method of the wrapped tracer.
|
void |
initCurrentTracingContext()
Delegates to the corresponding method of the wrapped tracer by using the config parameter global
to all queued tracer.
|
void |
initCurrentTracingContext(int debugLevel,
boolean online)
Delegates to the corresponding method of the wrapped tracer.
|
boolean |
isAutoflush()
Delegates to the corresponding method of the wrapped tracer.
|
boolean |
isOpened()
Delegates to the corresponding method of the wrapped tracer.
|
void |
logException(LogLevel logLevel,
Throwable throwable,
Class clazz,
String methodName)
Delegates to the corresponding method of the wrapped tracer.
|
void |
logMessage(LogLevel logLevel,
String message,
Class clazz,
String methodName)
Delegates to the corresponding method of the wrapped tracer.
|
void |
open()
Opens the wrapped tracer.
|
IndentablePrintStream |
out()
Delegates to the corresponding method of the wrapped tracer.
|
protected IndentablePrintStream |
out(int level)
Delegates to the corresponding method of the wrapped tracer.
|
protected void |
readConfiguration(XPath xpath,
Node node)
Reads the configuration for this particular tracer instance by evaluating the given node with the given xpath engine.
|
protected void |
setAutoflush(boolean autoflush)
Sets the autoflush mode of the wrapped tracer
|
void |
setBufferSize(int bufferSize)
Sets the buffer size of the wrapped tracer.
|
TraceMethod |
wayout()
Delegates to the corresponding method of the wrapped tracer.
|
entry, formatStreamErrorState, formatVersionInfo, getBufferedOutputStream, getName, getNullPrintStream, getTracePrintStream, setBufferedOutputStream, setOpened, setTracePrintStream, substituteprotected final T extends AbstractTracer tracer
public Object getSyncObject()
getSyncObject in class AbstractTracerpublic int getBufferSize()
getBufferSize in class AbstractTracerpublic boolean isAutoflush()
isAutoflush in class AbstractTracerpublic boolean isOpened()
isOpened in class AbstractTracerpublic void setBufferSize(int bufferSize)
setBufferSize in class AbstractTracerbufferSize - the bufferSize to setprotected void setAutoflush(boolean autoflush)
setAutoflush in class AbstractTracerautoflush - the autoflush to setprotected void readConfiguration(XPath xpath, Node node) throws XPathExpressionException, AbstractTracer.Exception
AbstractTracerreadConfiguration in class AbstractTracerxpath - the xpath enginenode - the config nodeXPathExpressionException - indicates xpath problemsAbstractTracer.Exception - indicates problems when configuring certain tracer instancespublic void open()
open in class AbstractTracerpublic void close()
close in class AbstractTracerpublic void initCurrentTracingContext()
initCurrentTracingContext in class AbstractTracerpublic void initCurrentTracingContext(int debugLevel,
boolean online)
initCurrentTracingContext in class AbstractTracerdebugLevel - controls the extent of the outputonline - a value of false delivers no output of the current thread at all whereas a value of true delivers output controlled by debugLevelpublic TraceMethod entry(String returnType, Class clazz, String methodSignature)
entry in class AbstractTracerreturnType - the return type of the method as string representationclazz - the class to which that method belongmethodSignature - the remaining method signature (without return type) inclusive parameter as string representationpublic TraceMethod entry(String returnType, Object object, String methodSignature)
entry in class AbstractTracerreturnType - the return type of the method as string representationobject - the object that owns the methodmethodSignature - the remaining method signature (without return type) inclusive parameter as string representationpublic void logMessage(LogLevel logLevel, String message, Class clazz, String methodName)
logMessage in class AbstractTracerlogLevel - one of the predefined levels INFO, WARNING, ERROR, FATAL and SEVEREmessage - the to be logged messageclazz - the originating classmethodName - the originating methodpublic void logException(LogLevel logLevel, Throwable throwable, Class clazz, String methodName)
logException in class AbstractTracerlogLevel - one of the predefined levels INFO, WARNING, ERROR, FATAL and SEVEREthrowable - the to be logged throwableclazz - the originating classmethodName - the name of the relevant methodprotected AbstractThreadMap getThreadMap()
getThreadMap in class AbstractTracerpublic TraceMethod wayout()
wayout in class AbstractTracerpublic IndentablePrintStream out()
out in class AbstractTracerIndentablePrintStreamprotected IndentablePrintStream out(int level)
out in class AbstractTracerlevel - the level of the to be printed dataIndentablePrintStreampublic void clearCurrentTracingContext()
clearCurrentTracingContext in class AbstractTracerCopyright © 2014. All rights reserved.