org.jikesrvm.adaptive.measurements.listeners
Class Listener

java.lang.Object
  extended by org.jikesrvm.adaptive.measurements.listeners.Listener
Direct Known Subclasses:
ContextListener, MethodListener, NullListener

public abstract class Listener
extends Object

A Listener object is invoked when online measurement information needs to be collected.

This class does not define the update() method, the call back method from the runtime when a sample should be taken. The expectation is that immediately derived classes define an interface to the update() method from which classes may be further derived.

CONSTRAINTS: Classes that are derived from Listener must be annotated as Uninterruptible to ensure that they are not interrupted by a thread switch. Since thread switching is disabled, listeners are expected to complete execution quickly, and therefore, must do a minimal amount of work.


Field Summary
private  boolean active
          Is the listener active or passive?
private  Organizer organizer
          the associated organizer
 
Constructor Summary
Listener()
           
 
Method Summary
 void activate()
          Transition listener to active state
 void activateOrganizer()
          Wake up the organizer thread (if any) associated with the listener
 boolean isActive()
          Is the listener currently active (interested in getting "update" calls)
 void passivate()
          Transition listener to passive state
abstract  void report()
          Entry point to dump what has been collected.
abstract  void reset()
          Reset the listeners data structures in preparation of a new sampling window.
 void setOrganizer(Organizer organizer)
          Organizer associated with this listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

active

private boolean active
Is the listener active or passive?


organizer

private Organizer organizer
the associated organizer

Constructor Detail

Listener

public Listener()
Method Detail

report

public abstract void report()
Entry point to dump what has been collected.


isActive

public final boolean isActive()
Is the listener currently active (interested in getting "update" calls)


activate

public final void activate()
Transition listener to active state


passivate

public final void passivate()
Transition listener to passive state


reset

public abstract void reset()
Reset the listeners data structures in preparation of a new sampling window. This is called by the organizer after processing the samples from the old sampling window.


setOrganizer

public final void setOrganizer(Organizer organizer)
Organizer associated with this listener.


activateOrganizer

public final void activateOrganizer()
Wake up the organizer thread (if any) associated with the listener