edu.wpi.ejutr.logger
Class EBOBActionLogger

java.lang.Object
  extended by edu.wpi.ejutr.logger.EBOBActionLogger

public class EBOBActionLogger
extends java.lang.Object

EBOBActionLogger is the class responsible for logging actions run by the Object Bench. This class will maintain a list of all objects that are interacted with using the bench, and a list of all the methods that were called, what their parameters were, and what order they were called in. Eventually it will be possible to take an instance of this class and feed it to some other object that will dump the contents to a file. Implemented as a singleton. Probably can have it clean out its vector when the plugin gets unloaded.

Author:
Ben Mohlenhoff - bigben@wpi.edu

Method Summary
 void clearLog()
          Empties the action list.
static EBOBActionLogger getInstance()
          Returns a handle to the shared EBOBActionLogger instance.
 java.util.Iterator iterator()
          Returns an iterator through the list of additions/removals/method calls.
 EJUTRLogEntry lastEntry()
          Returns the last element added to the list.
 void logAssertion(java.lang.String lhs, java.lang.String comp, java.lang.String rhs, boolean res)
          Method responsible for logging an assertion.
 void logMethodCall(java.lang.String instanceName, java.lang.String methodName, java.lang.String paramSignature, java.lang.String retType)
          Method responsible for logging method calls.
 void logObjectAddition(java.lang.String objName, java.lang.String instanceName)
          Method responsible for logging the creation of new objects on the bench.
 void logObjectRemoval(java.lang.String objName, java.lang.String instanceName)
          Method responsible for logging the removal of objects from the bench.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EBOBActionLogger getInstance()
Returns a handle to the shared EBOBActionLogger instance. (singleton)

Returns:
handle

logMethodCall

public void logMethodCall(java.lang.String instanceName,
                          java.lang.String methodName,
                          java.lang.String paramSignature,
                          java.lang.String retType)
Method responsible for logging method calls.

Parameters:
instanceName - name of the instance of the calling object
methodname - name of the method that was actually called
retType - return type of the method call

logObjectAddition

public void logObjectAddition(java.lang.String objName,
                              java.lang.String instanceName)
Method responsible for logging the creation of new objects on the bench.

Parameters:
objName - the fully qualified name of the object.
instanceName - the instance name of the object.

logObjectRemoval

public void logObjectRemoval(java.lang.String objName,
                             java.lang.String instanceName)
Method responsible for logging the removal of objects from the bench.

Parameters:
objName -
instanceName -

logAssertion

public void logAssertion(java.lang.String lhs,
                         java.lang.String comp,
                         java.lang.String rhs,
                         boolean res)
Method responsible for logging an assertion.

Parameters:
lhs - left hand side of the boolean comparison
comp - the comparison portion of the assertion
rhs - the right hand side of the boolean comparison
res - the expected result of the assertion.

iterator

public java.util.Iterator iterator()
Returns an iterator through the list of additions/removals/method calls.

Returns:
an iterator for the action list.

clearLog

public void clearLog()
Empties the action list.


lastEntry

public EJUTRLogEntry lastEntry()
Returns the last element added to the list. Does not modify the contents of the log.

Returns:
the last entry made into the log.