com.tivoli.twg.libs
Interface GenericWaiter

All Known Implementing Classes:
TWGDefaultTask

public interface GenericWaiter

Interface implemented by classes that need the ability to wait for a testable event to occur or state to be reached without incurring the expense of another thread to poll for the event/state. When it is time to wait for an event, the implementer of this interface calls GenericPoller.wait() specifying the interval and number of retries. At each interval, isDone() is called. The implementer tests for event completion during that call. If isDone() returns true, then done(true) is called. If isDone() returns false, and the specified number of retries have occurred, then done(false) is called. In either case, the GenericWaiter is removed from the GenericPoller's list.


Method Summary
 void done(boolean complete)
          Method called by GenericPoller once the event has occurred or the number of retries specified for this GenericWaiter have been attempted.
 boolean isDone()
          Method called by GenericPoller to test if the event that this GenericWaiter is waiting for has occurred.
 

Method Detail

isDone

public boolean isDone()
Method called by GenericPoller to test if the event that this GenericWaiter is waiting for has occurred.

Returns:
true if the event has occurred.

done

public void done(boolean complete)
Method called by GenericPoller once the event has occurred or the number of retries specified for this GenericWaiter have been attempted. Once this method is called, this GenericWaiter is removed from the GenericPoller's list.

Parameters:
complete - true if the event has occurred (i.e. true was returned from an isDone() call), false if the the specified number of retries have been attempted without getting isDone=true