net.sf.tuplespace.utils
Interface UnitOfWork

All Known Implementing Classes:
UnitOfWorkRunner

public interface UnitOfWork

Represents a single unit of work.

Examples of units of work are: download a resource from the network, write results to a file, calculate a running total, etc.


Method Summary
 void execute(TupleSpace tupleSpace)
          Execute one unit of work.
 boolean isDone()
          Return true if you are done, false otherwise.
 

Method Detail

execute

public void execute(TupleSpace tupleSpace)
             throws Exception
Execute one unit of work.

This method's responsibility is to use the provided TupleSpace to execute it's work. Once the unit of work is completed, it should simply return.

Parameters:
tupleSpace - The space with which the unit of work should work with.
Throws:
Exception - Any exception, which needs to be caught by callers.

isDone

public boolean isDone()
Return true if you are done, false otherwise.

Returns:
true if the unit of work should be called again, false otherwise.