|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openfuture.util.misc.Trace
The Trace class provides static methods that can be used in Java Applets and Applications to output trace messages to a trace device. Traces can be activated on a per class basis and for each class a combination of any of the following trace levels is possible: 0.ERROR: should be used in case of severe errors 1.WARNING: should be used in case of warnings and uncritical errors 2.IN: should be used as the first statement in a method 3.OUT: should be used before existing a method 4.PARAMETER: should be used to trace out method parameters 5.MESSAGE: should be used to trace out any message within the method body 6.USER-DEFINED: user defined trace level 7.EXCEPTION: should be used when an exception occurs (is not maskable) The trace mechanism is initialized via a config file that contains a bit mask for each class that uses traces, e.g. util.email.MailData: 0 util.email.MailSender: 0 jawa.fzbewertung.AufnahmeGUI: 255 jawa.fzbewertung.CICSData: 3 jawa.fzbewertung.CreateMapApplet: 3 The value corresponds to the combination of trace levels 0. - 6. where each trace level is activated by setting the appropriate bit to 1, e.g. a value of 3 (0000 0011 in binary mode) means that only ERRORS and WARNING are going to be traced for a given class. The config file can either be read via HTTP using the method readTraceConfig or directly from the local file system using the method readTraceConfigFromFile.
Field Summary | |
static int |
TD_ALL
|
static int |
TD_CONSOLE
|
static int |
TD_FILE
|
static int |
TL_LOW
|
static java.lang.String |
TL_LOW_STRING
|
static int |
TL_MEDIUM
|
static java.lang.String |
TL_MEDIUM_STRING
|
static int |
TL_OFF
|
static java.lang.String |
TL_OFF_STRING
|
static int |
TL_VERBOSE
|
static java.lang.String |
TL_VERBOSE_STRING
|
static int |
TT_DATE
|
static int |
TT_OFF
|
static int |
TT_TIME
|
static int |
TT_TIME_MS
|
Constructor Summary | |
Trace()
|
Method Summary | |
static void |
closeOutputFile()
closes the outputStream in case of TD_FILE & TD_ALL |
static void |
error(java.lang.Object theObject,
java.lang.String msg)
Describe 'error' method here. |
static void |
error(java.lang.Object theObject,
java.lang.String msg,
int nRID)
Describe 'error' method here. |
static void |
exception(java.lang.Object theObject,
java.lang.String msg)
Describe 'exception' method here. |
static void |
exception(java.lang.Object theObject,
java.lang.String msg,
int nRID)
Describe 'exception' method here. |
static java.lang.String |
getDetailedStatusString()
is used to retrieve information about the config file that is currently in use. |
static java.lang.String |
getStatusString()
is used to retrieve information about the config file that is currently in use. |
static void |
in(java.lang.Object theObject,
java.lang.String msg)
Describe 'in' method here. |
static void |
message(java.lang.Object theObject,
java.lang.String msg)
Describe 'message' method here. |
static void |
message(java.lang.Object theObject,
java.lang.String msg,
int nRID)
Describe 'message' method here. |
static void |
out(java.lang.Object theObject,
java.lang.String msg)
Describe 'out' method here. |
static void |
param(java.lang.Object theObject,
java.lang.String msg)
Describe 'param' method here. |
static java.lang.String |
printContent()
is used to retrieve information about the config file that is currently in use. |
static int |
readTraceConfig(java.lang.String urlPrefix,
java.lang.String filename)
tries to read the config file given as a parameter and sets up the internal hashtable. |
static int |
readTraceConfigFromFile(java.lang.String filename)
tries to read the config file given as a parameter and sets up the internal hashtable. |
static void |
setDateAndTimeMode(int flag)
determines if date and time (and eventually milliseconds) will be used as a prefix for the trace output. |
static void |
setOutputMode(int flag,
java.lang.String filename)
determines the output mode. |
static void |
setTraceMode(java.lang.Object theObject,
int flag)
sets the trace bit mask for a given class manually. |
static void |
setTraceModeDefault(int flag)
sets the trace default bit mask. |
static void |
user(java.lang.Object theObject,
java.lang.String msg)
Describe 'user' method here. |
static void |
user(java.lang.Object theObject,
java.lang.String msg,
int nRID)
Describe 'user' method here. |
static void |
user(java.lang.Object theObject,
java.lang.String prefix,
java.lang.String msg)
Describe 'user' method here. |
static void |
user(java.lang.Object theObject,
java.lang.String prefix,
java.lang.String msg,
int nRID)
Describe 'user' method here. |
static void |
warning(java.lang.Object theObject,
java.lang.String msg)
Describe 'warning' method here. |
static void |
warning(java.lang.Object theObject,
java.lang.String msg,
int nRID)
Describe 'warning' method here. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TL_OFF
public static final int TL_LOW
public static final int TL_MEDIUM
public static final int TL_VERBOSE
public static final java.lang.String TL_OFF_STRING
public static final java.lang.String TL_LOW_STRING
public static final java.lang.String TL_MEDIUM_STRING
public static final java.lang.String TL_VERBOSE_STRING
public static final int TD_CONSOLE
public static final int TD_FILE
public static final int TD_ALL
public static final int TT_OFF
public static final int TT_DATE
public static final int TT_TIME
public static final int TT_TIME_MS
Constructor Detail |
public Trace()
Method Detail |
public static void error(java.lang.Object theObject, java.lang.String msg)
theObject
- a value of type 'Object'msg
- a value of type 'String'public static void error(java.lang.Object theObject, java.lang.String msg, int nRID)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagenRID
- a request ID used for identifying multiple instances of the same classpublic static void exception(java.lang.Object theObject, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagepublic static void exception(java.lang.Object theObject, java.lang.String msg, int nRID)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagenRID
- a request ID used for identifying multiple instances of the same classpublic static void in(java.lang.Object theObject, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagepublic static void message(java.lang.Object theObject, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagepublic static void message(java.lang.Object theObject, java.lang.String msg, int nRID)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagenRID
- a request ID used for identifying multiple instances of the same classpublic static void out(java.lang.Object theObject, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagepublic static void param(java.lang.Object theObject, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagepublic static void user(java.lang.Object theObject, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagepublic static void user(java.lang.Object theObject, java.lang.String msg, int nRID)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagenRID
- a request ID used for identifying multiple instances of the same classpublic static void user(java.lang.Object theObject, java.lang.String prefix, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectprefix
- a value of type 'String'msg
- the trace output messagepublic static void user(java.lang.Object theObject, java.lang.String prefix, java.lang.String msg, int nRID)
theObject
- object reference (this pointer) to the calling objectprefix
- a value of type 'String'msg
- the trace output messagenRID
- a request ID used for identifying multiple instances of the same classpublic static void warning(java.lang.Object theObject, java.lang.String msg)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagepublic static void warning(java.lang.Object theObject, java.lang.String msg, int nRID)
theObject
- object reference (this pointer) to the calling objectmsg
- the trace output messagenRID
- a request ID used for identifying multiple instances of the same classpublic static java.lang.String printContent()
public static int readTraceConfig(java.lang.String urlPrefix, java.lang.String filename)
urlPrefix
- URL path pointing to the directory where the config file
is stored.filename
- name the config filepublic static int readTraceConfigFromFile(java.lang.String filename)
filename
- complete path that points to the config filepublic static java.lang.String getDetailedStatusString()
public static java.lang.String getStatusString()
public static void setDateAndTimeMode(int flag)
flag
- a bitwise combination of TT_DATE, TT_TIME, TT_TIME_MSpublic static void setOutputMode(int flag, java.lang.String filename)
flag
- the output mode flag. This is either TD_FILE, TD_CONSOLE or TD_ALLfilename
- the name of the output file (if TD_FILE or TD_ALL is chosen)public static void closeOutputFile()
public static void setTraceMode(java.lang.Object theObject, int flag)
theObject
- the object instance (upon which the class will be determined)flag
- the trace bit flagpublic static void setTraceModeDefault(int flag)
flag
- the default trace bit flag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |