com.ibm.xml.enc.dom
Class Debug
java.lang.Object
com.ibm.xml.enc.dom.Debug
public class Debug
- extends java.lang.Object
A utility class for debuging.
This class works with the configuration file. Users can specify the debug options
in configuration file. The setting is debug=. Value could be one or multiple of
these: audit,admin,config,drivetable,server,transport,logic,console,all,none.
When it is set to be multiple values, each should be separated by a ",' or ";".
Note that the console is always on, no matter you set it or not, which is used
to display useful information to end users at the Key manager console. The debug
can also be enabled using runtime system property -Dcom.ibm.keymanager.debug=
, and could be one or multiple of audit,admin,config,drivetable,server,
transport,logic,console,all,none. The runtime property overrides the settings
in the configuration file.
The debug output will be displayed on console by default. You can switch it
to log the message in a file in the config file. The setting is debug.ouput=
. The could be "console" or "simple file". This class utilizes
the java.util.logging functions underneath. You can go to logging.properties in
the Java home lib extension to set up the file name pattern (java.util.logging.FileHandler.pattern),
file size limit (java.util.logging.FileHandler.limit), and
number of files to cycle through (java.util.logging.FileHandler.count). There are other
settings related to fileHandler or consoleHandler, but we don't provider users
the ability to override
them in the first release.
Field Summary |
static java.lang.String |
ALL
The debug category is all. |
static java.lang.String |
CONSOLE
The debug category is console. |
(package private) static java.lang.String |
DEBUG
|
(package private) static java.lang.String |
HANDLER_FILE
|
(package private) static java.lang.String |
HANDLER_TYPE
|
static java.lang.String |
NONE
The debug category is none. |
(package private) static java.lang.String |
TYPE_CONSOLE
|
(package private) static java.lang.String |
TYPE_SIMPLE_FILE
|
static java.lang.String |
XMLENC
|
Constructor Summary |
protected |
Debug()
|
Method Summary |
void |
entry(java.lang.String className,
java.lang.String methodName)
Traces the entry to a specified method. |
void |
entry(java.lang.String className,
java.lang.String methodName,
java.lang.Object[] params)
Traces the entry to a specified method. |
void |
exit(java.lang.String className,
java.lang.String methodName)
Traces a specified method return. |
void |
exit(java.lang.String className,
java.lang.String methodName,
boolean retValue)
Traces a specified method return, with return type to be boolean. |
void |
exit(java.lang.String className,
java.lang.String methodName,
byte retValue)
Traces a specified method return, with return type to be byte. |
void |
exit(java.lang.String className,
java.lang.String methodName,
int retValue)
Traces a specified method return, with return type to be int. |
void |
exit(java.lang.String className,
java.lang.String methodName,
long retValue)
Traces a specified method return, with return type to be long. |
void |
exit(java.lang.String className,
java.lang.String methodName,
java.lang.Object retValue)
Traces a specified method return, specifying the return object. |
void |
exit(java.lang.String className,
java.lang.String methodName,
short retValue)
Traces a specified method return, with return type to be short. |
static Debug |
getInstance(java.lang.String option)
Gets an instance of this class |
static void |
Help()
|
void |
init(java.util.Properties config)
Initializes the Debug instance. |
static boolean |
isOn(java.lang.String option)
Indicates whether the specified module's debugging is turned on. |
void |
refresh(java.util.Properties config)
Refreshes the Debug with configuration. |
void |
shutdown()
Shut down the debug utility. |
void |
trace(java.lang.String className,
java.lang.String methodName,
byte[] data)
Traces an byte array. |
void |
trace(java.lang.String className,
java.lang.String methodName,
java.lang.String message)
Traces a debug message, specifying the class name, method name. |
void |
trace(java.lang.String className,
java.lang.String methodName,
java.lang.String message,
java.lang.Object[] params)
Traces a debug message, specifying the class name, method name and an
array of object arguments. |
void |
trace(java.lang.String className,
java.lang.String methodName,
java.lang.String message,
java.lang.Throwable throwable)
Traces Throwable information |
void |
trace(java.lang.String className,
java.lang.String methodName,
java.lang.Throwable throwable)
Traces Throwable information |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE_CONSOLE
static final java.lang.String TYPE_CONSOLE
- See Also:
- Constant Field Values
TYPE_SIMPLE_FILE
static final java.lang.String TYPE_SIMPLE_FILE
- See Also:
- Constant Field Values
HANDLER_TYPE
static final java.lang.String HANDLER_TYPE
- See Also:
- Constant Field Values
HANDLER_FILE
static final java.lang.String HANDLER_FILE
- See Also:
- Constant Field Values
XMLENC
public static final java.lang.String XMLENC
- See Also:
- Constant Field Values
ALL
public static final java.lang.String ALL
- The debug category is all.
- See Also:
- Constant Field Values
CONSOLE
public static final java.lang.String CONSOLE
- The debug category is console.
- See Also:
- Constant Field Values
NONE
public static final java.lang.String NONE
- The debug category is none.
- See Also:
- Constant Field Values
DEBUG
static final java.lang.String DEBUG
- See Also:
- Constant Field Values
Debug
protected Debug()
getInstance
public static Debug getInstance(java.lang.String option)
- Gets an instance of this class
init
public void init(java.util.Properties config)
- Initializes the Debug instance. As the getInstance() returns the singleton
of Debug, the init() is called only once. After the Debug is initialized,
you can update it using refresh().
isOn
public static boolean isOn(java.lang.String option)
- Indicates whether the specified module's debugging is turned on.
- Parameters:
option
- the option indicating the module.
trace
public void trace(java.lang.String className,
java.lang.String methodName,
java.lang.String message)
- Traces a debug message, specifying the class name, method name. The output message will be directed to console.
- Parameters:
className
- the name of class the message comes frommethodName
- the name of method the message comes frommessage
- the debugging message
trace
public void trace(java.lang.String className,
java.lang.String methodName,
java.lang.String message,
java.lang.Object[] params)
- Traces a debug message, specifying the class name, method name and an
array of object arguments.
- Parameters:
className
- the name of class the message comes frommethodName
- the name of method the message comes frommessage
- the debug messageparams
- an array of parameters to the message
trace
public void trace(java.lang.String className,
java.lang.String methodName,
byte[] data)
- Traces an byte array.
- Parameters:
className
- the name of class the data come frommethodName
- the name of method the data come fromdata
- an byte array of data
trace
public void trace(java.lang.String className,
java.lang.String methodName,
java.lang.Throwable throwable)
- Traces Throwable information
- Parameters:
className
- the name of class the message comes frommethodName
- the name of method the message comes fromthrowable
- the Throwable to be traced.
trace
public void trace(java.lang.String className,
java.lang.String methodName,
java.lang.String message,
java.lang.Throwable throwable)
- Traces Throwable information
- Parameters:
className
- the name of class the message comes frommethodName
- the name of method the message comes frommessage
- the String messagethrowable
- the Throwable to be traced.
entry
public void entry(java.lang.String className,
java.lang.String methodName)
- Traces the entry to a specified method.
- Parameters:
className
- the name of class for the specified methodmethodName
- the name of the specified method to enter.
entry
public void entry(java.lang.String className,
java.lang.String methodName,
java.lang.Object[] params)
- Traces the entry to a specified method.
- Parameters:
className
- the name of class for the specified methodmethodName
- the name of the specified method to enter.params
- an array of objects as parameters.
exit
public void exit(java.lang.String className,
java.lang.String methodName)
- Traces a specified method return.
- Parameters:
className
- the name of class for the specified method.methodName
- the name of the specified method to exit.
exit
public void exit(java.lang.String className,
java.lang.String methodName,
byte retValue)
- Traces a specified method return, with return type to be byte.
- Parameters:
className
- the name of class for the specified method.methodName
- the name of the specified method to exit.retValue
- the returned byte value.
exit
public void exit(java.lang.String className,
java.lang.String methodName,
short retValue)
- Traces a specified method return, with return type to be short.
- Parameters:
className
- the name of class for the specified method.methodName
- the name of the specified method to exit.retValue
- the returned short value.
exit
public void exit(java.lang.String className,
java.lang.String methodName,
int retValue)
- Traces a specified method return, with return type to be int.
- Parameters:
className
- the name of class for the specified method.methodName
- the name of the specified method to exit.retValue
- the returned int value.
exit
public void exit(java.lang.String className,
java.lang.String methodName,
long retValue)
- Traces a specified method return, with return type to be long.
- Parameters:
className
- the name of class for the specified method.methodName
- the name of the specified method to exit.retValue
- the returned long value.
exit
public void exit(java.lang.String className,
java.lang.String methodName,
boolean retValue)
- Traces a specified method return, with return type to be boolean.
- Parameters:
className
- the name of class for the specified method.methodName
- the name of the specified method to exit.retValue
- the returned boolean value.
exit
public void exit(java.lang.String className,
java.lang.String methodName,
java.lang.Object retValue)
- Traces a specified method return, specifying the return object.
- Parameters:
className
- the name of class for the specified method.methodName
- the name of the specified method to exit.retValue
- the returned object.
Help
public static void Help()
refresh
public void refresh(java.util.Properties config)
- Refreshes the Debug with configuration. Note that we don't change
debug.output type on the fly.
shutdown
public void shutdown()
- Shut down the debug utility. This method has to be called at the very end of the Keymanager main program
to prevent crashing other debuging operations.
Portions Copyright 2003, 2012 IBM Corporation.
Portions Copyright 2003, 2012 Oracle and/or its affiliates.