edu.mit.ai.psg.traveler
Class CallRecordDefault

java.lang.Object
  |
  +--edu.mit.ai.psg.traveler.ActivityRecordBase
        |
        +--edu.mit.ai.psg.traveler.SynchronizationRecordDefault
              |
              +--edu.mit.ai.psg.traveler.CallRecordDefault
Direct Known Subclasses:
CallRecordObservable

public class CallRecordDefault
extends SynchronizationRecordDefault
implements CallRecord

Default CallRecord used by TraceRecorderDefault.invoking(java.lang.Object, java.lang.reflect.Member, java.lang.Object[]). If recording a synchronized method and target of call is cloneable, creates a clone of the target then to record its state at the time of the call. (Method arguments are not cloned, since they may be remote, and/or may change state by the time their methods are invoked.)

See Also:
TraceRecorderDefault.invoking(java.lang.Object, java.lang.reflect.Member, java.lang.Object[])

Inner classes inherited from class edu.mit.ai.psg.traveler.SynchronizationRecordDefault
SynchronizationRecordDefault.Entry, SynchronizationRecordDefault.Exit
 
Inner classes inherited from class edu.mit.ai.psg.traveler.SynchronizationRecord
SynchronizationRecord.Entry, SynchronizationRecord.Exit
 
Field Summary
protected static Object INCOMPLETE
           
protected  Object[] myParameters
           
protected  Object result
           
protected  Object resultState
           
protected static Object RETURNED_VALUE
           
protected static Object RETURNED_VOID
           
protected static Object THREW_EXCEPTION
           
protected static Vector waitMethods
          Object.wait methods that affect synchronization and therefore should be considered synchronization activities
 
Fields inherited from class edu.mit.ai.psg.traveler.SynchronizationRecordDefault
myMember, myTargetNow, myTargetThen
 
Fields inherited from class edu.mit.ai.psg.traveler.ActivityRecordBase
parent
 
Constructor Summary
CallRecordDefault(Object target, Member member, Object[] parameters)
           
 
Method Summary
 Object[] getParameters()
          actual parameter values (not cloned)
 Object getResult()
          value returned, exception thrown, or null
 String invocationString()
          string describing invocation target.method(arguments...)
 boolean isComplete()
          true if call record has been completed
 boolean isCompleteByReturn()
          true if call completed by returning
 boolean isCompleteByReturnVoid()
          true if call completed by returning void
 boolean isCompleteByThrow()
          true if call completed by throwing an exception
 boolean isSynchronized()
          true if member is synchronized method (or isSynchronizedWait)
 boolean isSynchronizedWait()
          true if method is one of the Object.wait methods
 void recordReturned(Object value)
          Record that call completed by returning value
 void recordReturnedVoid()
          Record that call completed by returning void
 void recordThrew(Throwable thrown)
          Record that call completed by throwing thrown
 String resultString()
          string describing result: no recorded result, returned void, returned value, or threw exception
 String toString()
          returns "(synchronized(target) in member)"
 
Methods inherited from class edu.mit.ai.psg.traveler.SynchronizationRecordDefault
addSynchronizationChild, addSynchronizationEntry, addSynchronizationExit, finished, getMember, getSynchronizationChildren, getSynchronizationEntry, getSynchronizationExit, getSynchronizationParent, getTargetNow, getTargetThen, makeSynchronizationEntryRecord, makeSynchronizationExitRecord, setSynchronizationParent
 
Methods inherited from class edu.mit.ai.psg.traveler.ActivityRecordBase
addChild, addThreadedChild, cloneObject, ensureListValue, getChildren, getChildrenInThread, getParent, getProperty, getThreadedChildren, isFinished, putProperty, removeProperty, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myParameters

protected Object[] myParameters

INCOMPLETE

protected static final Object INCOMPLETE

THREW_EXCEPTION

protected static final Object THREW_EXCEPTION

RETURNED_VOID

protected static final Object RETURNED_VOID

RETURNED_VALUE

protected static final Object RETURNED_VALUE

resultState

protected Object resultState

result

protected Object result

waitMethods

protected static Vector waitMethods
Object.wait methods that affect synchronization and therefore should be considered synchronization activities
Constructor Detail

CallRecordDefault

public CallRecordDefault(Object target,
                         Member member,
                         Object[] parameters)
Parameters:
target - Object receiving call (If static method, declaring class will be substituted so it may be null. If constructor, declaring class is substituted only if null).
member - Method or Constructor
parameters - actual parameter values
Method Detail

getParameters

public Object[] getParameters()
Description copied from interface: CallRecord
actual parameter values (not cloned)
Specified by:
getParameters in interface CallRecord

isComplete

public boolean isComplete()
Description copied from interface: CallRecord
true if call record has been completed
Specified by:
isComplete in interface CallRecord

isCompleteByThrow

public boolean isCompleteByThrow()
Description copied from interface: CallRecord
true if call completed by throwing an exception
Specified by:
isCompleteByThrow in interface CallRecord

isCompleteByReturn

public boolean isCompleteByReturn()
Description copied from interface: CallRecord
true if call completed by returning
Specified by:
isCompleteByReturn in interface CallRecord

isCompleteByReturnVoid

public boolean isCompleteByReturnVoid()
Description copied from interface: CallRecord
true if call completed by returning void
Specified by:
isCompleteByReturnVoid in interface CallRecord

getResult

public Object getResult()
Description copied from interface: CallRecord
value returned, exception thrown, or null
Specified by:
getResult in interface CallRecord

recordReturnedVoid

public void recordReturnedVoid()
Description copied from interface: CallRecord
Record that call completed by returning void
Specified by:
recordReturnedVoid in interface CallRecord

recordReturned

public void recordReturned(Object value)
Description copied from interface: CallRecord
Record that call completed by returning value
Specified by:
recordReturned in interface CallRecord

recordThrew

public void recordThrew(Throwable thrown)
Description copied from interface: CallRecord
Record that call completed by throwing thrown
Specified by:
recordThrew in interface CallRecord

isSynchronized

public boolean isSynchronized()
true if member is synchronized method (or isSynchronizedWait)
Overrides:
isSynchronized in class SynchronizationRecordDefault

isSynchronizedWait

public boolean isSynchronizedWait()
true if method is one of the Object.wait methods
Overrides:
isSynchronizedWait in class SynchronizationRecordDefault
Tags copied from interface: SynchronizationRecord
See Also:
Object.wait()

toString

public String toString()
Description copied from class: SynchronizationRecordDefault
returns "(synchronized(target) in member)"
Overrides:
toString in class SynchronizationRecordDefault

invocationString

public String invocationString()
Description copied from interface: CallRecord
string describing invocation target.method(arguments...)
Specified by:
invocationString in interface CallRecord

resultString

public String resultString()
Description copied from interface: CallRecord
string describing result: no recorded result, returned void, returned value, or threw exception
Specified by:
resultString in interface CallRecord

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu