edu.cuny.brooklyn.swc2
Interface WorkQueueAccess


public interface WorkQueueAccess

WorkQueueAccess is the interface though which the user's Computation can interface with the SWC2 system.

Author:
Dino Klein
See Also:
Computation

Method Summary
 void addWorkUnit(WorkUnit wu)
          Adds a new WorkUnit to the queue of pending WorkUnit's for the associated computation.
 ResultUnit getResultUnit()
          Returns any available ResultUnit, or blocks if none are available.
 void startNewPass()
          Instructs the SWC2 system to discard all the pending WorkUnit's, and to increment the pass-counter for this computation.
 

Method Detail

startNewPass

void startNewPass()
Instructs the SWC2 system to discard all the pending WorkUnit's, and to increment the pass-counter for this computation. This will cause any incoming ResultUnit's from an older pass to be discarded as well.


addWorkUnit

void addWorkUnit(WorkUnit wu)
Adds a new WorkUnit to the queue of pending WorkUnit's for the associated computation.

Parameters:
wu - the WorkUnit to be added

getResultUnit

ResultUnit getResultUnit()
                         throws java.lang.InterruptedException
Returns any available ResultUnit, or blocks if none are available. The order in which the ResultUnit's are returned is not guaranteed.

Returns:
any available ResultUnit
Throws:
java.lang.InterruptedException - this indicates that the SWC2 system is shutting down, and that the computation should terminate