lima.testing
Class TestWU

java.lang.Object
  |
  +--lima.testing.TestWU
All Implemented Interfaces:
java.io.Serializable, WorkUnit

public class TestWU
extends java.lang.Object
implements WorkUnit, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  int workCounter
           
 
Constructor Summary
TestWU(int sernum)
           
 
Method Summary
 int cost()
          Guess how long this workunit will take to run, in ms on a midrange machine
 boolean equals(java.lang.Object o)
           
 void generateHashCode()
          WHAT DOES THIS DO? WHY? - pw
 int getSerial()
          Method getSerial.
 int hashCode()
           
 boolean hasRun()
          Returns true iff run has completed on this workUnit.
 void run(lima.storage.Cache c)
          Start processing this WorkUnit.
 int runtime()
          How long this WorkUnit took to run in ms.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workCounter

protected int workCounter
Constructor Detail

TestWU

public TestWU(int sernum)
Method Detail

generateHashCode

public void generateHashCode()
Description copied from interface: WorkUnit
WHAT DOES THIS DO? WHY? - pw

Specified by:
generateHashCode in interface WorkUnit

run

public void run(lima.storage.Cache c)
Description copied from interface: WorkUnit
Start processing this WorkUnit. This method MUST return only after processing has finished, and the WorkUnit can be send back to the server.

Specified by:
run in interface WorkUnit
See Also:
WorkUnit.run(lima.storage.Cache)

cost

public int cost()
Description copied from interface: WorkUnit
Guess how long this workunit will take to run, in ms on a midrange machine

Specified by:
cost in interface WorkUnit
See Also:
WorkUnit.cost()

runtime

public int runtime()
            throws java.lang.IllegalStateException
Description copied from interface: WorkUnit
How long this WorkUnit took to run in ms. This should only be called after run has been called.

Specified by:
runtime in interface WorkUnit
Returns:
int
Throws:
java.lang.IllegalStateException - iff run has not been called.
See Also:
WorkUnit.runtime()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

hasRun

public boolean hasRun()
Description copied from interface: WorkUnit
Returns true iff run has completed on this workUnit.

Specified by:
hasRun in interface WorkUnit
Returns:
boolean
See Also:
WorkUnit.hasRun()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getSerial

public int getSerial()
Method getSerial. Returns internal serial number, used to retrieve data by the work provider