I've demonstrated a simple compute server in this article. With a small amount of code, we've implemented a server capable of executing arbitrary code on behalf of a master process. It would take some work to make this code ready for general use, and even more to create a compute server that is industrial strength and will soldier on in the face of partial failure. For instance, at this stage in our server's development, there is no method of distinguishing one master's tasks from another -- if we ran two concurrent instances of the master, then we'd most likely get mixed result sets returned by the collectResults method. We also have no way to handle exceptions in the task code when it is running within the worker's environment, or to handle the failure of workers when they are computing tasks. If either of these events occurred, the tasks being computed would be lost, which would lead to the master computing incorrectly. If the task to compute a piece of a ray-traced image was lost, for instance, then the image would never be completed.
Susanne and I will tackle many of these issues in remaining articles of this series, and in the compute-server working group at Jini.org. Please come and join us.
About the Author
Dr. Eric Freeman, recently named one of the top 100 young innovators by MIT's Technology Review, is chief technologist of Mirror Worlds Technologies, a Java- and Jini-based software applications company, and a research affiliate in the department of computer science at Yale University. Eric recently coauthored JavaSpaces Principles, Patterns, and Practice, the official Sun Microsystems Jini Series book on the JavaSpaces distributed computing technology, along with Susanne Hupfer and Ken Arnold. Previously, Eric spent several years working closely with David Gelernter as a PhD student at Yale University on space-based systems (which are the progenitors of the JavaSpaces technology). Eric would like to thank Elisabeth Freeman and Susanne Hupfer for their careful reading, feedback, and comments on drafts of this article.
For nitty-gritty API details, see the definitive references are the Jini specifications from Sun Microsystems (starting with the Jini Entry Specification and the JavaSpaces Specification): http://www.sun.com/jini/specs/
The Jini specs are also conveniently provided in The Jini Specification (The Jini Technology Series), Ken Arnold, Bryan O'Sullivan, Robert W. Scheifler, Jim Waldo, Ann Wollrath, and Bryan O'Sullivan (Addison-Wesley, 1999): http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0201616343
To gain insight into the philosophy that underlies Sun's approach to distributed computing, read "A note on distributed computing," Jim Waldo, Geoff Wyant, Ann Wollrath, and Sam Kendall, Sun Microsystems TR-94-29: http://www.sunlabs.com/technical-reports/1994/abstract-29.html.