This section describes the user API for implementing and specifying RemoteCompute jobs.
Java specifies an archive format called the JAR file. This file can contain any type of file, not just code. JARs also specify a standard for adding signatures to individual component files. Since all the control files, code and data required for a job can be included in a single file, the JAR is the obvious choice for a Job Specification standard. Remote jobs are required to consist of a single JAR file containing:
The server needs to unwrap the JAR, perform some initialization tasks such as initializing the network connections and the Java SecurityManager, and invoke the user code. These tasks are performed by the Executor. If the server receives a job called "MyJob.jar", then the server can invoke the job by running:
java Executor MyJob.jar
It's important that the environment for the java process be
initialized such that the trusted Java base classes and the Executor
implementation appear before the user code.
The RemoteCompute API strives to supply secure methods for accessing the JAR job description file and other processes over the network.
For this project the API currently implements a small subset of MPI-like functionality. Jobs can communicate via a message passing interface to their Client and to their peer processes.
All remote jobs must implement the RemoteCompute interface. After initialization, the Executor invokes the user code by calling RemoteCompute.main().
The RemoteJobDescription is initialized by the Executor and is passed in as an argument to RemoteCompute.main(). The RemoteJobDescription class implements methods for accessing the job description file (the JAR), and methods for initiating various network topologies and sending and receiving network messages. Currently Star and Fully-Connected topologies are supported. Other topologies should be easy to implement through modifications of the Star and Fully-Connected network code.
For Clients, the equivalent functionality to the RemoteJobDescription is supplied by the RemoteComputeClient class.
I've coded up several example applications to test performance and functionality.
Here is a direct comparison of the MPI code part-sum.c and the RemoteCompute applet PartSum.java.