version 1.0

com.actimind.actiwate.testing.events
Interface AsyncEvents


public interface AsyncEvents

Container for sheduled AsyncEvent's.
NOTE: this container is live, sheduled events will be added to this container and executed events will be removed from container.


Method Summary
 int executeAllUntilEmpty()
          Executes all events in this container.
 int executeByTimeOffset(long offsetMillis)
          Executes all events having time offset less or equal to offsetMillis.
 boolean executeNextEvent()
          Executes event with least time offset.
 int executeTillLatestEventOffset()
          Executes all events in this container.
 java.util.Iterator getEvents()
          Returns iterator of AsyncEvents of this container.
 int size()
          Returns number of events in this container.
 

Method Detail

getEvents

public java.util.Iterator getEvents()
Returns iterator of AsyncEvents of this container.

Returns:
iterator of AsyncEvents of this container.

executeTillLatestEventOffset

public int executeTillLatestEventOffset()
Executes all events in this container.
NOTE: If execution of some event will lead to sheduling of a new event, new sheduled event will be executed if it's time offset is less or equal to time offset of latest event on the moment of this method call, otherwise new sheduled event will be added to container but not executed.

Returns:
number of executed events.

executeAllUntilEmpty

public int executeAllUntilEmpty()
Executes all events in this container.
NOTE: If execution of some event will lead to sheduling of a new event, new sheduled event will be executed as well.

Returns:
number of executed events.

executeByTimeOffset

public int executeByTimeOffset(long offsetMillis)
Executes all events having time offset less or equal to offsetMillis. All other event's time offsets are reduced by offsetMillis.

Parameters:
offsetMillis - offset for events execution.
Returns:
number of executed events.

executeNextEvent

public boolean executeNextEvent()
Executes event with least time offset. All other event's time offsets are reduced by executed event time offset.

Returns:
true if event was executed or false if there were no events.

size

public int size()
Returns number of events in this container.

Returns:
number of events in this container.


Copyright © 2007 Actimind, Inc. All Rights Reserved.