public class TestComponentListener extends java.lang.Object implements IVizUpdateableListener
This class realizes the IComponentListener interface and is used to test Component call backs in tests. It has a unlisted, volatile attribute called serviceLatch that is a CountDownLatch. It is instantiated in reset and constructor. This is used to utilize threads more effectively by waiting for a thread to be free in order to notify if a component was changed. The update operation calls countDown on the latch.
component
Constructor and Description |
---|
TestComponentListener()
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
reset()
This operation resets the countdownlatch to 0.
|
void |
update(IVizUpdateable component)
This operation notifies the listener that an update has occurred in the
Component.
|
boolean |
wasNotified()
This operation returns the notification state of the listener.
|
public TestComponentListener()
The Constructor. Sets up the CountDownLatch to one.
public boolean wasNotified()
This operation returns the notification state of the listener.
True if the listener has been notified of an update, false otherwise.
public void reset()
This operation resets the countdownlatch to 0.
public void update(IVizUpdateable component)
IVizUpdateableListener
This operation notifies the listener that an update has occurred in the Component.
update
in interface IVizUpdateableListener
component
- The component that was updated in some way.