Overview of JavaSpaces

The distributed application paradigm supported by JavaSpaces is one in which remote agents interact with each other indirectly through shared data object spaces. Objects are stored in a JavaSpace in the form of entries. Clients write entries into the space, read entries from the space, or take entries from the space, as shown in Figure 3.1.

JavaSpaces general architecture
Figure C-1. JavaSpaces general architecture

Access to the entries in JavaSpaces is through a small set of basic operations:

read

Read an entry from the space that matches a template.

write

Add an entry to the space.

take

Read and remove an entry from the space.

notify

Send a notification through a given event handler if entries that match a template are added to the space. A notification request has a time-out period associated with it: if a matching entry isn’t added within the time-out period, the notify request fails and is dropped from the JavaSpace.

Multiple basic operations can be assembled into transactions that group basic operations into a single, atomic aggregate operation.

There can be many clients and many JavaSpaces in a given distributed application. One client, and even one transaction from one client, can access multiple JavaSpaces. So instead of one agent sending a message to another, or invoking a remote method directly on another object within an agent, agents interact by writing and reading objects in JavaSpaces. ...

Get Java Distributed Computing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.