Built on top of the Java software infrastructure, Jini technology enables all types of services and devices to work together in a community--organized without extensive planning, installation, or human intervention. Jini technology allows the lines to blur between what is hardware and what is software by representing all hardware and software as Jini technology-enabled "services," accessible either directly or through surrogates written in the Java programming language. In a distributed system of Jini technology-enabled services, these programs interact spontaneously, enabling services to join or leave the network with ease, which allows clients to view and access available services with confidence. A system of Jini technology-enabled services can link office components such as printers, faxes, and desktop computers. Beyond these traditional networks, the technology is also ideal for building the home-based networks that are now emerging: entertainment systems, cars, smart houses, and personal computers.
This book contains the formal specification for the core Jini technology, as well as specifications for local helper utilities and remote helper services. It offers a review of distributed computing fundamentals, an overview of the Jini architecture, and an introduction to the key concepts that are the source of the technology's simplicity and power--remote objects, leasing, distributed events, and a two-phase commit protocol. The formal specifications provide the definitive description of every element of the Jini architecture, including detailed information on such topics as:
1 Overview and Examples.
1. Overview.Goals.
Architecture.
What the Jini Architecture Depends Upon.
The Value of a Proxy.
The Lookup Service.
Attributes.
Membership Management.
Lookup Groups.
Lookup Service Compared to Naming/Directory Services.
Conclusion. Notes on the Example Code.
Package Structure.
2. Writing a Client.The MessageStream Interface.
The Client.
In Conclusion.
3. Writing a Service.Good Lookup Citizenship.
The JoinManager Utility.
The FortuneStream Service.
The Implementation Design.
Creating the Service.
The Running Service.
The ChatStream Service.
"Service" versus "Server." @BHEADS = Creating the Service.
The Chat Server.
Implementing nextInLine.
Notes on Improving ChatServerImpl.
The Clients.
4. The Rest of This Book.II. SPECIFICATIONS.
The Jini Architecture Specification.Introduction.
Goals of the System.
Environmental Assumptions.
System Overview.Key Concepts.
Services.
Lookup Service.
Java Remote Method Invocation (RMI).
Security.
Leasing.
Transactions.
Events.
Component Overview.
Infrastructure.
Programming Model.
Services.
Service Architecture.
Discovery and Lookup Protocols.
Service Implementation.
An Example.
Registering the Printer Service.
Discovering the Lookup Service.
Joining the Lookup Service.
Optional Configuration.
Staying Alive.
Printing.
Locate the Lookup Service.
Search for Printing Services.
Configuring the Printer.
Requesting That the Image Be Printed.
Registering for Notification.
Receiving Notification.
Dependencies.
Discovery and Join.Terminology.
Host Requirements.
Protocol Stack Requirements for IP Networks.
Protocol Overview.
Discovery in Brief.
Groups.
The Multicast Request Protocol.
The Multicast Announcement Protocol.
The Unicast Discovery Protocol.
The Discovery Protocols.Protocol Roles.
The Multicast Request Protocol.
Protocol Participants.
The Multicast Request Service.
Request Packet Format.
The Multicast Response Service.
Discovery Using the Multicast Request Protocol.
Steps Taken by the Discovering Entity.
Steps Taken by the Multicast Request Server.
Handling Responses from Multiple Djinns.
The Multicast Announcement Protocol.
The Multicast Announcement Service.
The Protocol.
Unicast Discovery.
The Protocol.
Request Format.
Response Format.
The Join Protocol.Persistent State.
The Join Protocol.
Initial Discovery and Registration.
Lease Renewal and Handling of Communication Problems.
Making Changes and Performing Updates.
Joining or Leaving a Group.
Network Issues.Properties of the Underlying Transport.
Limitations on Packet Sizes.
Bridging Calls to the Discovery Request Service.
Limiting the Scope of Multicasts.
Using Multicast IP as the Underlying Transport.
Address and Port Mappings for TCP and Multicast UDP.
LookupLocator Class.
Jini Technology URL Syntax.
Serialized Form.
Entry.
Entries and Templates.
Operations.
Entry.
Serializing Entry Objects.
UnusableEntryException.
Templates and Matching.
Distributed Leasing.
Leasing and Distributed Systems.
Goals and Requirements.
Basic Leasing Interfaces.Characteristics of a Lease.
Basic Operations.
Leasing and Time.
Serialized Forms.
Example Supporting Classes.
A Renewal Class.
A Renewal Service.
Distributed Events.
Distributed Events and Notifications.
Goals and Requirements.
The Basic Interfaces.Entities Involved.
Overview of the Interfaces and Classes.
Details of the Interfaces and Classes.
The RemoteEventListener Interface.
The RemoteEvent Class.
The UnknownEventException.
An Example EventGenerator Interface.
The EventRegistration Class.
Sequence Numbers, Leasing and Transactions.
Serialized Forms.
Third-Party Objects.Store-and-Forward Agents.
Notification Filters.
Notification Multiplexing.
Notification Demultiplexing.
Notification Mailboxes.
Compositionality.
Integration with JavaBeans Components.
Differences with the JavaBeans Component Event Model.
Converting Distributed Events to JavaBeans Component Events.
Transaction.
Introduction.
Model and Terms.
Distributed Transactions and ACID Properties.
Requirements.
The Two-Phase Commit Protocol.
Starting a Transaction.
Starting a Nested Transaction.
Joining a Transaction.
Transaction States.
Completing a Transaction: The Client's View.
Completing a Transaction: A Participant's View.
Completing a Transaction: The Manager's View.
Crash Recovery.
The Roll Decision.
Durability.
Default Transaction Semantics.
Transaction and NestableTransaction Interfaces.
TransactionFactory Class.
ServerTransaction and NestableServerTransaction Classes.
CannotNestException Class.
Semantics.
Serialized Forms.
Lookup Service.
Introduction.
The Lookup Service Model.
Attributes.
The ServiceRegistrar.
ServiceID.
ServiceItem.
ServiceTemplate and Item Matching.
Other Supporting Types.
ServiceRegistrar.
ServiceRegistration.
Serialized Forms.
US Introduction to Helper Utilities and Services.
Summary.
Terminology.
Terms Related to Discovery and Join.
Jini Clients and Services.
Helper Service.
Helper Utility.
Managed Sets.
What Exceptions Imply about Future Behavior.
Unavailable Lookup Services.
Discarding a Lookup Service.
Active Communication Discarded Event.
Active No-Interest Discarded Event.
Passive Communication Discarded Event.
Passive No-Interest Discarded Event.
Changed Event.
Remote Objects, Stubs, and Proxies.
Activation.
Introduction to the Helper Utilities.
The Discovery Utilities.
The DiscoveryManagement Interface.
The DiscoveryGroupManagement Interface.
The DiscoveryLocatorManagement Interface.
The LookupDiscovery Helper Utility.
The LookupLocatorDiscovery Helper Utility.
The LookupDiscoveryManager Helper Utility.
The Constants Class.
The OutgoingMulticastRequest Utility.
The IncomingMulticastRequest Utility.
The OutgoingMulticastAnnouncement Utility.
The IncomingMulticastAnnouncement Utility.
The OutgoingUnicastRequest Utility.
The IncomingUnicastRequest Utility.
The OutgoingUnicastResponse Utility.
The IncomingUnicastResponse Utility.
The Lease Utilities.
The LeaseRenewalManager Helper Utility.
The Join Utilities.
The JoinManager Helper Utility.
The Service Discovery Utilities.
The ServiceDiscoveryManager Helper Utility.
Introduction to the Helper Services.
The Lookup Discovery Service.
The Lease Renewal Service.
The Event Mailbox Service.
Dependencies.
Jini Discovery Utilities Specification.
Introduction.
Dependencies.
The Discovery Management Interfaces.
Overview.
Other Types.
The DiscoveryManagement Interface.
The Semantics.
The DiscoveryGroupManagement Interface.
The Semantics.
The DiscoveryLocatorManagement Interface.
The Semantics.
Supporting Interfaces and Classes.
The DiscoveryListener Interface.
The DiscoveryChangeListener Interface.
The DiscoveryEvent Class.
Serialized Forms.
LookupDiscovery Utility.
Other Types.
The Interface.
The Semantics.
Supporting Interfaces and Classes.
The DiscoveryManagement Interfaces.
Security and Multicast Discovery: The DiscoveryPermission Class.
Serialized Forms.
The LookupLocatorDiscovery Utility.
Overview.
Other Types.
The Interface.
The Semantics.
Supporting Interfaces.
The DiscoveryManagement Interfaces.
The LookupDiscoveryManager Utility.
Overview.
Other Types.
The Interface.
The Semantics.
Supporting Interfaces and Classes.
The DiscoveryManagement Interfaces.
Security and Multicast Discovery: The DiscoveryPermission Class.
Low-Level Discovery Protocol Utilities.
The Constants Class.
Overview.
Other Types.
The Class Definition.
The Semantics.
The OutgoingMulticastRequest Utility.
Overview.
Other Types.
The Interface.
The Semantics.
The IncomingMulticastRequest Utility.
Overview.
Other Types.
The Interface.
The Semantics.
The OutgoingMulticastAnnouncement Utility.
Overview.
Other Types.
The Interface.
The Semantics.
The IncomingMulticastAnnouncement Utility.
Overview.
Other Types.
The Interface.
The Semantics.
The OutgoingUnicastRequest Utility.
Overview.
Other Types.
The Interface.
The Semantics.
The IncomingUnicastRequest Utility.
Overview.
Other Types.
The Interface.
The Semantics.
The OutgoingUnicastResponse Utility.
Overview.
Other Types.
The Interface.
The Semantics.
The IncomingUnicastResponse Utility.
Overview.
Other Types.
The Interface.
The Semantics.
EU Jini Entry Utilities Specification.
Entry Utilities.
AbstractEntry.
Serialized Form.
Jini Lease Utilities Specification.
Introduction.
The LeaseRenewalManager.
Other Types.
The Interface.
The Semantics.
Supporting Interfaces and Classes.
The LeaseListener Interface.
The Semantics.
The DesiredExpirationListener Interface.
The Semantics.
The LeaseRenewalEvent Class.
The Semantics.
Serialized Forms.
Jini Join Utilities Specification.
Introduction.
The JoinManager.
Other Types.
The Interface.
The Semantics.
Supporting Interfaces and Classes.
The DiscoveryManagement Interface.
The ServiceIDListener Interface.
Jini Service Discovery Utilities Specification.
Introduction.
The ServiceDiscoveryManager.
The Object Types.
The Interface.
The Semantics.
The Methods.
The Constructor.
The createLookupCache Method.
The lookup Method.
The getDiscoveryManager Method.
The getLeaseRenewalManager Method.
The terminate Method.
Defining Service Equality.
Exporting RemoteEventListener Objects.
Supporting Interfaces and Classes.
The DiscoveryManagement Interface.
The ServiceItemFilter Interface.
The Semantics.
The ServiceDiscoveryEvent Class.
The Semantics.
The ServiceDiscoveryListener Interface.
The Semantics.
The LookupCache Interface.
The Semantics.
Jini Lookup Discovery Service.
Introduction.
Goals and Requirements.
Other Types.
The Interface.
The Semantics.
Registration Semantics.
Event Semantics.
Leasing Semantics.
Supporting Interfaces and Classes.
The LookupDiscoveryRegistration Interface.
The Semantics.
The RemoteDiscoveryEvent Class.
The Semantics.
Serialized Forms.
The LookupUnmarshalException Class.
The Semantics.
Serialized Forms.
LS Jini Lookup Attribute Schema Specification.
Introduction.
Terminology.
Design Issues.
Dependencies.
Human Access to Attributes.
Providing a Single View of an Attribute's Value.
JavaBeans Components and Design Patterns.
Allowing Display and Modification of Attributes.
Using JavaBeans Components with Entry Classes.
Associating JavaBeans Components with Entry Classes.
Supporting Interfaces and Classes.
Generic Attribute Classes.
Indicating User Modifiability.
Basic Service Information.
More Specific Information.
Naming a Service.
Adding a Comment to a Service.
Physical Location.
Status Information.
Serialized Forms.
Jini Lease Renewal Service Specification.
Introduction.
Goals and Requirements.
Other Types.
The Interface.
Events.
Serialized Forms.
Jini Event Mailbox Service Specification.
Introduction.
Goals and Requirements.
Other Types.
The Interface.
The Semantics.
Supporting Interfaces and Classes.
The Semantics.
JavaSpaces Service Specification.
Introduction.
The JavaSpaces Application Model and Terms.
Distributed Persistence.
Distributed Algorithms as Flows of Objects.
Benefits.
JavaSpaces Technology and Databases.
JavaSpaces System Design and Linda Systems.
Goals and Requirements.
Dependencies.
Operations.
Entries.
net.jini.space.JavaSpace.
InternalSpaceException.
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.
Jini Device Architecture Specification.
Introduction.
Requirements from the Jini Lookup Service.
Basic Device Architecture Examples.
Devices with Resident Java Virtual Machines.
Devices Using Specialized Virtual Machines.
Clustering Devices with a Shared Virtual Machine (Physical Option).
Clustering Devices with a Shared Virtual Machine (Network Option).
Jini Technology-Enabled Software Services over the Internet Inter-Operability Protocol.
III. SUPPLEMENTAL MATERIAL.
Jini Technology Glossary.Introduction.
Terminology.
The Vision of Unified Objects.
Deja Vu All Over Again.
Local and Distributed Computing.
Latency.
Memory Access.
Partial Failure and Concurrency.
The Myth of "Quality of Service." Lessons from NFS.
Taking the Difference Seriously.
A Middle Ground.
References.
Observations for This Reprinting.
Appendix B: Example Code.Index. 0201726173T04062001 Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
--Antoine de Saint-Exupery
The Jini architecture is designed for deploying and using services in a network. Networks are by nature dynamic: new things are added, old things are removed, existing things are changed, and parts of the network fail and are repaired. There are therefore problems unlike any that will appear in a single process or even multiple processes in a single machine.
These differences require an approach that takes them into account, makes changes apparent, and allows older parts to work with newer parts that are added. A distributed system must adapt as the network changes since the network will change. The Jini architecture is designed to be adaptable.
This book contains three parts. The first part gives an overview of the Jini architecture, its design philosophy, and its application. This overview sets up the following sections, which contain examples of programming in a Jini system. The first section of the introduction is also usable as a high-level overview for technical managers.
The sections of the introduction that contain examples are designed to orient you within the Jini technology and architecture. They are not a full tutorial: Think of them as a tour through the process of design and implementation in a Jini system. As with any tour, you can get the flavor of how things work and where you can start your own investigation.
The second part of the book contains the specifications themselves. Each specification has a brief introduction describing its place in the overall architecture.
The third part of the book contains supplementary material: a glossary that defines terms used in the specifications and in talking about Jini architecture, design, and technology, followed by two appendices. Appendix A is a reprint of "A Note on Distributed Computing," which describes critical differences between local and remote programming. Appendix B contains the full source code for the examples in the introductory material.
The Jini architecture is the result of a rather extraordinary string of events. But then almost everything is. The capriciousness of life--and to the fortunate, its occasional serendipity--is always extraordinary. It is only in retrospect that we examine the causes and antecedents of something interesting and decide that, because they shaped that interesting result, we will call them "extraordinary." Other events, however remarkable, go unremarked because they are unexamined. Those of us who wrote the Jini architecture, along with the many who contributed to its growth, are lucky to have a reason to examine our particular history to savor its pleasures.
This is not the proper place for a long history of the project, but it seems appropriate to give a brief summary of the highlights. The project had its origins in Sun Microsystems Laboratories, where Jim Waldo ran the Large Scale Distribution research project. Jim Waldo and Ken Arnold had previously been involved with the Object Management Group's first CORBA specification while working for Hewlett-Packard. Jim brought that experience and a long-term background in distributed computing with him to Sun Labs.
After joining the Labs, Ann Wollrath joined Jim's team. Soon thereafter, observations about many common issues in the field of distributed computing led Jim, Ann, and other authors to write "A Note on Distributed Computing," which outlined critical distinctions between local and distributed design. Many people had been trying to hide those differences under the general rubric of "local/remote transparency." The "Note" argued that this was not possible. It has become the most cited Sun Laboratories technical report, and the lessons it distills are at the core of the design approach taken by our project.
At this time the project was using Modula 3 Network Objects for experiments in distributed computing. As Modula 3 ceased to be developed, the team looked around for a replacement language. At that time Oak, the language an internal Sun project, seemed a viable replacement with some interesting new properties. To a research project, the fact that Oak was commercially insignificant was irrelevant. It was at this time that Ken rejoined Jim on his new team.
Soon after, Oak was renamed "Java."
When it was still Oak, it had once had a remote method invocation mechanism, but that was removed when the mechanism failed--it, too, had fallen into the local/remote transparency trap. When Bill Joy and James Gosling wanted to create a working distributed computing mechanism, they asked Jim to lead the effort, which switched our team from the laboratories into the JavaSoft product group. As the first result of this effort, Ann, as the Java RMI architect, steered the team on an exploration of what could be done with a language-centric approach to distributed computing (most distributed computing systems are built on language-neutral approaches).
After RMI became part of the Java platform, Bill Joy asked the team to expand its horizons to include a platform for easier distributed computing, coining the name "Jini." He convinced Sun management to put the RMI, JavaSpaces, and Jini projects into a separate unit. This new unit started with Jim, Ann, Ken, and Peter Jones, and was soon joined by Bob Scheifler who had extensive distributed computing experience from the X Windows project that he ran. This put together the original core architectural team: Jim, Ann, Ken, and Bob.
As the team grew, many people had a hand in the direction of various parts of the architecture, including Bryan O'Sullivan who took over the design of the lookup discovery protocol. Mike Clary took the project under his wing to give it time to grow. Mark Hodapp joined the team to manage its software development and run it in partnership with its technical leadership. Gary Holness, Zane Pan, Brian Murphy, John McClain, and Bob Resendes all reviewed the primary architecture documents and had responsibility for various parts of the tool design, implementation design, and the implementations themselves. Laird Dornin and Adrian Colley joined the RMI sub-team to continue and expand its development. Charlie Lamb joined the architectural team to oversee work with outside companies, starting with printing and storage service standards. Jen McGinn joined the team to document what we had done, later with the help of Susan Snyder on production support. Jimmy Torres started out as our release engineer and has changed to working on helping build our public developer community. Frank Barnaby took over the release engineering duties. Helen Leary joined early and kept our infrastructure humming along.
Our QA team was Mark Schuldenfrei and Anand Dhingra, managed by Brendan Daly. Alan Mortensen wrote the conformance tests and their infrastructure. Emily Suter and Theresa Lanowitz started out our marketing team, with Franc Romano, Donna Michael, Joan MacEachern, and Paula Kozak joining later. Jim Hurley started setting up our support organization, and Keith Thompson and Peter Marks joined to work on sales engineering. Samir Mitra led a marketing and business development team that included Jon Bostrom, Jaclyn Dahlby, Mike McNerny, Miko Matsamura, Darryl Mocek, Sharam Moradpour, and Vince Vasquez. Many others, too numerous to mention, did important work that made the Jini architecture possible and real.
The mome rath isn't born that could outgrabe me!
--Nicol Williamson
