public class TraceItemDispatcher
extends java.lang.Object
implements java.lang.Runnable
Internal use only.
.A dispatcher for TraceItems
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUFFER_DISABLED |
private static int |
BUFFER_ENABLED |
private static int |
BUFFER_SHUTTING_DOWN |
private static int |
bufferStatus_ |
private int |
cacheMaxSize_ |
private TraceItemQueue |
cacheTraceItemQueue_ |
private static java.text.Format |
TIMESTAMP_FORMAT |
private TraceItemQueue |
traceQueue_ |
| Constructor and Description |
|---|
TraceItemDispatcher() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotNull(java.lang.String fieldName,
java.lang.Object fieldValue)
Verify that the specified value is not null.
|
private static void |
defaultTraceWriter(TraceItem item)
Provide default behaviour
|
void |
dispatch(TraceItem item)
Add an item to the trace queue.
|
void |
disposeTraceItem(TraceItem item)
Dispose of a trace item.
|
private void |
dumpTraceElement(TraceItem item)
Format an item and print it to standard out.
|
void |
flush() |
TraceItem |
getNewTraceItem()
Return a trace item
|
TraceItemQueue |
getTraceItemQueue()
Get the queue.
|
boolean |
isBufferingEnabled()
Return true if buffering is enabled.
|
void |
run() |
void |
setBufferingEnabled(boolean enabled)
Set whether or not to buffer the output of the trace calls.
|
private void |
waitForQueueToEmpty() |
private static final java.text.Format TIMESTAMP_FORMAT
private static final int BUFFER_ENABLED
private static final int BUFFER_SHUTTING_DOWN
private static final int BUFFER_DISABLED
private static int bufferStatus_
private final TraceItemQueue traceQueue_
private TraceItemQueue cacheTraceItemQueue_
private int cacheMaxSize_
public void run()
run in interface java.lang.Runnableprivate void dumpTraceElement(TraceItem item)
item - the item to print.private static void defaultTraceWriter(TraceItem item)
item - The item to printpublic TraceItemQueue getTraceItemQueue()
public void dispatch(TraceItem item)
item - The item to add.private void waitForQueueToEmpty()
public void setBufferingEnabled(boolean enabled)
enabled - True if buffering should be enabledpublic boolean isBufferingEnabled()
public void flush()
public TraceItem getNewTraceItem()
public void disposeTraceItem(TraceItem item)
item - The item to dispose.protected final void assertNotNull(java.lang.String fieldName,
java.lang.Object fieldValue)
throws DetailedNullPointerException
fieldName - The name of the field to checkfieldValue - The value of the field to checkDetailedNullPointerException - If fieldValue is null