Uses of JavaSpaces
Therefore, a JavaSpace is a Jini service that provides a shared distributed object repository. Now, the question becomes, what use can you make of such an entity? Although the JavaSpace interface has only seven methods, these methods can be used to provide the basis for building much more complex distributed systems.
What JavaSpaces are is mirrored by how JavaSpaces are used. You now take a quick look at a couple of the general areas in which JavaSpaces have been or could be used. Of course, this should not suggest that these are the only areas in which JavaSpaces can be usedjust some of the more common ones.
Information Sharing
JavaSpaces are designed to share objects. Therefore, it should not be surprising that many of the applications for JavaSpaces revolve around this facet of Java-Spaces.
Information can easily be exchanged through a space. Every entry that is written to a space can be read from any client of that space. The reader and the writer do not need to know anything about one another. All that needs to be known is what kind of entries are being put into the space.
An example of a space being used for information exchange can be found in chat or messaging systems. Systems of this sort have become quite popular. In this case, the space is being used as the shared message board that multiple clients can write to and then extract messages from.
Compute Serving
In addition to just sharing data, a very interesting area that JavaSpaces open up is the notion of sharing the computing power of a distributed system.
In this sort of usage, typically one (or more) producer of chunks of a problem can be computationally expensive. The problem also needs to be one that can be split into parallel tasks.
The producer(s) send the chunks to a JavaSpace. Then, clients of that space running on separate machines consume the chunks, perform the computation, and return the completed chunks to the JavaSpace. The completed chunks can then be assembled.
Work Flow
JavaSpaces are also well suited to the notion of managing work flow environments. Work flow environments can be distinguished from pure compute serving environments in that the work that is being scheduled may be performed by people rather than being purely computational.