|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsofya.ed.semantic.EventFilter
sofya.ed.semantic.EventSelectionFilter
sofya.ed.semantic.ThreadFilter
public class ThreadFilter
Observable event filter which directs events to separate listeners for each thread in the monitored system. Events which are not specific to individual threads are discarded.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface sofya.ed.semantic.EventListener |
|---|
EventListener.Arguments, EventListener.CallData, EventListener.ExceptionData, EventListener.FieldData, EventListener.MethodData, EventListener.MonitorData, EventListener.NewAllocationData, EventListener.ObjectData, EventListener.ThreadData, EventListener.ThreadStatus |
| Field Summary | |
|---|---|
protected ChainedEventListenerFactory |
listenerFactory
Factory used to generate a new listener for the event stream associated with each thread that gets created in the observed system. |
| Fields inherited from class sofya.ed.semantic.EventFilter |
|---|
listenerCount, listeners |
| Constructor Summary | |
|---|---|
protected |
ThreadFilter()
|
|
ThreadFilter(ChainedEventListenerFactory celf)
Creates a new thread filter. |
| 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. |
java.lang.Exception |
getError()
Gets the exception that put the filter in an error state. |
static ChainedEventListenerFactory |
getFactory(ChainedEventListenerFactory celf)
Gets a factory for producing instances of this class on demand. |
ChainedEventListener |
getParent()
Gets the parent of this listener in the listener chain. |
long |
getStreamID()
Gets the unique identifier associated with this event stream. |
java.lang.String |
getStreamName()
Gets an informational name associated with this event stream. |
java.util.Map |
getTraceErrors()
Returns any exceptions that were raised by listeners associated with individual threads. |
boolean |
inError()
Reports whether the filter is in an error state. |
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 |
rethrowError()
Rethrows the originating exception if this filter is in an error state; does nothing if in a normal state. |
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 |
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. |
| Methods inherited from class sofya.ed.semantic.EventSelectionFilter |
|---|
executionStarted, systemStarted |
| Methods inherited from class sofya.ed.semantic.EventFilter |
|---|
addEventListener, ensureCapacity, removeEventListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface sofya.ed.semantic.EventListener |
|---|
executionStarted, systemStarted |
| Field Detail |
|---|
protected ChainedEventListenerFactory listenerFactory
| Constructor Detail |
|---|
protected ThreadFilter()
public ThreadFilter(ChainedEventListenerFactory celf)
celf - Listener factory used to create the listeners associated
with observed threads.| Method Detail |
|---|
public static ChainedEventListenerFactory getFactory(ChainedEventListenerFactory celf)
celf - Factory which the produced filters will use to generate
listeners for their own filter streams.
public ChainedEventListener getParent()
ChainedEventListener
getParent in interface ChainedEventListenerpublic long getStreamID()
ChainedEventListener
getStreamID in interface ChainedEventListenerpublic java.lang.String getStreamName()
ChainedEventListener
getStreamName in interface ChainedEventListenerpublic boolean inError()
Note that errors raised while attempting to write to
individual filter streams for each thread will be stored for each
such thread if the listener associated with that thread
implements the ErrorRecorder interface. Those errors
can be retrieved via getTraceErrors(). This method
only reports whether the filter failed to instantiate a
listener for a given thread.
inError in interface ErrorRecordertrue if an error has occurred while trying
to create a listener.
public void rethrowError()
throws java.lang.Exception
rethrowError in interface ErrorRecorderjava.lang.Exception - If an error has been raised while trying to
create a listener for a thread event stream.public java.lang.Exception getError()
getError in interface ErrorRecorderpublic java.util.Map getTraceErrors()
ErrorRecorder
interface. Thus under ideal circumstances, if all attached listeners
support error recording, the size of the returned map should be zero.public void threadStartEvent(EventListener.ThreadData td)
EventListener
threadStartEvent in interface EventListenerthreadStartEvent in class EventSelectionFiltertd - Information about the newly started thread.public void threadDeathEvent(EventListener.ThreadData td)
EventListener
threadDeathEvent in interface EventListenerthreadDeathEvent in class EventSelectionFiltertd - Information about the terminated thread.
public void classPrepareEvent(EventListener.ThreadData td,
java.lang.String className)
EventListener
classPrepareEvent in interface EventListenerclassPrepareEvent in class EventSelectionFiltertd - Information about the thread which caused the class to
be prepared.className - Name of the class which was prepared.
public void monitorContendEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MonitorData md)
EventListener
monitorContendEvent in interface EventListenermonitorContendEvent in class EventSelectionFiltertd - 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.
public void monitorAcquireEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MonitorData md)
EventListener
monitorAcquireEvent in interface EventListenermonitorAcquireEvent in class EventSelectionFiltertd - 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.
public void monitorPreReleaseEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MonitorData md)
EventListener
monitorPreReleaseEvent in interface EventListenermonitorPreReleaseEvent in class EventSelectionFiltertd - 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..
public void monitorReleaseEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MonitorData md)
EventListener
monitorReleaseEvent in interface EventListenermonitorReleaseEvent in class EventSelectionFiltertd - 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.
public void newAllocationEvent(EventListener.ThreadData td,
EventListener.NewAllocationData nad)
EventListenerNEW
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 EventListener.constructorEnterEvent(sofya.ed.semantic.EventListener.ThreadData, sofya.ed.semantic.EventListener.ObjectData, sofya.ed.semantic.EventListener.MethodData).
newAllocationEvent in interface EventListenernewAllocationEvent in class EventSelectionFiltertd - Information about the thread which allocated the object.nad - Information about the new allocation.
public void constructorCallEvent(EventListener.ThreadData td,
EventListener.CallData cd)
EventListener
constructorCallEvent in interface EventListenerconstructorCallEvent in class EventSelectionFiltertd - Information about the thread which invoked the constructor.cd - Information about the particular constructor which
was invoked.
public void constructorEnterEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MethodData md)
EventListenerThis is the first point during the object creation process at which the object can be uniquely identified.
constructorEnterEvent in interface EventListenerconstructorEnterEvent in class EventSelectionFiltertd - 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.
public void constructorExitEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MethodData md)
EventListenerNOTE: 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.
constructorExitEvent in interface EventListenerconstructorExitEvent in class EventSelectionFiltertd - 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.
public void staticFieldAccessEvent(EventListener.ThreadData td,
EventListener.FieldData fd)
EventListener
staticFieldAccessEvent in interface EventListenerstaticFieldAccessEvent in class EventSelectionFiltertd - Information about the thread in which the field access
occurred.fd - Information about the accessed field.
public void instanceFieldAccessEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.FieldData fd)
EventListener
instanceFieldAccessEvent in interface EventListenerinstanceFieldAccessEvent in class EventSelectionFiltertd - 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.
public void staticFieldWriteEvent(EventListener.ThreadData td,
EventListener.FieldData fd)
EventListener
staticFieldWriteEvent in interface EventListenerstaticFieldWriteEvent in class EventSelectionFiltertd - Information about the thread in which the field write
occurred.fd - Information about the written field.
public void instanceFieldWriteEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.FieldData fd)
EventListener
instanceFieldWriteEvent in interface EventListenerinstanceFieldWriteEvent in class EventSelectionFiltertd - 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.
public void staticCallEvent(EventListener.ThreadData td,
EventListener.CallData cd)
EventListener
staticCallEvent in interface EventListenerstaticCallEvent in class EventSelectionFiltertd - Information about the thread which called the method.cd - Information about the called method.
public void virtualCallEvent(EventListener.ThreadData td,
EventListener.CallData cd)
EventListener
virtualCallEvent in interface EventListenervirtualCallEvent in class EventSelectionFiltertd - Information about the thread which called the method.cd - Information about the called method.
public void interfaceCallEvent(EventListener.ThreadData td,
EventListener.CallData cd)
EventListener
interfaceCallEvent in interface EventListenerinterfaceCallEvent in class EventSelectionFiltertd - Information about the thread which called the method.cd - Information about the called method.
public void callReturnEvent(EventListener.ThreadData td,
EventListener.CallData cd,
boolean exceptional)
EventListener
callReturnEvent in interface EventListenercallReturnEvent in class EventSelectionFiltertd - 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.
public void virtualMethodEnterEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MethodData md)
EventListener
virtualMethodEnterEvent in interface EventListenervirtualMethodEnterEvent in class EventSelectionFiltertd - 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.
public void virtualMethodExitEvent(EventListener.ThreadData td,
EventListener.ObjectData od,
EventListener.MethodData md)
EventListener
virtualMethodExitEvent in interface EventListenervirtualMethodExitEvent in class EventSelectionFiltertd - 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.
public void staticMethodEnterEvent(EventListener.ThreadData td,
EventListener.MethodData md)
EventListener
staticMethodEnterEvent in interface EventListenerstaticMethodEnterEvent in class EventSelectionFiltertd - Information about the thread executing the method.md - Information about the entered method.
public void staticMethodExitEvent(EventListener.ThreadData td,
EventListener.MethodData md)
EventListener
staticMethodExitEvent in interface EventListenerstaticMethodExitEvent in class EventSelectionFiltertd - Information about the thread executing the method.md - Information about the exited method.
public void exceptionThrowEvent(EventListener.ThreadData td,
EventListener.ExceptionData ed)
EventListener
exceptionThrowEvent in interface EventListenerexceptionThrowEvent in class EventSelectionFiltertd - Information about the thread in which the exception was
thrown.ed - Information about the thrown exception.
public void exceptionCatchEvent(EventListener.ThreadData td,
EventListener.ExceptionData ed)
EventListener
exceptionCatchEvent in interface EventListenerexceptionCatchEvent in class EventSelectionFiltertd - Information about the thread in which the exception was
caught.ed - Information about the caught exception.
public void staticInitializerEnterEvent(EventListener.ThreadData td,
EventListener.MethodData md)
EventListener
staticInitializerEnterEvent in interface EventListenerstaticInitializerEnterEvent in class EventSelectionFiltertd - Information about the thread executing the static initializer.md - Information about the entered static initializer.public void systemExited()
EventListener
systemExited in interface EventListenersystemExited in class EventSelectionFilter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||