edu.wpi.prc.server.spotcheck
Class SpotCheckGenerator

java.lang.Object
  extended by edu.wpi.prc.server.spotcheck.SpotCheckGenerator
All Implemented Interfaces:
java.util.concurrent.Callable<Result>

public class SpotCheckGenerator
extends java.lang.Object
implements java.util.concurrent.Callable<Result>

Invokes the project's science application to compute the result of a work unit.

Author:
James Baldassari

Field Summary
private static int SCIAPP_RETRY_DELAY
           
private static int STARTUP_DELAY
           
private  WorkUnit wu
           
private  org.apache.xmlrpc.XmlRpcClient xmlrpcClient
           
 
Constructor Summary
SpotCheckGenerator(WorkUnit wu, org.apache.xmlrpc.XmlRpcClient xmlrpcClient)
          Default constructor.
 
Method Summary
 Result call()
          Sends the work unit to the science application, receives the result for that work unit, and makes it available to the SpotCheckThread through the Callable interface.
private  Result invokeScienceApp()
          Runs the science application, then passes it a work unit to compute and waits for the science application to return a result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCIAPP_RETRY_DELAY

private static final int SCIAPP_RETRY_DELAY
See Also:
Constant Field Values

STARTUP_DELAY

private static final int STARTUP_DELAY
See Also:
Constant Field Values

wu

private WorkUnit wu

xmlrpcClient

private org.apache.xmlrpc.XmlRpcClient xmlrpcClient
Constructor Detail

SpotCheckGenerator

public SpotCheckGenerator(WorkUnit wu,
                          org.apache.xmlrpc.XmlRpcClient xmlrpcClient)
Default constructor.

Parameters:
wu - The work unit for which to compute a result.
Method Detail

call

public Result call()
Sends the work unit to the science application, receives the result for that work unit, and makes it available to the SpotCheckThread through the Callable interface.

Specified by:
call in interface java.util.concurrent.Callable<Result>
Returns:
The result computed for wu.

invokeScienceApp

private Result invokeScienceApp()
Runs the science application, then passes it a work unit to compute and waits for the science application to return a result.

Returns:
Returns the result computed by the science application.