O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JavaSpaces™ Principles, Patterns, and Practice

Book Description

"Ever since I first saw David Gelernter's Linda programming language almost twenty years ago, I felt that the basic ideas of Linda could be used to make an important advance in the ease of distributed and parallel programming. As part of the fruits of Sun's Jini project, we now have the JavaSpaces technology, a wonderfully simple platform for developing distributed applications that takes advantage of the power of the Java programming language. This important book and its many examples will help you learn about distributed and parallel programming. I highly recommend it to students, programmers, and the technically curious." Bill Joy, Chief Scientist and co-founder, Sun Microsystems, Inc.

JavaSpaces technology, a powerful Jini service from Sun Microsystems, facilitates building distributed applications for the Internet and Intranets. The JavaSpaces model involves persistent object exchange "areas" in which remote processes can coordinate their actions and exchange data. It provides a necessary ubiquitous, cross-platform framework for distributed computing, emerging as a key technology in this expanding field.

This book introduces the JavaSpaces architecture, provides a definitive and comprehensive description of the model, and demonstrates how to use it to develop distributed computing applications. The book presents an overview of the JavaSpaces design and walks you through the basics, demonstrating key features through examples. Every aspect of JavaSpaces programming is examined in depth: entries, distributed data structures, synchronization, communication, application patterns, leases, distributed events, and transactions.

You will find information on such vital topics as:

  • Distributed data structures

  • Synchronization techniques

  • Loosely coupled communication

  • Message passing

  • Channel data structures for communication

  • Application patterns such as replicated worker, command pattern, and marketplace

  • Leases and automated lease renewal

  • Using distributed events with spaces

  • Handling partial failure with distributed transactions

  • The official JavaSpaces specification from Sun Microsystems

  • JavaSpaces Principles, Patterns, and Practice also includes two full-scale applications--one collaborative and the other parallel--that demonstrate how to put the JavaSpaces model to work.


    Table of Contents

    1. Copyright
    2. Preface
    3. Foreword
    4. Introduction
      1. Benefits of Distributed Computing
      2. Challenges of Distributed Computing
      3. What Is JavaSpaces Technology?
      4. JavaSpaces Technology Overview
      5. Putting It All Together
      6. Advantages of JavaSpaces Technologies
      7. Chapter Preview
      8. Exercises
    5. JavaSpaces Application Basics
      1. Entries
      2. Building an Application
      3. Writing Entries into a Space
      4. Reading and Taking Entries
      5. Going Further with the Example
      6. Serialization and Its Effects
      7. Summary
    6. Building Blocks
      1. Introduction to Distributed Data Structures
      2. Shared Variables
      3. Unordered Structures
      4. Ordered Structures
      5. Summary
      6. Exercises
    7. Synchronization
      1. Semaphores
      2. Using Multiple Semaphores
      3. Fairly Sharing a Resource
      4. Barrier Synchronization
      5. Advanced Synchronization: The Readers/Writers Problem
      6. Summary
      7. Exercises
    8. Communication
      1. Basic Message Passing
      2. Characteristics of Space-based Communication
      3. Beyond Message Passing
      4. A Basic Channel
      5. Building a Chat Application with Channels
      6. A Consumer Channel
      7. Bounded Channels
      8. Summary
      9. Exercises
    9. Application Patterns
      1. The Replicated-Worker Pattern
      2. The Command Pattern
      3. The Marketplace Pattern
      4. Other Patterns
      5. Summary
      6. Exercises
    10. Leases
      1. Leases on Entries
      2. The Lease Object
      3. Lease Maps
      4. Automated Lease Renewal
      5. Summary
      6. Exercises
    11. Distributed Events
      1. Events in the Distributed Environment
      2. Hello World Using notify
      3. The Notification API
      4. Putting the Pieces Together
      5. Summary
      6. Exercises
    12. Transactions
      1. The Distributed Transaction Model
      2. Creating a Transaction
      3. Web Counter Revisited
      4. The Space's Transactional Properties
      5. Operational Semantics Under Transactions
      6. Summary
      7. Exercises
    13. A Collaborative Application
      1. The Messenger
      2. Implementing a Messenger User
      3. The Account
      4. User Sessions
      5. Friends List
      6. Communication Channel
      7. The Messenger Applet
      8. Summary
      9. Exercises
    14. A Parallel Application
      1. The Compute Server
      2. The Crypt Application
      3. Summary
      4. Exercises
    15. Further Exploration
      1. Online Resources
      2. Related Java and Jini Technologies
      3. Background Reading
      4. Historical Resources
    16. About the Authors
    17. The Jini™ Entry Specification
      1. Entries and Templates
    18. The Jini™ Entry Utilities Specification
      1. Entry Utilities
    19. The JavaSpaces™ Specification
      1. Introduction
      2. Operations
      3. Transactions
      4. Further Reading
    20. Index