atg.service.perfmonitor
Class PerformanceHashtable

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<K,V>
          extended by atg.core.util.WrapperHashtable<java.lang.String,PerformanceData>
              extended by atg.service.perfmonitor.PerformanceHashtable
All Implemented Interfaces:
NameContext, NameContextBindingListener, NameContextElement, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, java.util.Map<java.lang.String,PerformanceData>

public class PerformanceHashtable
extends atg.core.util.WrapperHashtable<java.lang.String,PerformanceData>
implements NameContext, NameContextBindingListener

This class stores the performance objects for operations. Also, it stores the totals for all the parameterized operations stored within the hash.

When endOperation is called, it gets the PerformanceStackData object. Some calculations are performed and then the totals are put into a PerformanceData object which is stored into this hashtable. The totals from this object are also added to the PerformanceData object contained within this object.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
PerformanceHashtable()
          Constructs a PerformanceStack object.
PerformanceHashtable(int initialCapacity)
          Constructs a PerformanceStack object.
PerformanceHashtable(int initialCapacity, float loadFactor)
          Constructs a PerformanceStack object.
 
Method Summary
 PerformanceData get(java.lang.Object pKey)
           
 long getAverageExecutionTime()
           
 double getAverageMemoryRequired()
           
 java.lang.Object getElement(java.lang.String pName)
          Returns the element bound to the specified name.
 long getMaximumExecutionTime()
           
 double getMaximumMemoryRequired()
           
 long getMemTotalNumberOfExecutions()
           
 long getMinimumExecutionTime()
           
 double getMinimumMemoryRequired()
           
 java.lang.String getName()
          Returns property name.
 NameContext getNameContext()
          Returns property nameContext.
 PerformanceData getPerformanceTotals()
          Returns property totals
 long getTotalExecutionTime()
           
 double getTotalMemoryRequired()
           
 long getTotalNumberOfExecutions()
           
 void increaseTotalExecutionTime(long pTime)
          Increases the totalExecutionTime in the global PerformanceData object by the amount in pTime.
 void increaseTotalMemoryRequired(double pMemory)
          Increases the totalMemoryRequired in the global PerformanceData object by the amount in pMemory.
 boolean isElementBound(java.lang.String pName)
          Returns true if the name has an element bound to it, false if not.
 java.util.Enumeration listElementNames()
          Returns the list of element names as an Enumeration
 java.util.Enumeration listElements()
          Returns the list of bound elements as an Enumeration
 void nameContextElementBound(NameContextBindingEvent pEvent)
          This is called to notify this context that it is being bound into a NameContext.
 void nameContextElementUnbound(NameContextBindingEvent pEvent)
          This is called to notify this context that it is being unbound from a NameContext.
 PerformanceData put(java.lang.String key, PerformanceData value)
           
 void putElement(java.lang.String pName, java.lang.Object pElement)
          Binds the specified element to the specified name.
 PerformanceData putIfAbsent(java.lang.String key, PerformanceData value)
          Calls through to our inner concurrent hashmap's put if absent.
 PerformanceData remove(java.lang.String key)
           
 void removeElement(java.lang.String pName)
          Removes the binding for the specified name.
 void reset()
          Resets the properties of all the PerformanceData objects contained within the hashtable.
 void resetMemoryData()
          Resets the memory properties of all the PerformanceData objects contained within the hashtable.
 void setName(java.lang.String pName)
          Sets property name.
 void setNameContext(NameContext pNameContext)
          Sets property nameContext.
 
Methods inherited from class atg.core.util.WrapperHashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, getWrapped, hashCode, isEmpty, keys, keySet, putAll, remove, size, toString, values
 
Methods inherited from class java.util.Hashtable
rehash
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

PerformanceHashtable

public PerformanceHashtable()
Constructs a PerformanceStack object.


PerformanceHashtable

public PerformanceHashtable(int initialCapacity)
Constructs a PerformanceStack object.


PerformanceHashtable

public PerformanceHashtable(int initialCapacity,
                            float loadFactor)
Constructs a PerformanceStack object.

Method Detail

increaseTotalExecutionTime

public void increaseTotalExecutionTime(long pTime)
Increases the totalExecutionTime in the global PerformanceData object by the amount in pTime. Also increments the totalNumberOfExecutions by 1 and updates the minimumExecutionTime and maximumExecutionTime if necessary.

Parameters:
pTime - the amount to increment totalExecutionTime by.

increaseTotalMemoryRequired

public void increaseTotalMemoryRequired(double pMemory)
Increases the totalMemoryRequired in the global PerformanceData object by the amount in pMemory. Also updates the minimumMemoryRequired and maximumMemoryRequired if necessary.

Parameters:
pMemory - the amount to increment totalMemoryRequired by.

reset

public void reset()
Resets the properties of all the PerformanceData objects contained within the hashtable. Also resets the global PerformanceData object.


resetMemoryData

public void resetMemoryData()
Resets the memory properties of all the PerformanceData objects contained within the hashtable. Also resets the memory properties of the global PerformanceData object.


getPerformanceTotals

public PerformanceData getPerformanceTotals()
Returns property totals


setName

public void setName(java.lang.String pName)
Sets property name. The name of this component.


getName

public java.lang.String getName()
Returns property name. The name of this component.

Specified by:
getName in interface NameContextElement

setNameContext

public void setNameContext(NameContext pNameContext)
Sets property nameContext. Our parent NameContext.


getNameContext

public NameContext getNameContext()
Returns property nameContext. Our parent NameContext.

Specified by:
getNameContext in interface NameContextElement

get

public PerformanceData get(java.lang.Object pKey)
Specified by:
get in interface java.util.Map<java.lang.String,PerformanceData>
Overrides:
get in class atg.core.util.WrapperHashtable<java.lang.String,PerformanceData>

put

public PerformanceData put(java.lang.String key,
                           PerformanceData value)
Specified by:
put in interface java.util.Map<java.lang.String,PerformanceData>
Overrides:
put in class atg.core.util.WrapperHashtable<java.lang.String,PerformanceData>

putIfAbsent

public PerformanceData putIfAbsent(java.lang.String key,
                                   PerformanceData value)
Calls through to our inner concurrent hashmap's put if absent.


remove

public PerformanceData remove(java.lang.String key)

getElement

public java.lang.Object getElement(java.lang.String pName)
Description copied from interface: NameContext
Returns the element bound to the specified name.

Specified by:
getElement in interface NameContext

putElement

public void putElement(java.lang.String pName,
                       java.lang.Object pElement)
Description copied from interface: NameContext
Binds the specified element to the specified name.

Specified by:
putElement in interface NameContext

removeElement

public void removeElement(java.lang.String pName)
Description copied from interface: NameContext
Removes the binding for the specified name.

Specified by:
removeElement in interface NameContext

isElementBound

public boolean isElementBound(java.lang.String pName)
Description copied from interface: NameContext
Returns true if the name has an element bound to it, false if not.

Specified by:
isElementBound in interface NameContext

listElementNames

public java.util.Enumeration listElementNames()
Description copied from interface: NameContext
Returns the list of element names as an Enumeration

Specified by:
listElementNames in interface NameContext

listElements

public java.util.Enumeration listElements()
Description copied from interface: NameContext
Returns the list of bound elements as an Enumeration

Specified by:
listElements in interface NameContext

getMinimumExecutionTime

public long getMinimumExecutionTime()

getMaximumExecutionTime

public long getMaximumExecutionTime()

getTotalNumberOfExecutions

public long getTotalNumberOfExecutions()

getTotalExecutionTime

public long getTotalExecutionTime()

getAverageExecutionTime

public long getAverageExecutionTime()

getMemTotalNumberOfExecutions

public long getMemTotalNumberOfExecutions()

getMinimumMemoryRequired

public double getMinimumMemoryRequired()

getMaximumMemoryRequired

public double getMaximumMemoryRequired()

getTotalMemoryRequired

public double getTotalMemoryRequired()

getAverageMemoryRequired

public double getAverageMemoryRequired()

nameContextElementBound

public void nameContextElementBound(NameContextBindingEvent pEvent)
This is called to notify this context that it is being bound into a NameContext.

Specified by:
nameContextElementBound in interface NameContextBindingListener

nameContextElementUnbound

public void nameContextElementUnbound(NameContextBindingEvent pEvent)
This is called to notify this context that it is being unbound from a NameContext.

Specified by:
nameContextElementUnbound in interface NameContextBindingListener