com.ibm.dse.base
Class Trace

java.lang.Object
  |
  +--com.ibm.dse.base.Trace

public class Trace
extends java.lang.Object
implements java.lang.Runnable

This class is used to write the results of a trace to a window, to a disk, or to both using the static trace method of this class.


Field Summary
static int All
           
static int AllLevels
          The constants that represents all levels.
static int AllTypes
          The constants that represents all types.
protected static TraceBuffer buffer
          The buffer where the trace lines are stored.
static int Debug
          The Debug type.
protected static java.lang.String Default_CP
          The code page for trace file.
static int Display
          The Display type.
static boolean enableTraces
          The flag to indicate if the trace to display facility is activated.
static int Error
          The Error type.
static int High
          The High level.
static int Information
          The Information type.
static int Low
          The Low level.
static int Medium
          The Medium level.
static int Severe
          The Severe type.
static boolean showStack
          The flag to indicate if the show originator option is activated.
protected static com.ibm.dse.base.TracesWindow tracesWindow
          The tracesWindow instance.
static boolean traceToFile
          The flag to indicate if the trace to file facility is activated.
protected static boolean useLog
          The flag to indicate if the web server log facilities are used instead of trace to display or disk facilities.
static int VTF
          Deprecated.  
static int Warning
          The Warning type.
 
Constructor Summary
Trace()
          This constructor creates a Trace object.
 
Method Summary
static void closeDisplay()
          Closes and disables the trace to display facility.
static boolean doTrace(java.lang.String component, int level, int type)
          Returns true if the specified level and the specified type are enabled for the specified component.
static java.util.Enumeration getComponents()
          Returns the name of all the components that are registered in traces system.
static boolean getEnableToDisplay()
          Returns true if the trace to display facility is enabled.
static boolean getEnableToFile()
          Returns true if the trace to file facility is enabled.
static boolean getEnableTrace(java.lang.String component)
          Returns true if the trace facility is enabled for the specified component.
static boolean getLockScrolling()
          Returns true if the lock-scrolling attribute is enabled in the viewer tool's trace window.
static boolean getOriginator()
          Returns true if the showOriginator setting is enabled.
static boolean getShowWarning()
          Returns true if the trace object will show a warning message in case of security exception.
static boolean getTraceLevel(int level)
          Returns true if the specified trace level is enabled in the generic trace.
static boolean getTraceLevel(java.lang.String component, int level)
          Returns true if the specified trace level is enabled in the specified component.
static boolean getTraceType(int type)
          Returns true if the specified trace type is enabled in generic trace.
static boolean getTraceType(java.lang.String component, int type)
          Returns true if the specified trace type is enabled in the specified component.
static void reset()
          Resets and initializes trace facility with original configuration.
static void resetNextLine()
          Sets the number of the next line to write to 1.
 void run()
          Main Trace thread process
static void setClearList()
          Clears the content of the viewer tool's trace window.
static void setEnableToDisplay(boolean ena)
          Enables or disables the trace to display facility according to the specified boolean value.
static void setEnableToFile(boolean ena)
          Enables or disables the trace to file facility according to the specified boolean value.
static void setEnableTrace(java.lang.String component, boolean newStatus)
          Enables or disables the trace facility for the specified component according to the specified boolean value.
static void setLockScrolling(boolean state)
          Enables or disables the lock-scrolling attribute in the trace window according to the specified boolean value.
static void setOriginator(boolean state)
          Enables or disables the originator information in the trace record according to the specified boolean value.
static void setTraceLevel(int level)
          Deprecated.  
static void setTraceLevel(int level, boolean state)
          Enables or disables the specified level in the generic trace levels according tot he specified boolean value.
static void setTraceLevel(java.lang.String component, int level, boolean newStatus)
          Enables or disables the specified level for the specified component according to the specified boolean value.
static void setTraceType(int type, boolean state)
          Enables or disables the specified type in the generic trace types according to the specified boolean value.
static void setTraceType(java.lang.String component, int type, boolean newStatus)
          Enables or disables the specified type for the specified component according to the specified boolean value.
static void trace(boolean check, java.lang.String component, int level, int type, java.lang.String TID, java.lang.Exception anException)
          Builds a trace record with the contents of the specified component, level, type, terminal identifier and exception.
static void trace(boolean check, java.lang.String component, int level, int type, java.lang.String TID, java.lang.String message)
          Builds a trace record with the contents of the specified component, level, type, terminal identifier and message.
static void trace(int inf, java.lang.String str)
          Deprecated.  
static void trace(int inf, java.lang.String TID, java.lang.String str)
          Deprecated.  
static void trace(java.lang.String component, int level, int type, java.lang.String TID, java.lang.Exception anException)
          Builds a trace record with the contents of the specified component, level, type, terminal identifier, and exception.
static void trace(java.lang.String component, int level, int inf, java.lang.String TID, java.lang.String str)
          Builds a trace record with the contents of the specified component, level, type, terminal identifier, and message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Display

public static final int Display
The Display type.

Information

public static final int Information
The Information type.

Warning

public static final int Warning
The Warning type.

Error

public static final int Error
The Error type.

Severe

public static final int Severe
The Severe type.

Debug

public static final int Debug
The Debug type.

VTF

public static final int VTF
Deprecated.  


All

public static final int All

AllTypes

public static final int AllTypes
The constants that represents all types.

High

public static final int High
The High level.

Medium

public static final int Medium
The Medium level.

Low

public static final int Low
The Low level.

AllLevels

public static final int AllLevels
The constants that represents all levels.

Default_CP

protected static java.lang.String Default_CP
The code page for trace file.

useLog

protected static boolean useLog
The flag to indicate if the web server log facilities are used instead of trace to display or disk facilities.

tracesWindow

protected static com.ibm.dse.base.TracesWindow tracesWindow
The tracesWindow instance.

buffer

protected static TraceBuffer buffer
The buffer where the trace lines are stored.

traceToFile

public static boolean traceToFile
The flag to indicate if the trace to file facility is activated.

enableTraces

public static boolean enableTraces
The flag to indicate if the trace to display facility is activated.

showStack

public static boolean showStack
The flag to indicate if the show originator option is activated.
Constructor Detail

Trace

public Trace()
This constructor creates a Trace object.
Method Detail

closeDisplay

public static void closeDisplay()
Closes and disables the trace to display facility.

doTrace

public static final boolean doTrace(java.lang.String component,
                                    int level,
                                    int type)
Returns true if the specified level and the specified type are enabled for the specified component. If the specified component is not found then the UnAssigned component is used.
Parameters:
component - java.lang.String The name of the component
level - int The level of trace
type - int The type of trace
Returns:
boolean

getComponents

public static java.util.Enumeration getComponents()
Returns the name of all the components that are registered in traces system.
Returns:
java.util.Enumeration - The components.

getEnableToDisplay

public static boolean getEnableToDisplay()
Returns true if the trace to display facility is enabled.
Returns:
boolean

getEnableToFile

public static boolean getEnableToFile()
Returns true if the trace to file facility is enabled.
Returns:
boolean

getEnableTrace

public static boolean getEnableTrace(java.lang.String component)
Returns true if the trace facility is enabled for the specified component.
Parameters:
component - java.lang.String The name of the component.
Returns:
boolean.

getLockScrolling

public static boolean getLockScrolling()
Returns true if the lock-scrolling attribute is enabled in the viewer tool's trace window.
Returns:
boolean.

getOriginator

public static boolean getOriginator()
Returns true if the showOriginator setting is enabled.
Returns:
boolean

getShowWarning

public static boolean getShowWarning()
Returns true if the trace object will show a warning message in case of security exception.
Returns:
boolean

getTraceLevel

public static boolean getTraceLevel(int level)
Returns true if the specified trace level is enabled in the generic trace.
Parameters:
level - int The level of trace.
Returns:
boolean

getTraceLevel

public static boolean getTraceLevel(java.lang.String component,
                                    int level)
Returns true if the specified trace level is enabled in the specified component.
Parameters:
component - java.lang.String The name of the component.
level - int The level of trace.
Returns:
boolean

getTraceType

public static boolean getTraceType(int type)
Returns true if the specified trace type is enabled in generic trace.
Parameters:
type - int The type of trace.
Returns:
boolean

getTraceType

public static boolean getTraceType(java.lang.String component,
                                   int type)
Returns true if the specified trace type is enabled in the specified component.
Parameters:
component - java.lang.String The name of the component.
type - int The type of trace.
Returns:
boolean

reset

public static final void reset()
Resets and initializes trace facility with original configuration.

resetNextLine

public static final void resetNextLine()
Sets the number of the next line to write to 1.

run

public void run()
Main Trace thread process
Specified by:
run in interface java.lang.Runnable

setClearList

public static void setClearList()
Clears the content of the viewer tool's trace window.

setEnableToDisplay

public static void setEnableToDisplay(boolean ena)
Enables or disables the trace to display facility according to the specified boolean value.
Parameters:
ena - boolean The new status

setEnableToFile

public static void setEnableToFile(boolean ena)
Enables or disables the trace to file facility according to the specified boolean value.
Parameters:
ena - boolean The new status

setEnableTrace

public static void setEnableTrace(java.lang.String component,
                                  boolean newStatus)
Enables or disables the trace facility for the specified component according to the specified boolean value.
Parameters:
component - java.lang.String The name of the component.
newStatus - boolean The new status value.

setLockScrolling

public static void setLockScrolling(boolean state)
Enables or disables the lock-scrolling attribute in the trace window according to the specified boolean value.
Parameters:
state - boolean The new state for the lock scrolling option

setOriginator

public static void setOriginator(boolean state)
Enables or disables the originator information in the trace record according to the specified boolean value.
Parameters:
state - boolean The new state for the originator option

setTraceLevel

public static void setTraceLevel(int level)
Deprecated.  

Sets the generic level of trace.
Parameters:
level - int the level.

setTraceLevel

public static void setTraceLevel(int level,
                                 boolean state)
Enables or disables the specified level in the generic trace levels according tot he specified boolean value.
Parameters:
level - int The level of trace
state - boolean The new state for the generic level of trace

setTraceLevel

public static void setTraceLevel(java.lang.String component,
                                 int level,
                                 boolean newStatus)
Enables or disables the specified level for the specified component according to the specified boolean value.
Parameters:
component - java.lang.String The name of the component
level - int The level of trace
newStatus - boolean The new state for the level of trace

setTraceType

public static void setTraceType(int type,
                                boolean state)
Enables or disables the specified type in the generic trace types according to the specified boolean value.
Parameters:
type - int The type of trace
state - boolean The new state for the generic type of trace

setTraceType

public static void setTraceType(java.lang.String component,
                                int type,
                                boolean newStatus)
Enables or disables the specified type for the specified component according to the specified boolean value.
Parameters:
component - java.lang.String The name of the component
type - int The type of trace
newStatus - boolean The new state for the type of trace.

trace

public static final void trace(int inf,
                               java.lang.String str)
Deprecated.  

Builds a trace record with the contents of the specified type and message.
Parameters:
inf - int The type
str - java.lang.String The message of trace record

trace

public static final void trace(int inf,
                               java.lang.String TID,
                               java.lang.String str)
Deprecated.  

Builds a trace record with the contents of the specified type, terminal identifier and message with UnAssigned component and High level if the level and type are enabled for the component.
Parameters:
inf - int The type
id - java.lang.String The TID
str - java.lang.String The message of trace record

trace

public static final void trace(java.lang.String component,
                               int level,
                               int type,
                               java.lang.String TID,
                               java.lang.Exception anException)
Builds a trace record with the contents of the specified component, level, type, terminal identifier, and exception.
Parameters:
component - java.lang.String The name of the component
level - int The level of trace.
type - int The type of trace.
TID - java.lang.String The terminal identification
anException - java.lang.Exception The exception from where is extracted the contents of trace record.

trace

public static final void trace(java.lang.String component,
                               int level,
                               int inf,
                               java.lang.String TID,
                               java.lang.String str)
Builds a trace record with the contents of the specified component, level, type, terminal identifier, and message.
Parameters:
component - java.lang.String The name of the component
level - int The level of trace.
inf - int The type of trace.
TID - java.lang.String The terminal identification
str - java.lang.String The message of trace record.

trace

public static final void trace(boolean check,
                               java.lang.String component,
                               int level,
                               int type,
                               java.lang.String TID,
                               java.lang.Exception anException)
Builds a trace record with the contents of the specified component, level, type, terminal identifier and exception. If check is true, the trace record is stored in the trace buffer only if the specified level and type are enabled for the specified component.
Parameters:
check - boolean
component - java.lang.String The name of the component
level - int The level of trace
type - int The type of trace
TID - java.lang.String The terminal identification
aException - java.lang.Exception The exception from where is extracted the message of trace record.

trace

public static final void trace(boolean check,
                               java.lang.String component,
                               int level,
                               int type,
                               java.lang.String TID,
                               java.lang.String message)
Builds a trace record with the contents of the specified component, level, type, terminal identifier and message. If check is true, the trace record is stored in the trace buffer only if the specified level and type are enabled for the specified component.
Parameters:
check - boolean
component - java.lang.String The name of the component
level - int The level of trace
type - int The type of trace
TID - java.lang.String The terminal identification
message - java.lang.String The message of trace record