sofya.ed.semantic
Interface EventListener

All Known Subinterfaces:
ChainedEventListener
All Known Implementing Classes:
AutomataController, ConsoleTarget, DefaultEventClassifier, DynamicEscapeDetector, EventClassifier, EventFilter, EventSelectionFilter, HappenBeforeChecker, MultiLocksetRaceDetector, ObjectFilter, RBAutomata, RBAutomataExt52, ThreadFilter, TraceFileTarget

public interface EventListener

Defines event notifications corresponding to observable events occurring in a module being traced.

This interface serves a dual-purpose of hiding dependence on the com.sun.jdi packages, since Sun guidelines state that such packages are not part of the official JDK. Clients of the event dispatcher framework are therefore shielded from having to deal with any changes to the interfaces in those packages. The one notable exception is the handling of mirrored values, for which constructing facades has been decided to add little value and considerable overhead.

Version:
12/16/2005
Author:
Alex Kinneer

Nested Class Summary
static class EventListener.Arguments
          Provides access to the arguments to a method.
static class EventListener.CallData
          Provides information about a method call.
static class EventListener.ExceptionData
          Provides information about an exception event.
static class EventListener.FieldData
          Provides information about a field event.
static class EventListener.MethodData
          Provides information about entry into a method.
static class EventListener.MonitorData
          Provides information about a monitor acquisition or release.
static class EventListener.NewAllocationData
          Provides information about an object which has been allocated by the NEW instruction, but not yet initialized by a constructor.
static class EventListener.ObjectData
          Provides information about an object on which an event occurred.
static class EventListener.ThreadData
          Provides information about the thread on which an observable event has occurred.
static class EventListener.ThreadStatus
          Type-safe enumeration for indicating the status of a thread on which an observable event has occurred.
 
Method Summary
 void callReturnEvent(EventListener.ThreadData td, EventListener.CallData cd, boolean exceptional)
          Notification that a thread has returned from a method call.
 void classPrepareEvent(EventListener.ThreadData td, java.lang.String className)
          Notification that a class was prepared (this is, loaded by the classloader).
 void constructorCallEvent(EventListener.ThreadData td, EventListener.CallData cd)
          Notification that a constructor was invoked.
 void constructorEnterEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MethodData md)
          Notification that a constructor was entered.
 void constructorExitEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MethodData md)
          Notification that a constructor was exited.
 void exceptionCatchEvent(EventListener.ThreadData td, EventListener.ExceptionData ed)
          Notification that an exception was caught.
 void exceptionThrowEvent(EventListener.ThreadData td, EventListener.ExceptionData ed)
          Notification that an exception was thrown.
 void executionStarted()
          Notification that the system has begun executing user code.
 void instanceFieldAccessEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.FieldData fd)
          Notification that an instance field was read.
 void instanceFieldWriteEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.FieldData fd)
          Notification that an instance field was written.
 void interfaceCallEvent(EventListener.ThreadData td, EventListener.CallData cd)
          Notification that an interface method was called.
 void monitorAcquireEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MonitorData md)
          Notification that a thread has acquired a monitor.
 void monitorContendEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MonitorData md)
          Notification that a thread is contending for a monitor.
 void monitorPreReleaseEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MonitorData md)
          Notification that a thread is about to release a monitor.
 void monitorReleaseEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MonitorData md)
          Notification that a thread has released a monitor.
 void newAllocationEvent(EventListener.ThreadData td, EventListener.NewAllocationData nad)
          Notification that an object was allocated by a NEW instruction.
 void staticCallEvent(EventListener.ThreadData td, EventListener.CallData cd)
          Notification that a static method was called.
 void staticFieldAccessEvent(EventListener.ThreadData td, EventListener.FieldData fd)
          Notification that a static field was read.
 void staticFieldWriteEvent(EventListener.ThreadData td, EventListener.FieldData fd)
          Notification that a static field was written.
 void staticInitializerEnterEvent(EventListener.ThreadData td, EventListener.MethodData md)
          Notification that a static initializer was entered.
 void staticMethodEnterEvent(EventListener.ThreadData td, EventListener.MethodData md)
          Notification that a static method was entered.
 void staticMethodExitEvent(EventListener.ThreadData td, EventListener.MethodData md)
          Notification that a static method was exited.
 void systemExited()
          Notification that the system has terminated.
 void systemStarted()
          Notification that the target virtual machine has been launched.
 void threadDeathEvent(EventListener.ThreadData td)
          Notification that a thread has terminated.
 void threadStartEvent(EventListener.ThreadData td)
          Notification that a thread has started.
 void virtualCallEvent(EventListener.ThreadData td, EventListener.CallData cd)
          Notification that a virtual method was called.
 void virtualMethodEnterEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MethodData md)
          Notification that a virtual method was entered.
 void virtualMethodExitEvent(EventListener.ThreadData td, EventListener.ObjectData od, EventListener.MethodData md)
          Notification that a virtual method was exited.
 

Method Detail

systemStarted

void systemStarted()
Notification that the target virtual machine has been launched.


executionStarted

void executionStarted()
Notification that the system has begun executing user code.

This event will be preceded by thread start events.


threadStartEvent

void threadStartEvent(EventListener.ThreadData td)
Notification that a thread has started. These events are not dependent on the module description.

Parameters:
td - Information about the newly started thread.

threadDeathEvent

void threadDeathEvent(EventListener.ThreadData td)
Notification that a thread has terminated. These events are not dependent on the module description.

Parameters:
td - Information about the terminated thread.

classPrepareEvent

void classPrepareEvent(EventListener.ThreadData td,
                       java.lang.String className)
Notification that a class was prepared (this is, loaded by the classloader). These events are not dependent on the module description.

Parameters:
td - Information about the thread which caused the class to be prepared.
className - Name of the class which was prepared.

monitorContendEvent

void monitorContendEvent(EventListener.ThreadData td,
                         EventListener.ObjectData od,
                         EventListener.MonitorData md)
Notification that a thread is contending for a monitor.

Parameters:
td - Information about the thread which is contending for a monitor.
od - Information about the object which owns the monitor.
md - Information about the location of the monitor contention.

monitorAcquireEvent

void monitorAcquireEvent(EventListener.ThreadData td,
                         EventListener.ObjectData od,
                         EventListener.MonitorData md)
Notification that a thread has acquired a monitor.

Parameters:
td - Information about the thread which acquired a monitor.
od - Information about the object which owns the monitor.
md - Information about the location of the monitor acquisition.

monitorPreReleaseEvent

void monitorPreReleaseEvent(EventListener.ThreadData td,
                            EventListener.ObjectData od,
                            EventListener.MonitorData md)
Notification that a thread is about to release a monitor.

Parameters:
td - Information about the thread which is about to release a monitor.
od - Information about the object which owns the monitor.
md - Information about the location of the monitor about to be released event..

monitorReleaseEvent

void monitorReleaseEvent(EventListener.ThreadData td,
                         EventListener.ObjectData od,
                         EventListener.MonitorData md)
Notification that a thread has released a monitor.

Parameters:
td - Information about the thread which released a monitor.
od - Information about the object which owns the monitor.
md - Information about the location of the monitor release.

newAllocationEvent

void newAllocationEvent(EventListener.ThreadData td,
                        EventListener.NewAllocationData nad)
Notification that an object was allocated by a NEW instruction.

This event cannot yet associate a unique identifier with the object, because this event only represents the allocation of a reference to which an object of a given class may be assigned. In other words, no actual object has yet been created. A unique ID can be obtained once a constructor is executed, which is signaled by the constructorEnterEvent(sofya.ed.semantic.EventListener.ThreadData, sofya.ed.semantic.EventListener.ObjectData, sofya.ed.semantic.EventListener.MethodData).

Parameters:
td - Information about the thread which allocated the object.
nad - Information about the new allocation.

constructorCallEvent

void constructorCallEvent(EventListener.ThreadData td,
                          EventListener.CallData cd)
Notification that a constructor was invoked.

Parameters:
td - Information about the thread which invoked the constructor.
cd - Information about the particular constructor which was invoked.

constructorEnterEvent

void constructorEnterEvent(EventListener.ThreadData td,
                           EventListener.ObjectData od,
                           EventListener.MethodData md)
Notification that a constructor was entered.

This is the first point during the object creation process at which the object can be uniquely identified.

Parameters:
td - Information about the thread executing the constructor.
od - Information about the object under construction. At the time of this event, only the object ID will be valid.
md - Information about the entered constructor.

constructorExitEvent

void constructorExitEvent(EventListener.ThreadData td,
                          EventListener.ObjectData od,
                          EventListener.MethodData md)
Notification that a constructor was exited.

NOTE: This event is raised only if the constructor completes normally. If a constructor throws an escaping exception, the object is not successfully created and thus further events related to the object are not possible.

Parameters:
td - Information about the thread executing the constructor.
od - Information about the object under construction. At the time of this event, only the object ID will be valid.
md - Information about the exited constructor.

staticFieldAccessEvent

void staticFieldAccessEvent(EventListener.ThreadData td,
                            EventListener.FieldData fd)
Notification that a static field was read.

Parameters:
td - Information about the thread in which the field access occurred.
fd - Information about the accessed field.

instanceFieldAccessEvent

void instanceFieldAccessEvent(EventListener.ThreadData td,
                              EventListener.ObjectData od,
                              EventListener.FieldData fd)
Notification that an instance field was read.

Parameters:
td - Information about the thread in which the field access occurred.
od - Information about the object which owns the accessed field.
fd - Information about the accessed field.

staticFieldWriteEvent

void staticFieldWriteEvent(EventListener.ThreadData td,
                           EventListener.FieldData fd)
Notification that a static field was written.

Parameters:
td - Information about the thread in which the field write occurred.
fd - Information about the written field.

instanceFieldWriteEvent

void instanceFieldWriteEvent(EventListener.ThreadData td,
                             EventListener.ObjectData od,
                             EventListener.FieldData fd)
Notification that an instance field was written.

Parameters:
td - Information about the thread in which the field write occurred.
od - Information about the object which owns the written field.
fd - Information about the written field.

staticCallEvent

void staticCallEvent(EventListener.ThreadData td,
                     EventListener.CallData cd)
Notification that a static method was called.

Parameters:
td - Information about the thread which called the method.
cd - Information about the called method.

virtualCallEvent

void virtualCallEvent(EventListener.ThreadData td,
                      EventListener.CallData cd)
Notification that a virtual method was called.

Parameters:
td - Information about the thread which called the method.
cd - Information about the called method.

interfaceCallEvent

void interfaceCallEvent(EventListener.ThreadData td,
                        EventListener.CallData cd)
Notification that an interface method was called.

Parameters:
td - Information about the thread which called the method.
cd - Information about the called method.

callReturnEvent

void callReturnEvent(EventListener.ThreadData td,
                     EventListener.CallData cd,
                     boolean exceptional)
Notification that a thread has returned from a method call.

Parameters:
td - Information about the thread in which the method call returned.
cd - Information about the called method from which control returned.
exceptional - Flag indicating whether the method returned exceptionally.

virtualMethodEnterEvent

void virtualMethodEnterEvent(EventListener.ThreadData td,
                             EventListener.ObjectData od,
                             EventListener.MethodData md)
Notification that a virtual method was entered.

Parameters:
td - Information about the thread executing the method.
od - Information about the object on which the virtual method was called.
md - Information about the entered method.

virtualMethodExitEvent

void virtualMethodExitEvent(EventListener.ThreadData td,
                            EventListener.ObjectData od,
                            EventListener.MethodData md)
Notification that a virtual method was exited.

Parameters:
td - Information about the thread executing the method.
od - Information about the object on which the virtual method was called.
md - Information about the exited method.

staticMethodEnterEvent

void staticMethodEnterEvent(EventListener.ThreadData td,
                            EventListener.MethodData md)
Notification that a static method was entered.

Parameters:
td - Information about the thread executing the method.
md - Information about the entered method.

staticMethodExitEvent

void staticMethodExitEvent(EventListener.ThreadData td,
                           EventListener.MethodData md)
Notification that a static method was exited.

Parameters:
td - Information about the thread executing the method.
md - Information about the exited method.

exceptionThrowEvent

void exceptionThrowEvent(EventListener.ThreadData td,
                         EventListener.ExceptionData ed)
Notification that an exception was thrown.

Parameters:
td - Information about the thread in which the exception was thrown.
ed - Information about the thrown exception.

exceptionCatchEvent

void exceptionCatchEvent(EventListener.ThreadData td,
                         EventListener.ExceptionData ed)
Notification that an exception was caught.

Parameters:
td - Information about the thread in which the exception was caught.
ed - Information about the caught exception.

staticInitializerEnterEvent

void staticInitializerEnterEvent(EventListener.ThreadData td,
                                 EventListener.MethodData md)
Notification that a static initializer was entered.

Parameters:
td - Information about the thread executing the static initializer.
md - Information about the entered static initializer.

systemExited

void systemExited()
Notification that the system has terminated.