|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Tracer
interface to be implemented by trace service providers.
You can define your own trace service provider class for the tracing
service either by subclassing PrintWriterTracer
or by implementing this
interface. Use Trace.setTracer()
to tell the trace service to use your
new class.
Method Summary | |
void |
dataTrace(int level,
java.lang.Object obj,
byte[] traceData)
Provide a formatted hex and ascii dump |
void |
dumpCallStack()
Writes a record of the current CallStack to the trace log. |
void |
dumpCallStack(java.lang.String title)
Writes a record of the current call stack to the trace log, including a header line for diagnostic purposes. |
void |
entry(int level,
java.lang.Object obj,
java.lang.String methodName)
Traces an entry to a standard (that is, non-static) method if the traceLevel is high enough. |
void |
entry(int level,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String methodParams)
Traces an entry to a standard (that is, non-static) method if the traceLevel is high enough. |
void |
entry(int level,
java.lang.String className,
java.lang.String methodName)
Traces an entry to a static method if the traceLevel is high enough. |
void |
entry(int level,
java.lang.String className,
java.lang.String methodName,
java.lang.String methodParams)
Traces an entry to a static method if the traceLevel is high enough. |
void |
exception(int level,
java.lang.Object obj,
java.lang.String methodName,
java.lang.Throwable exc)
Traces an exception caught in a non-static method if the traceLevel is high enough. |
void |
exception(int level,
java.lang.String className,
java.lang.String methodName,
java.lang.Throwable exc)
Traces an exception caught in a static method if the trace level is high enough. |
void |
exit(int level,
java.lang.Object obj,
java.lang.String methodName)
Traces an exit from a standard (that is, non-static) method if the traceLevel is high enough. |
void |
exit(int level,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String retVal)
Traces an exit from a standard (that is, non-static) method if the traceLevel is high enough. |
void |
exit(int level,
java.lang.String className,
java.lang.String methodName)
Traces an exit from a static method if the traceLevel is high enough. |
void |
exit(int level,
java.lang.String className,
java.lang.String methodName,
java.lang.String retVal)
Traces an exit from a static method if the traceLevel is high enough. |
int |
getFormat()
Get the output format for trace entries. |
int |
getMethodTraceThreshold()
Gets the threshhold trace level at which system method tracing (within the JVM) is enabled. |
int |
getTraceLevel()
Gets the current trace level. |
void |
setFormat(int format)
Sets the output format for trace entries. |
void |
setMethodTraceThreshold(int threshold)
Sets the threshhold trace level at which system method tracing (within the JVM) is enabled. |
void |
setTraceLevel(int level)
Sets the trace level for the current trace. |
void |
start()
Called when tracing is turned on to perform any initialisation required. |
void |
stop()
Called when tracing is turned off to peform any termination required. |
void |
trace(int level,
java.lang.Object obj,
java.lang.String traceText)
Prints one line of trace from within a non-static method if the traceLevel is high enough |
void |
trace(int level,
java.lang.String className,
java.lang.String traceText)
Prints one line of trace from within a static method if the traceLevel is high enough |
void |
trace(java.lang.Object obj,
java.lang.String traceText)
Prints one line of trace from within a non-static method. |
void |
trace(java.lang.String className,
java.lang.String traceText)
Prints one line of trace from within a static method. |
void |
turnMethodTracingOff()
Disables Java runtime (JVM) method tracing |
void |
turnMethodTracingOn()
Enables Java runtime (JVM) method tracing. |
Method Detail |
public void dataTrace(int level, java.lang.Object obj, byte[] traceData)
level
- the traceLevel at which this data is written to the trace logobj
- the object requesting the trace (can be null for a static method)traceData
- a byte[] array of the data to be tracedpublic void dumpCallStack()
public void dumpCallStack(java.lang.String title)
title
- header line written to the trace log with the call stack.public void entry(int level, java.lang.Object obj, java.lang.String methodName)
level
- the traceLevel at which this data is written to the trace logobj
- the object generating the trace recordmethodName
- the name of the method which has just been enteredpublic void entry(int level, java.lang.Object obj, java.lang.String methodName, java.lang.String methodParams)
level
- the traceLevel at which this data is written to the trace logobj
- the object generating the trace recordmethodName
- the name of the method which has just been enteredmethodParams
- the method parameters, suggested format is name=value, ...public void entry(int level, java.lang.String className, java.lang.String methodName)
level
- the traceLevel at which this data is written to the trace logclassName
- the class name of the class generating the trace recordmethodName
- the name of the method which has just been enteredpublic void entry(int level, java.lang.String className, java.lang.String methodName, java.lang.String methodParams)
level
- the traceLevel at which this data is written to the trace logclassName
- the class name of the class generating the trace recordmethodName
- the name of the method which has just been enteredmethodParams
- the method parameters (suggested format is name=value, ...)public void exception(int level, java.lang.Object obj, java.lang.String methodName, java.lang.Throwable exc)
level
- the traceLevel at which this data is written to the trace logobj
- the object where the exception was caughtmethodName
- the name of the method where the exception was caughtexc
- the exception itselfpublic void exception(int level, java.lang.String className, java.lang.String methodName, java.lang.Throwable exc)
level
- the traceLevel at which this data is written to the trace logclassName
- the name of the class where the exception was caughtmethodName
- the name of the method where the exception was caughtexc
- the exception itselfpublic void exit(int level, java.lang.Object obj, java.lang.String methodName)
level
- the traceLevel at which this data is written to the trace logobj
- the object generating the trace recordmethodName
- the name of the method which is being exitedpublic void exit(int level, java.lang.Object obj, java.lang.String methodName, java.lang.String retVal)
level
- the traceLevel at which this data is written to the trace logobj
- the object generating the trace recordmethodName
- the name of the method which is being exitedretVal
- the method return valuepublic void exit(int level, java.lang.String className, java.lang.String methodName)
level
- the traceLevel at which this data is written to the trace logclassName
- the class name of the class generating this trace recordmethodName
- the name of the method which is being exitedpublic void exit(int level, java.lang.String className, java.lang.String methodName, java.lang.String retVal)
level
- the traceLevel at which this data is written to the trace logclassName
- the class name of the class generating the trace recordmethodName
- the name of the method which is being exitedretVal
- the method return valuepublic int getFormat()
public int getMethodTraceThreshold()
public int getTraceLevel()
public void setFormat(int format)
format
- the format valuepublic void setMethodTraceThreshold(int threshold)
turnMethodTracingOn()
threshold
- the threshold value for JVM tracingpublic void setTraceLevel(int level)
Several trace level constants are defined as a guideline: ERROR_EXCEP, ENTRY_EXIT, EVENT, DATA and DUMP.
You do not need to call this method explicitly if you set the level
when you call turnTracingOn(int level)
.
level
- the desired level of tracingpublic void start()
public void stop()
public void trace(int level, java.lang.Object obj, java.lang.String traceText)
level
- the traceLevel at which this data is written to the trace logobj
- the object generating the trace recordtraceText
- the text information to be printed to the tracepublic void trace(int level, java.lang.String className, java.lang.String traceText)
level
- the traceLevel at which this data is written to the trace logclassName
- the class name of the class generating the trace logtraceText
- the text information to be printed to the tracepublic void trace(java.lang.Object obj, java.lang.String traceText)
obj
- the object generating the trace recordtraceText
- the information to be printed to the tracepublic void trace(java.lang.String className, java.lang.String traceText)
className
- the name of the class generating the trace recordtraceText
- the text information to be printed to the tracepublic void turnMethodTracingOff()
public void turnMethodTracingOn()
|
(c) Copyright IBM Corp. 2005. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |