edu.wpi.ejutr.ebob_observer
Class EBOBListener

java.lang.Object
  extended by edu.wpi.ejutr.ebob_observer.EBOBListener
All Implemented Interfaces:
edu.wpi.ebob.model.ObjectBenchListener, java.util.EventListener

public class EBOBListener
extends java.lang.Object
implements edu.wpi.ebob.model.ObjectBenchListener

EBOBListener implements the ObjectBenchListener interface, such that it can attach to the object bench and receive notification whenever: 1. An object is added to the Bench. 2. An object is removed from the Bench. 3. A method within an object within the Bench is called. Then it notifies an EBOBActionLogger which actually stores what objects exists and which methods were called when. Implemented as a singleton, so that we can get to the listener from anywhere without it being static or tied to a particular parent object.

Author:
Ben Mohlenhoff - bigben@wpi.edu

Method Summary
 void attach(boolean sendCurrentStatus)
          Attaches this listener to the object bench.
 void detach()
          Detaches this listener from the object bench.
static EBOBListener getInstance()
          Returns a handle to the listener.
 void methodCalled(edu.wpi.ebob.model.MethodInvokeInfo mii)
          Triggers whenever a method is called.
 void objectAdded(edu.wpi.ebob.model.ObjectBenchEvent event)
          Triggers when an object is added to the bench and the listener is active.
 void objectRemoved(edu.wpi.ebob.model.ObjectBenchEvent event)
          Triggers whenever an object is removed from the bench.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EBOBListener getInstance()
Returns a handle to the listener.

Returns:
a handle to the listener.

objectAdded

public void objectAdded(edu.wpi.ebob.model.ObjectBenchEvent event)
Triggers when an object is added to the bench and the listener is active.

Specified by:
objectAdded in interface edu.wpi.ebob.model.ObjectBenchListener

objectRemoved

public void objectRemoved(edu.wpi.ebob.model.ObjectBenchEvent event)
Triggers whenever an object is removed from the bench.

Specified by:
objectRemoved in interface edu.wpi.ebob.model.ObjectBenchListener

methodCalled

public void methodCalled(edu.wpi.ebob.model.MethodInvokeInfo mii)
Triggers whenever a method is called.

Specified by:
methodCalled in interface edu.wpi.ebob.model.ObjectBenchListener

attach

public void attach(boolean sendCurrentStatus)
Attaches this listener to the object bench.

Parameters:
sendCurrentStatus - set this to true if you want to be notified of all objects currently in the bench.

detach

public void detach()
Detaches this listener from the object bench.