|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.prc.example.java.generator.WorkUnitGenerator
public class WorkUnitGenerator
The WorkUnitGenerator contains the project-specific code to generate work units. It uses the WorkGeneratorClient to send them to the project server.
Field Summary | |
---|---|
private static double |
EXPIRATION_TIME
|
private static int |
INT_SIZE
|
private int |
nextEndRange
|
private int |
nextStartRange
|
private static int |
POINTS
|
private static int |
PRIORITY
|
private static int |
RANGE_LENGTH
|
private int |
workUnitID
|
Constructor Summary | |
---|---|
WorkUnitGenerator()
Default constructor. |
Method Summary | |
---|---|
void |
generateAndSend(int numWorkUnits)
Generates the specified number of work units, and sends them to the project server. |
private byte[] |
generateWorkUnit()
Generates the next work unit. |
private int |
recoverStartRange()
If the work unit generator were shut down, then started back up, it would need to determine the last work unit that was generated so that it would know where to resume generating new ranges. |
private void |
sendWorkUnit(byte[] workUnit)
Adds a new work unit to the server by calling the server.addWorkUnit XML-RPC. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int RANGE_LENGTH
private static final int PRIORITY
private static final int POINTS
private static final double EXPIRATION_TIME
private static final int INT_SIZE
private int workUnitID
private int nextStartRange
private int nextEndRange
Constructor Detail |
---|
public WorkUnitGenerator()
Method Detail |
---|
private int recoverStartRange()
private byte[] generateWorkUnit()
private void sendWorkUnit(byte[] workUnit)
workUnit
- The work unit to send to the server.public void generateAndSend(int numWorkUnits)
numWorkUnits
- The number of work units to generate and send.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |