IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.base
Class Trace

java.lang.Object
  extended bycom.ibm.btt.base.Trace
All Implemented Interfaces:
java.lang.Runnable

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
          Deprecated. Use AllTypes instead of 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 java.util.ResourceBundle exceptionBundle
          Define exception resource bundle.
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.
static java.util.ResourceBundle traceBundle
          define trace resource bundle.
protected static TracesWindow tracesWindow
          The tracesWindow instance.
static boolean traceToFile
          The flag to indicate if the trace to file facility is activated.
static boolean traceToWAS
          The flag is to indicate whether the trace to WAS 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. See the traces API in the Product Documentation
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 java.util.ResourceBundle getExceptionBundle()
          Returns the exceptionBundle.
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 java.util.ResourceBundle getTraceBundle()
          Returns the traceBundle.
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 the 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 setExceptionBundle(java.util.ResourceBundle exceptionBundle)
          Sets the exceptionBundle.
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 setTraceBundle(java.util.ResourceBundle traceBundle)
          Sets the traceBundle.
static void setTraceLevel(int level)
          Deprecated. - See the traces API in the Product Documentation
static void setTraceLevel(int level, boolean state)
          Enables or disables the specified level in the generic trace levels according to the 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. - See the traces API in the Product Documentation
static void trace(int inf, java.lang.String TID, java.lang.String str)
          Deprecated. - See the traces API in the Product Documentation
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.

See Also:
Constant Field Values

Information

public static final int Information
The Information type.

See Also:
Constant Field Values

Warning

public static final int Warning
The Warning type.

See Also:
Constant Field Values

Error

public static final int Error
The Error type.

See Also:
Constant Field Values

Severe

public static final int Severe
The Severe type.

See Also:
Constant Field Values

Debug

public static final int Debug
The Debug type.

See Also:
Constant Field Values

VTF

public static final int VTF
Deprecated. See the traces API in the Product Documentation

See Also:
Constant Field Values

All

public static final int All
Deprecated. Use AllTypes instead of All

See Also:
Constant Field Values

AllTypes

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

See Also:
Constant Field Values

High

public static final int High
The High level.

See Also:
Constant Field Values

Medium

public static final int Medium
The Medium level.

See Also:
Constant Field Values

Low

public static final int Low
The Low level.

See Also:
Constant Field Values

AllLevels

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

See Also:
Constant Field Values

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 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.


traceToWAS

public static boolean traceToWAS
The flag is to indicate whether the trace to WAS facility is activated


traceBundle

public static java.util.ResourceBundle traceBundle
define trace resource bundle.


exceptionBundle

public static java.util.ResourceBundle exceptionBundle
Define exception resource bundle.

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 the 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. - See the traces API in the Product Documentation

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 to the 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. - See the traces API in the Product Documentation

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. - See the traces API in the Product Documentation

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.


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

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

getExceptionBundle

public static java.util.ResourceBundle getExceptionBundle()
Returns the exceptionBundle.

Returns:
ResourceBundle

setExceptionBundle

public static void setExceptionBundle(java.util.ResourceBundle exceptionBundle)
Sets the exceptionBundle.

Parameters:
exceptionBundle - The exceptionBundle to set

getTraceBundle

public static java.util.ResourceBundle getTraceBundle()
Returns the traceBundle.

Returns:
ResourceBundle

setTraceBundle

public static void setTraceBundle(java.util.ResourceBundle traceBundle)
Sets the traceBundle.

Parameters:
traceBundle - The traceBundle to set

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005