2.4. Reading and Taking Entries

The JavaSpace interface provides read and take methods that allow you to retrieve a copy of an entry in a space (read) or to retrieve a copy and at the same time remove an entry (take). To read or take an entry we first have to locate it within the space, and this is done via associative lookup. Rather than specifying the address of the entry or an identifier that points to the entry, we create a template that can be used to match entries in a space based on content.

As we will see in later chapters, this content-based method of retrieving entries allows us to uncouple distributed components and to support anonymous forms of communication. Both of these qualities lead to more robust, flexible, and scalable code. ...

Get JavaSpaces™ Principles, Patterns, and Practice 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.