edu.wpi.prc.templates.java.science
Class RPCHandler

java.lang.Object
  extended by edu.wpi.prc.templates.java.science.RPCHandler

public class RPCHandler
extends java.lang.Object

This class is the RPC handler for the science application's XML-RPC server. Any of the methods in this class can be called by an XML-RPC client.

Author:
James Baldassari

Field Summary
(package private)  ScienceApplication sciapp
           
 
Constructor Summary
RPCHandler(ScienceApplication sciapp)
          Constructor taking a reference to the science application.
 
Method Summary
 java.util.Vector computeResult(byte[] data)
          This handler is called when the project client sends a new work unit to the science application to be computed.
 java.util.Vector computeSpotCheckResult(byte[] data)
          This handler is called when the project server sends a spot check work unit to the science application to be computed.
 boolean shutdown()
          Performs any tasks necessary to clearnly shut down the science application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sciapp

ScienceApplication sciapp
Constructor Detail

RPCHandler

public RPCHandler(ScienceApplication sciapp)
Constructor taking a reference to the science application.

Parameters:
sciapp - The science application using this RPC handler.
Method Detail

computeResult

public java.util.Vector computeResult(byte[] data)
This handler is called when the project client sends a new work unit to the science application to be computed. This method will compute the result of the work unit, then return that result to the project client.

Parameters:
data - The work unit to be computed.
Returns:
Returns a Vector representing the computed result.

computeSpotCheckResult

public java.util.Vector computeSpotCheckResult(byte[] data)
This handler is called when the project server sends a spot check work unit to the science application to be computed. This method will compute the result of the work unit, then return that result to the project server. Checkpointing should not be used in this case because there is no project client involved in the interaction between the server and science application. Note that only the client implements the checkpointing RPCs.

Parameters:
data - The work unit to be computed.
Returns:
Returns a Vector representing the computed result.

shutdown

public boolean shutdown()
Performs any tasks necessary to clearnly shut down the science application.

Returns:
Returns true.