1.7. Chapter Preview

This book is about building distributed and collaborative applications with the JavaSpaces technology. As with any programming methodology, a number of general principles and patterns have emerged from the use of spaces, and we will spend the bulk of this book covering them. Our aim is to help you explore new ways of thinking about, designing, and building distributed applications with spaces (and in short order so that you can quickly begin to create your own distributed applications). The following is a roadmap to what you'll find as you make your way through this book:

Chapters

Chapter 2JavaSpaces Application Basics—lays the foundation you will need to understand and experiment with the examples in the rest of the book. In a tutorial style, we cover the mechanics of creating a space-based application and introduce the syntax and semantics of the JavaSpaces API and class library.

Chapter 3Building Blocks—presents basic “distributed data structures” that recur in space-based applications, and describes common paradigms for using them. Code segments are given to illustrate the examples, which include shared variables, bags, and indexed structures. This chapter lays the foundation for the next two: Synchronization and Communication.

Chapter 4Synchronization—builds upon Chapter 3 and describes techniques for synchronizing the actions of multiple processes. We start with the simple idea of a space-based semaphore and incrementally present more complex examples of synchronization, from sharing resources fairly, to controlling a group in lockstep, to managing multiple readers and writers.

Chapter 5Communication—also builds upon Chapter 3 and describes common communication patterns that can be created using distributed data structures. We first introduce space-based message passing and then explore the principles behind space-based communication (which provides a number of advantages over conventional communication libraries). We then present a “channel” as a basic distributed data structure that can be used for many common communication patterns.

Chapter 6Application Patterns—introduces several common application patterns that are used in space-based programming, including the replicated-worker pattern, the command pattern, and the marketplace pattern. In each case, we develop a simple example application that makes use of the pattern. We also provide a general discussion of more ad hoc patterns.

Chapter 7Leases—begins the book's coverage of more advanced topics. Spaces use leases as a means of allocating resources for a fixed period of time. This chapter explores how to manipulate and manage the leases created from writing entries into a space. The techniques covered for managing leases are also applicable to distributed events and transactions, which are covered in the next two chapters.

Chapter 8Distributed Events—introduces the Jini distributed event model and shows how applications can make use of remote events in conjunction with spaces.

Chapter 9Transactions—introduces the idea of a transaction as a tool for counteracting the effects of partial failure in distributed applications. This chapter covers the mechanics as well as the semantics of using transactions.

Chapter 10A Collaborative Application—explores the creation of a distributed interactive messenger service using spaces. This collaborative application makes use of the full JavaSpaces API, and also some of the advanced topics encountered in previous chapters, namely leases, events, and transactions.

Chapter 11A Parallel Application—explores parallel computing with spaces. We first building a simple compute server and then a parallel application that runs on top of it. Both are used to explore issues that arise when developing space-based parallel applications. Like the collaborative application, in this chapter we make full use of the JavaSpaces API and its advanced features.

Chapter 12Further Exploration—provides a set of references (historical and current) that you can use as a basis for further exploration.

Appendices A, B, and C—contain the official Jini™ Entry Specification, Jini™ Entry Utilities Specification, and JavaSpaces™ Specification written by the Jini product team at Sun Microsystems, Inc.

Online Supplement

The online supplement to this book can be accessed at the World Wide Web site http://java.sun.com/docs/books/jini/javaspaces. The supplement includes the following:

  • Full source code to examples

  • Links to sites with related information, including links to specifications, whitepapers, and demonstration programs

  • Corrections, supplements, and commentary generated after this book went to press

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset