(
Most chapters conclude with a Summary and Exercises.)
1. Introduction. Benefits of Distributed Computing.
Challenges of Distributed Computing.
What Is JavaSpaces Technology?
Key Features.
JavaSpaces Technology in Context.
JavaSpaces Technology Overview.
Entries and Operations.
Going Further.
Putting It All Together.
Advantages of JavaSpaces Technologies.
Chapter Preview.
2. JavaSpaces Application Basics. Entries.
The Entry Interface.
Instantiating an Entry.
Adding Fields and Methods.
Building an Application.
The SpaceAccessor.
Writing Entries into a Space.
A Closer Look at write.
Reading and Taking Entries.
Associative Lookup.
The Basics of read and take.
The Rules of Matching.
Dealing with null-valued Fields in Entries.
Primitive Fields.
A Closer Look at read and take.
Going Further with the Example.
Subclassing an Entry.
Adding a Few More Methods.
Trying the Game.
Post-Game Analysis.
Serialization and Its Effects.
Entry Serialization.
Matching and Equality.
The No-arg Constructor.
The Entry Interface Revisited.
Improving Entry Serialization Using snapshot.
3. Building Blocks. Introduction to Distributed Data Structures.
Building Distributed Data Structures with Entries.
Shared Variables.
Atomic Modification.
Additional Operations.
Creating a Web Counter.
Stepping Back.
Unordered Structures.
Bags.
Task Bags and Result Bags.
Ordered Structures.
Distributed Arrays Revisited.
4. Synchronization. Semaphores.
Implementing a Semaphore.
Implementing a License Manager.
The License Manager Installer.
The License Manager Client Library.
Using Multiple Semaphores.
The Dining Philosophers.
Fairly Sharing a Resource.
Using a Queue to Take Turns.
Round-Robin Synchronization.
Barrier Synchronization.
Advanced Synchronization: The Readers/Writers Problem.
Implementing a Readers/Writers Solution.
Implementing a Counter.
Implementing a Space-based Readers/Writers Application.
5. Communication. Basic Message Passing.
Playing Ping-Pong.
Characteristics of Space-based Communication.
Tightly Coupled Communication.
Loosely Coupled Communication.
Benefits of Loose Coupling.
Beyond Message Passing.
A Basic Channel.
The Channel Message.
The Channel Tail.
Creating a Channel.
Appending a Message to a Channel.
Implementing a Channel Writer.
Implementing a Channel Reader.
Demonstrating the Channel Writer and Reader.
Building a Chat Application with Channels.
The Graphical User Interface.
Combining Channel Writing and Reading.
A Consumer Channel.
Implementing a Pager Service.
The Pager Message Entry.
Tracking the Start and End of a Channel.
The Index Entry.
Creating a Consumer Channel.
Sending Messages to the Channel.
Reading and Removing Messages from the Channel.
Demonstrating the Pager.
Bounded Channels.
The Status Entry.
Channel Creation Revisited.
Writing to a Bounded Channel.
Taking from a Bounded Channel.
Demonstrating the Bounded Channel.
6. Application Patterns. The Replicated-Worker Pattern.
Computing the Mandelbrot Set.
Task and Result Entries.
The Master.
The Worker.
The Command Pattern.
Implementing a Compute Server.
The Generic Worker.
The Generic Master.
Creating Specialized Tasks and Results.
Creating a Specialized Master.
Running the Compute Server.
The Marketplace Pattern.
An Automobile Marketplace.
Interaction in the Marketplace.
The Bid Entry.
The Application Framework.
The Buyer.
The Seller.
Running the Marketplace.
Other Patterns.
Specialist Patterns.
Collaborative Patterns.
7. Leases. Leases on Entries.
The Lease Object.
Lease Expiration.
Renewing a Lease.
Cancelling a Lease.
Lease Maps.
Creating a Lease Map.
Adding and Removing Leases.
Renewing Leases.
Cancelling Leases.
Automated Lease Renewal.
The LeaseManager Interface.
Implementing the Constructors.
Adding Leases.
Cancelling a Lease.
Renewing Leases.
Checking Leases.
Processing Renewal Failures.
Putting It All Together.
8. Distributed Events. Events in the Distributed Environment.
Hello World Using notify.
The Notification API.
The JavaSpace notify Method.
The EventRegistration Class.
The RemoteEventListener Interface.
The RemoteEvent Object.
Putting the Pieces Together.
The Channel Relay Application.
The Channel Reader Thread.
The Relayer Listener.
The Notify Handler Thread.
9. Transactions. The Distributed Transaction Model.
Creating a Transaction.
Web Counter Revisited.
The Spaceis Transactional Properties.
Operational Semantics Under Transactions.
Writing Entries Under a Transaction.
Reading Entries Under a Transaction.
read versus readIfExists.
Taking Entries Under a Transaction.
Notifications Under Transactions.
10. A Collaborative Application. The Messenger.
Implementing a Messenger User.
The Account.
The Account Object.
User Sessions.
The Session Object.
Friends List.
The FriendsList Object.
The FriendsListMonitor Object.
Communication Channel.
Message Entries and Indices.
The Channel Object.
Retrieving Messages from the Channel.
The Messenger Applet.
Logging in via the Login Object.
The loginCallback Method.
Adding to the Friends List.
Chatting with Friends.
Sending Messages.
Listening for Messages.
11. A Parallel Application. The Compute Server.
The Command Interface Revisited.
The Task Entry.
The Generic Worker.
A Generic Master.
The Crypt Application.
Background.
The Generic Worker and Crypt Task.
The Crypt Master.
Generating Tasks.
Improving Space Usage with Watermarking.
Collecting Results.
A Little Poison.
Exploring Crypt.
12. Further Exploration. Online Resources.
Related Java and Jini Technologies.
Background Reading.
Distributed Systems.
Transactions.
Historical Resources.
Appendix A: The Jini(TM) Entry Specification. Entries and Templates.
Operations.
Entry.
Serializing Entry Objects.
Unusable Entry Exception.
Templates and Matching.
Serialized Form.
Comments.
Appendix B: The Jini(TM) Entry Utilities Specification. Entry Utilities.
Abstract Entry.
Serialized Form.
Comments.
Appendix C: The JavaSpaces(TM) Specification. Introduction.
The JavaSpaces Application Model and Terms.
Benefits.
JavaSpaces Technology and Databases.
JavaSpaces System Design and Linda Systems.
Goals and Requirements.
Dependencies.
Comments.
Operations.
Entries.
net.jini.space.JavaSpace.
write.
readIfExists and read.
takeIfExists and take.
snapshot.
notify.
Operation Ordering.
Serialized Form.
Transactions.
Operations Under Transactions.
Transactions and ACID Properties.
Further Reading.
Linda Systems.
The Java Platform.
Distributed Computing.
Index. 0201309556T04062001