com.waveset.util
Class CallTree

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.util.CallTree
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject

public class CallTree
extends AbstractXmlObject

A network of methods that call each other.

Supports serialization as XML so we can dump it to a file.


Field Summary
static java.lang.String code_id
           
static java.lang.String ELEMENT
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
CallTree(org.w3c.dom.Element e)
          Create a call tree object by parsing its XML representation.
 
Method Summary
 java.lang.String getElementName()
          Return the element name.
static CallStatistics[] getStatistics()
           
static CallStatistics getStatistics(java.lang.String methodName)
           
static CallStatistics getStatistics(java.lang.String methodName, java.lang.String caller)
           
static java.util.List listCalledBy(java.lang.String methodName)
           
static java.util.List listCallersOf(java.lang.String methodName)
           
static java.util.List listMethodNames()
           
static void recordCall(java.lang.String caller, java.lang.String callee)
           
static void recordReturn(java.lang.String caller, java.lang.String callee, long elapsedTime, boolean isError)
           
 void toXml(java.lang.StringBuffer b, int indent)
          Serialize the call tree to an XML string buffer.
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

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

ELEMENT

public static final java.lang.String ELEMENT
See Also:
Constant Field Values
Constructor Detail

CallTree

public CallTree(org.w3c.dom.Element e)
         throws WavesetException
Create a call tree object by parsing its XML representation.

Method Detail

recordCall

public static void recordCall(java.lang.String caller,
                              java.lang.String callee)

recordReturn

public static void recordReturn(java.lang.String caller,
                                java.lang.String callee,
                                long elapsedTime,
                                boolean isError)

getStatistics

public static CallStatistics[] getStatistics()
Returns:
aggregatestatistics for all methods.

getStatistics

public static CallStatistics getStatistics(java.lang.String methodName)
Returns:
aggregate statistics for the specified method.

Aggregate statistics are summary timings for a method, not broken down caller.


getStatistics

public static CallStatistics getStatistics(java.lang.String methodName,
                                           java.lang.String caller)
Returns:
caller-specific call statistics for the specified method in the context of the specified caller.

Caller-specific statistics are timings of a specified method when called by the specified caller.


listCallersOf

public static java.util.List listCallersOf(java.lang.String methodName)
Returns:
a list of methods that call the specified method. Each item in the List is a String.

listCalledBy

public static java.util.List listCalledBy(java.lang.String methodName)
Returns:
a list of methods that the specified method calls. Each item in the List is a String.

listMethodNames

public static java.util.List listMethodNames()
Returns:
a list of methods that the specified method calls. Each item in the List is a String.

getElementName

public java.lang.String getElementName()
Description copied from class: AbstractXmlObject
Return the element name.

Specified by:
getElementName in interface XmlObject
Specified by:
getElementName in class AbstractXmlObject

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Serialize the call tree to an XML string buffer.

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject