2.3. Writing Entries into a Space

To launch our spaceship, we need to write it into a space. Entries are written to spaces so they can be shared with other processes taking part in a distributed computation. If you don't write your entries into a space, they remain local objects of no use to other processes. We will see over the next several chapters that a great many things can be accomplished by sharing entries in a space, from synchronizing processes, to controlling access to resources, to implementing sophisticated forms of communication. For now we are going to write our spaceship entry into a space to travel around (in other words, for the fun of it).

Assuming we have a space object at hand, which is referenced by the variable space, here's ...

Get JavaSpaces™ Principles, Patterns, and Practice now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.