External (Non-Java) Clients
We present a framework that enables a non-Java client (e.g., a C program or web browser) to have computation done on its behalf. First, a data flow overview is given. We then give, and illustrate, the following procedures:
- to create a JICOS Task that can be invoked by a non-Java client. We illustrate this procedure with a Fibonacci task.
- for a non-Java client to request that such a Task be computed. We illustrate this procedure with a Fibonacci task and a Traveling Salesperson Problem (TSP) task.
- to create a client proxy, customized for a specific communication protocol and data format, called a Collector. We illustrate this procedure with using HTTP and HTML.
| |
Data Flow Overview |
[ TOP ] |
To understand how a Java client uses JICOS, please refer to the Hello world tutorial, as an elementary example.
When a non-Java client uses JICOS, there are 4 communication steps:
- The non-Java client sends the information necessary to construct a computation (the name of the Task, and the data necessary to populate the input and Shard objects) to a Collector.
- The Collector converts the data to the three Java objects required for a JICOS, then acts as a client and sends these to a JICOS Hosting Service Provider (HSP).
- When the computation is complete, JICOS returns to the Collector the result, as a Java object.
- The Collector converts the result object into a form that is suitable to the non-Java client, and sends this to the client.
These are the four communication steps, and are labeled as such in the figure below, demonstrating an external client communicating with a Collector.
- The non-Java client sends XML/HTTP data to the Collector.
There are different types of Collectors, depending on the format used for the data. The CollectorHttp accepts HTTP requests, the CollectorSoap accepts SOAP messages (over HTTP), and so on. The Collector then gathers all the information from the client's request, and starts an ExternalRequest thread. The ExternalRequest then attempts to convert the information into a JICOS Task. If the Task cannot be created, the appropriate Exception is thrown.
- The Collector sends the objects defining a computation request to a JICOS Hosting Service Provider (HSP).
Once the ExternalRequest thread successfully creates the JICOS Task, Input, and Shared objects, it gives them to the HSP via RMI, and then blocks, waiting for a result.
- The HSP sends the Result to the Collector.
Eventually, JICOS returns either the result of the computation or a runtime Exception.
- The Collector returns XML/HTTP result to the non-Java client.
The ExternalRequest converts the result (or Exception) to XML or HTTP, and sends the answer to the client.
| |
Additional Details |
[ TOP ] |
We now explain and illustrate in detail how a non-Java client uses JICOS, and how to develop a JICOS computation for use by a non-Java client.
- Use
Once a Task can convert external data to Tasks, and convert Results back to external data, it can be used by external clients. An example is given on how to write a HTML form that can access a Task.
- Develop
In order for a Task to be started by an external client, the Task must be able to convert XML data into a Task. An example is given how to modify a task to convert the data.
- Collector
Since different communication protocols require different handling, a collector needs to be created for each new protocol. An example is given for allowing web browsers to communicate with JICOS.
|