com.bankframe.services.trace
Class TimingPointUtil

java.lang.Object
  extended bycom.bankframe.services.trace.TimingPointUtil

public class TimingPointUtil
extends java.lang.Object

This class provides utilities to work with timing points

Author:
rgwood, dwhelan

Field Summary
static TimingPoint[] buffer
          The buffer that holds each timing point
static int bufferSize
          This maintains the number of elements in the buffer
static int counter
           
static boolean customRecordingEnabled
           
static boolean doSummary
          If this flag is true then a summary is recorded along with the timing points when recording them to disk
static boolean enabled
          This determine whether timing points are enabled, this is set to false by default
static java.util.Vector enabledSubsystems
          This vector will hold all the substems that tming points are enabled for
static java.lang.String fileName
          This is the file name that the buffer will be cleared to
static java.lang.String[] format
          This determine if each fill of the buffer should be outputted to the set file.
static boolean hostRecordingEnabled
           
static int idCounter
           
static int MAJORTYPE_CUSTOM
           
static java.lang.String MAJORTYPE_CUSTOM_STRING
           
static int MAJORTYPE_HOST
           
static java.lang.String MAJORTYPE_HOST_STRING
           
static int MAJORTYPE_SERVLET
           
static java.lang.String MAJORTYPE_SERVLET_STRING
           
static int MAJORTYPE_TRANSACTIONHANDLER
           
static java.lang.String MAJORTYPE_TRANSACTIONHANDLER_STRING
           
static java.lang.String[] majorTypeStrings
           
static java.io.PrintStream outputPrintStream
          This is the printstream that is used when the buffer is cleared.
static boolean serverInstanceFileEnabled
           
static boolean servletRecordingEnabled
           
static java.lang.String SUBSYSTEMS_PREFIX
          This is the index in the BankFrameResource.properties file that identifies the subsystem to record for
static TimingPointAnalyzer timingPointAnalyzer
          This class is the class which is used to analyze each timing point
static java.util.Hashtable timingPointNames
          This hashtable will store name and timing points to allows timing points to be exited from within other classes without having to maintain a reference to that timing point
static boolean transactionHandlerRecordingEnabled
           
static java.util.Vector types
          This vector holds all the created type during the existence of this server
static boolean writeToFile
           
 
Constructor Summary
TimingPointUtil()
           
 
Method Summary
static void addSubsystem(java.lang.String subsystem)
          This method will add a subsystem to the list of subsytems that should be recorded
static void flush()
          This method will clear the timing points buffer
static TimingPointAnalyzer getAnalyzerClassName()
          This method return the analyser object used to do the custom analysing
static int getBufferSize()
          This method will tell the length of the timing point buffer
static boolean getCustomRecording()
          This method gets the utils to record timings in the custom code
static boolean getDoSummary()
          This method tell if summary information is to be included in the log
static java.util.Vector getEnabledSubsystems()
          This method gets all the enabled subsystems
static java.lang.String getFileName()
          This method will return the name of the log file that the timing point results are written to
static java.lang.String[] getFormat()
          This method the String Array holding the format of the TimingPoint
static boolean getHostRecording()
          This method will tell if host recording is enabled
static java.lang.String getMajorTypeString(int majorType)
          This method will get the String that corresponds to the given major type
static int getOrCreateType(java.lang.String typeString)
          This method creates the given type if on does not exist and returns the type id or just returns the type id if it already exists
static boolean getServletRecording()
          This method will tell if servlet recording is enabled
static boolean getTransactionHandlerRecording()
          This method will tell if transaction handler recording is enabled
static java.lang.String getType(int typeId)
          This method will determine if the /** This method will get the String that corresponds to the given type
static boolean getWriteTimingPointsToDisk()
          This method will get whether the timing points results are written to disk
static boolean isEnabled()
          This method determines whether or not to record timing points
static boolean isSubsystemEnabled(java.lang.String subsystem)
          This method determines in the timing points are enabled for a given major type
static boolean isWriteToFile()
           
static void record(TimingPoint tp)
          This method will recored a given timing point by adding it to the internal buffer
static boolean removeSubsystem(java.lang.String subsystem)
          This method will remove the given subsystem if it exists in the list
static void report()
          This method will write the timing points store in the buffer to the printStream of the specified fileName
static void report(java.io.PrintStream ps)
           
static void setAnalyzerClassName(TimingPointAnalyzer value)
          This method defines an external analyser class that allows additional processing to be done on the timing point
static void setBufferSize(int size)
          This sets the size of the buffer to a new size.
static void setCustomRecording(boolean value)
          This method set the utils to record timings in the custom code
static void setDoSummary(boolean value)
          This method will set whether summaries are recorded
static void setEnabled(boolean newEnabled)
          This method will switch the timing point service on and off
static void setFileName(java.lang.String name)
          This method will change the file that the timing point details are logged to If timingpoints are disabled, or writeToFile is false, then the file is not created.
static void setHostRecording(boolean value)
          This method set the utils to record timings in the host code
static void setPrintStream(java.io.PrintStream value)
          This method sets the utils to output to the given printStream object
static void setServletRecording(boolean value)
          This method set the utils to record timings in the servlet code
static void setTransactionHandlerRecording(boolean value)
          This method sets the utils to record timings in the transaction handler code
static void setWriteTimingPointsToDisk(boolean value)
          This method will set whether timing points are recored on disk
static void setWriteToFile(boolean val)
          This method will set whether to recored the buffer to a file
static java.lang.String stringRepresentation()
          This displays a string representation of the setting for timing points in MCA
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timingPointNames

public static java.util.Hashtable timingPointNames
This hashtable will store name and timing points to allows timing points to be exited from within other classes without having to maintain a reference to that timing point


SUBSYSTEMS_PREFIX

public static final java.lang.String SUBSYSTEMS_PREFIX
This is the index in the BankFrameResource.properties file that identifies the subsystem to record for

See Also:
Constant Field Values

enabledSubsystems

public static java.util.Vector enabledSubsystems
This vector will hold all the substems that tming points are enabled for


doSummary

public static boolean doSummary
If this flag is true then a summary is recorded along with the timing points when recording them to disk


bufferSize

public static int bufferSize
This maintains the number of elements in the buffer


fileName

public static java.lang.String fileName
This is the file name that the buffer will be cleared to


timingPointAnalyzer

public static TimingPointAnalyzer timingPointAnalyzer
This class is the class which is used to analyze each timing point


buffer

public static TimingPoint[] buffer
The buffer that holds each timing point


outputPrintStream

public static java.io.PrintStream outputPrintStream
This is the printstream that is used when the buffer is cleared. It determines where the buffer is cleared to


types

public static java.util.Vector types
This vector holds all the created type during the existence of this server


enabled

public static boolean enabled
This determine whether timing points are enabled, this is set to false by default


format

public static java.lang.String[] format
This determine if each fill of the buffer should be outputted to the set file. If this is false then it will be logged through the logging service


serverInstanceFileEnabled

public static boolean serverInstanceFileEnabled

writeToFile

public static boolean writeToFile

counter

public static int counter

idCounter

public static int idCounter

customRecordingEnabled

public static boolean customRecordingEnabled

hostRecordingEnabled

public static boolean hostRecordingEnabled

MAJORTYPE_SERVLET

public static final int MAJORTYPE_SERVLET
See Also:
Constant Field Values

MAJORTYPE_HOST

public static final int MAJORTYPE_HOST
See Also:
Constant Field Values

MAJORTYPE_TRANSACTIONHANDLER

public static final int MAJORTYPE_TRANSACTIONHANDLER
See Also:
Constant Field Values

MAJORTYPE_CUSTOM

public static final int MAJORTYPE_CUSTOM
See Also:
Constant Field Values

MAJORTYPE_SERVLET_STRING

public static final java.lang.String MAJORTYPE_SERVLET_STRING
See Also:
Constant Field Values

MAJORTYPE_HOST_STRING

public static final java.lang.String MAJORTYPE_HOST_STRING
See Also:
Constant Field Values

MAJORTYPE_TRANSACTIONHANDLER_STRING

public static final java.lang.String MAJORTYPE_TRANSACTIONHANDLER_STRING
See Also:
Constant Field Values

MAJORTYPE_CUSTOM_STRING

public static final java.lang.String MAJORTYPE_CUSTOM_STRING
See Also:
Constant Field Values

majorTypeStrings

public static final java.lang.String[] majorTypeStrings

servletRecordingEnabled

public static boolean servletRecordingEnabled

transactionHandlerRecordingEnabled

public static boolean transactionHandlerRecordingEnabled
Constructor Detail

TimingPointUtil

public TimingPointUtil()
Method Detail

addSubsystem

public static void addSubsystem(java.lang.String subsystem)
This method will add a subsystem to the list of subsytems that should be recorded

Parameters:
subsystem - to subsystem to add

flush

public static void flush()
This method will clear the timing points buffer


getAnalyzerClassName

public static TimingPointAnalyzer getAnalyzerClassName()
This method return the analyser object used to do the custom analysing

Returns:
an analyser object

getFormat

public static java.lang.String[] getFormat()
This method the String Array holding the format of the TimingPoint

Returns:
String[]

getBufferSize

public static int getBufferSize()
This method will tell the length of the timing point buffer

Returns:
the buffer length

getDoSummary

public static boolean getDoSummary()
This method tell if summary information is to be included in the log

Returns:
boolean

getEnabledSubsystems

public static java.util.Vector getEnabledSubsystems()
This method gets all the enabled subsystems

Returns:
a vector of subsystems

getFileName

public static java.lang.String getFileName()
This method will return the name of the log file that the timing point results are written to

Returns:
The name of the log file

getOrCreateType

public static int getOrCreateType(java.lang.String typeString)
This method creates the given type if on does not exist and returns the type id or just returns the type id if it already exists

Parameters:
typeString - the Type string to get or create
Returns:
the type id for the string

getType

public static java.lang.String getType(int typeId)
This method will determine if the /** This method will get the String that corresponds to the given type

Parameters:
typeId - the major type
Returns:
String

isSubsystemEnabled

public static boolean isSubsystemEnabled(java.lang.String subsystem)
This method determines in the timing points are enabled for a given major type


isEnabled

public static boolean isEnabled()
This method determines whether or not to record timing points

Returns:
true/false

isWriteToFile

public static boolean isWriteToFile()

record

public static void record(TimingPoint tp)
This method will recored a given timing point by adding it to the internal buffer

Parameters:
tp - the timing point to record

removeSubsystem

public static boolean removeSubsystem(java.lang.String subsystem)
This method will remove the given subsystem if it exists in the list

Parameters:
subsystem - to subsystem to attempt to remove
Returns:
true if the subsystem was successfully removed, false if it didn't exist in the list

report

public static void report()
This method will write the timing points store in the buffer to the printStream of the specified fileName


report

public static void report(java.io.PrintStream ps)

setAnalyzerClassName

public static void setAnalyzerClassName(TimingPointAnalyzer value)
This method defines an external analyser class that allows additional processing to be done on the timing point

Parameters:
value - true(on)/false(off)

setBufferSize

public static void setBufferSize(int size)
This sets the size of the buffer to a new size. If the new size if smalled than the old size then the last elements in the buffer will not be in the new buffer

Parameters:
size - The new buffer size

setDoSummary

public static void setDoSummary(boolean value)
This method will set whether summaries are recorded

Parameters:
value - Boolean

setEnabled

public static void setEnabled(boolean newEnabled)
This method will switch the timing point service on and off


setFileName

public static void setFileName(java.lang.String name)
                        throws java.io.IOException
This method will change the file that the timing point details are logged to If timingpoints are disabled, or writeToFile is false, then the file is not created.

Throws:
java.io.IOException

setPrintStream

public static void setPrintStream(java.io.PrintStream value)
This method sets the utils to output to the given printStream object

Parameters:
value - the output printstream

stringRepresentation

public static java.lang.String stringRepresentation()
This displays a string representation of the setting for timing points in MCA


setWriteToFile

public static void setWriteToFile(boolean val)
This method will set whether to recored the buffer to a file

Parameters:
val - The new write to file value

getHostRecording

public static boolean getHostRecording()
This method will tell if host recording is enabled

Returns:
boolean

getMajorTypeString

public static java.lang.String getMajorTypeString(int majorType)
This method will get the String that corresponds to the given major type

Parameters:
majorType - the major type
Returns:
String

getServletRecording

public static boolean getServletRecording()
This method will tell if servlet recording is enabled

Returns:
boolean

getTransactionHandlerRecording

public static boolean getTransactionHandlerRecording()
This method will tell if transaction handler recording is enabled

Returns:
boolean

getWriteTimingPointsToDisk

public static boolean getWriteTimingPointsToDisk()
This method will get whether the timing points results are written to disk

Returns:
boolean

setServletRecording

public static void setServletRecording(boolean value)
This method set the utils to record timings in the servlet code

Parameters:
value - true(on)/false(off)

setTransactionHandlerRecording

public static void setTransactionHandlerRecording(boolean value)
This method sets the utils to record timings in the transaction handler code

Parameters:
value - true(on)/false(off)

setWriteTimingPointsToDisk

public static void setWriteTimingPointsToDisk(boolean value)
This method will set whether timing points are recored on disk

Parameters:
value - Boolean

setCustomRecording

public static void setCustomRecording(boolean value)
This method set the utils to record timings in the custom code

Parameters:
value - true(on)/false(off)

setHostRecording

public static void setHostRecording(boolean value)
This method set the utils to record timings in the host code

Parameters:
value - true(on)/false(off)

getCustomRecording

public static boolean getCustomRecording()
This method gets the utils to record timings in the custom code



Copyright © 2004 Siebel Systems, Inc. All rights reserved.