IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class Trace

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

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

This class provide the traditional static API for trace users. These APIs are deprecated in BTT6.1.New API of BTTLog class are recommended.


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.
protected static boolean directToCommonLogging
           
protected static boolean directToWAS
           
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.
protected static int globalLevel
           
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 boolean showThreadName
           
protected static java.lang.String tID
           
static java.util.ResourceBundle traceBundle
          define trace resource bundle.
protected static java.lang.String traceMethodPath
          The complete name of trace method.
protected static TracesWindow tracesWindow
          The tracesWindow instance.
protected static boolean traceToCommLogging
           
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.
protected static short wasTraceCatalog
           
 
Constructor Summary
Trace()
          This constructor creates a Trace object.
 
Method Summary
static void closeDisplay()
          Closes and disables the trace to display facility.
protected static void createEnvironment()
          Creates all the object structure necessary for traces system.
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.Iterator getComponents()
          Returns the name of all the components that are registered in traces system.
static java.util.HashMap<java.lang.String,TraceRequester> getComponentTraceSetting()
          Get all components trace setting with TraceRequester hash map
static TraceRequester getComponentTraceSetting(java.lang.String component)
          Get the component trace setting by component name
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 getShowThread()
          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.lang.String getTID()
          Get terminal ID (only for RCP client trace)
static java.util.ResourceBundle getTraceBundle()
          Returns the traceBundle.
static int getTraceLevel()
          Return the global trace level
static boolean getTraceTarget(int target)
          get if a Trace Target is enabled
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 setTID(java.lang.String tid)
          Set terminal ID (only for RCP client trace)
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, boolean enable, int level)
          Enables or disables the specified level for the specified component according to the specified boolean value.
static void setTraceTarget(int target, boolean enabled)
          enable/disable trace target
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 stop()
           
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.


showThreadName

public static boolean showThreadName

traceMethodPath

protected static java.lang.String traceMethodPath
The complete name of trace method.


traceToWAS

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


traceToCommLogging

protected static boolean traceToCommLogging

traceBundle

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


exceptionBundle

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


globalLevel

protected static int globalLevel

tID

protected static java.lang.String tID

wasTraceCatalog

protected static short wasTraceCatalog

directToCommonLogging

protected static boolean directToCommonLogging

directToWAS

protected static boolean directToWAS
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.


createEnvironment

protected static void createEnvironment()
Creates all the object structure necessary for traces system.


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

getShowThread

public static boolean getShowThread()
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

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

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

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

stop

public static void stop()

setTID

public static void setTID(java.lang.String tid)
Set terminal ID (only for RCP client trace)

Parameters:
tid -

getTID

public static java.lang.String getTID()
Get terminal ID (only for RCP client trace)

Returns:

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(java.lang.String component,
                                 boolean enable,
                                 int level)
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
enable - java.lang.boolean - If the trace is eanbled for the component
level - int - The level of trace

getComponentTraceSetting

public static java.util.HashMap<java.lang.String,TraceRequester> getComponentTraceSetting()
Get all components trace setting with TraceRequester hash map

Returns:
HashMap

getComponentTraceSetting

public static TraceRequester getComponentTraceSetting(java.lang.String component)
Get the component trace setting by component name

Parameters:
component -
Returns:
TraceRequester

getTraceTarget

public static boolean getTraceTarget(int target)
get if a Trace Target is enabled

Parameters:
target - refer Trace trage constant defined in TraceConst class.
Returns:
true if traget is enabled

setTraceTarget

public static void setTraceTarget(int target,
                                  boolean enabled)
enable/disable trace target

Parameters:
target - refer Trace trage constant defined in TraceConst class.
enabled -

getTraceLevel

public static int getTraceLevel()
Return the global trace level

Returns:

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2010