Jan Newmarch's Guide to Jini Technologies

Jan Newmarch

Version 4.03

23 March 2006

http://jan.newmarch.name/java/jini/tutorial/Jini.xml

1. Contents

This version uses Jini 2.1. For a version using Jini 2.0, see http://jan.newmarch.name/java/jini/tutorial.2.08/Jini.html For a version using Jini 1.1 or 1.2, see http://jan.newmarch.name/java/jini/tutorial.2.08/Jini.html For a version using Jini 1.0, see http://jan.newmarch.name/java/jini/tutorial.1.03/Jini.html .

This book is being revised to use Jini 2.1. So far many chapters have been revised and checked (against Jini 2.1) and there are several new chapters (Jeri,Config, Logging, ServiceStarter, Advanced Security). In time, the remaining chapters will be converted. The new Jeri stuff is covered and the new security.

As an aid to the reader, there are additional tags

New material is in a different colour

and changed material is also in a different colour

Chapter versions labelled "4.00" contain changes usually related to Jini 2.1.

1.1 Chapters

This material has been adapted/checked against Jini 2.1:

  1. Overview (Last modified: version 4.01)
    1. Jini
    2. Eight Fallacies of Distributed Computing
    3. Success Stories
    4. Jini in One Hour
    5. Components
    6. Service Registration
    7. Client Lookup
    8. Proxies
    9. Client Structure
    10. Server Structure
    11. Partitioning an Application
    12. Support Services
    13. The End of Protocols
    14. Summary
  2. TroubleShooting Jini (Last modified: version 4.01)
    1. The Chapter that Shouldn't Exist
    2. Java Packages
    3. Jini and Java Versions
    4. Jini Packages
    5. HTTP Server
    6. Network Configuration
    7. Could not obtain preferred value for...
    8. Lookup Service
    9. RMI Stubs
    10. Garbage Collection
    11. Debugging
    12. Logging
  3. Ant (Last modified: version 4.01)
    1. Introduction
    2. Toplevel build file
    3. Project files
  4. Discovering a Lookup Service (Last modified: version 4.01)
    1. Lookup Service
    2. Unicast discovery
    3. Broadcast discovery
    4. ServiceRegistrar
    5. Summary
  5. Entry Objects (Last modified: version 2.02)
    1. Entry class
    2. Restrictions on entries
    3. Convenience Classes
    4. Further Uses of Entries
    5. Summary
  6. Service Registration (Last modified: version 4.01)
    1. ServiceRegistrar
    2. ServiceItem
    3. Registration
    4. ServiceRegistration
    5. Entries
    6. Summary
  7. Client Search (Last modified: version 4.01)
    1. ServiceRegistrar
    2. ServiceMatches
    3. Matching
    4. Summary
  8. Leasing (Last modified: version 4.01)
    1. Leases
    2. Granting and handling leases
    3. Summary
  9. Simple Example (Last modified: version 4.01)
    1. Problem Description
    2. Service Specification
    3. Common Classes
    4. Client
    5. Service Proxy
    6. Uploading a Complete Service
    7. Summary
  10. Jini Extensible Remote Invocation (Last modified: version 3.04)
    1. Jeri
    2. Traditional RMI
    3. Exporter
    4. Jeri
    5. Exported interfaces
    6. Configuration
    7. JRMP Proxies
    8. Basic Jeri Exporter
    9. Garbage Collection
    10. Proxy Accessor
    11. More Information
  11. Choices for Service Architecture (Last modified: version 3.03)
    1. Proxy Choices
    2. RMI Proxy for FileClassifier
    3. Non-RMI Proxy for FileClassifier
    4. RMI and non-RMI Proxies for FileClassifier
    5. Using the Naming service
    6. Using Other Services
  12. Discovery Management (Last modified: version 3.00)
    1. Management Interfaces
    2. LookupLocatorDiscovery
    3. LookupDiscoveryManager
    4. Conclusion
  13. Join Manager (Last modified: version 3.03)
    1. Join Manager
    2. Summary
  14. Basic Security (Last modified: version 2.06)
    1. Quick Fix
    2. Why AllPermission is Bad
    3. Removing AllPermission
    4. Jini with Protection
    5. Service Requirements
    6. Client Requirements
    7. RMI Parameters
    8. ServiceRegistrar
    9. Transaction Manager and other Activatable Services
    10. Phoenix
    11. rmid1.3
    12. Being Paranoic
  15. More Complex Examples (Last modified: version 4.01)
    1. Where is the Code
    2. Running threads from discovery
    3. Inexact Service Matching
    4. Matching using Local Services
    5. Finding a Service Once Only
    6. Leased Changes to a Service
  16. Remote Events (Last modified: version 4.01)
    1. Event Models
    2. Remote Events
    3. Event Registration
    4. Listener List
    5. Listener Source
    6. File Classifier with Events
    7. Leasing Event Listeners
    8. Monitoring Changes in Services
    9. Summary
  17. ServiceDiscoveryManager (Last modified: version 4.02)
    1. Introduction
    2. ServiceItemFilter
    3. Finding a Service Immediately
    4. Using a Filter
    5. Building a Cache of Services
    6. Monitoring Changes to the Cache
    7. Summary
  18. Example: Flashing Clocks (Last modified: version 3.06)
    1. Introduction
    2. Timer
    3. TickerTimer
    4. ComputerTimer
    5. ClockFrame
    6. TickerTimer Driver
    7. ComputerTimer Driver
    8. ClockDevice
    9. Runtime Behaviour
  19. Configuration (Last modified: version 3.02)
    1. Localhost
    2. Configuration
    3. Configuration File
    4. Configuration File
    5. Specifying the configuration
    6. Service Id
    7. Specifying codebase
    8. Localhost
    9. A generic server
  20. Logging (Last modified: version 3.01)
    1. Logging
    2. Logging LookupDiscovery
  21. ServiceStarter (Last modified: version 4.02)
    1. ServiceDescriptor
    2. Starting a nonactivatable service
    3. Starting a nonactivatable server
    4. Reggie
    5. Conclusion
  22. Advanced Security (Last modified: version 3.05)
    1. Introduction
    2. Invocation constraints
    3. Method constraints
    4. Logging
    5. Protocols
    6. Proxy preparer
    7. File classifier server
    8. Integrity
    9. Proxy verification
    10. Confidentiality
    11. Mix 'n Match
    12. Identity Management
  23. Transactions (Last modified: version 4.02)
    1. Introduction
    2. Transactions
    3. TransactionManager
    4. TransactionParticipant
    5. Mahalo
    6. Example
    7. Summary
  24. User Interfaces for Jini Services (Last modified: version 4.02)
    1. User Interfaces as Entries
    2. User Interfaces from Factory Objects
    3. Current Factories
    4. Marshalling Factories
    5. UIDEscriptor
    6. File Classifier Example
    7. Support Classes
    8. Images
    9. ServiceType
    10. MindStorms
    11. Summary
  25. Activation (Last modified: version 3.04)
    1. Introduction
    2. Phoenix
    3. A Service using Activation
    4. LeaseRenewalService
    5. LookupDiscoveryService
    6. Summary
  26. Introspection (Last modified: version 3.05)
    1. Basic Service Lister
    2. Unknown services
    3. Introspection
    4. Unknown classes
  27. Extended Example: Home Audio (Last modified: version 3.06)
    1. Introduction
    2. Distributed audio
    3. Parameters for A/V
    4. Source/sink interfaces
    5. Content interfaces
    6. Transport interfaces
    7. Linkages
    8. An HTTP source
    9. An HTTP OggVorbis source
    10. An HTTP sink
    11. Content sinks
    12. Sink implementation
    13. Servers
    14. Clients
    15. A file sink
    16. A file sink with GUI
    17. Conclusion
  28. Web Services and Jini (Last modified: version 4.03)
    1. Introduction
    2. Simple Web Service
    3. Bridging between Jini Client and Web Service (1)
    4. Bridging between Jini Client and Web Service (2)
    5. Web Service Client to Jini Service
    6. Summary

This material still uses Jini 1.2

  1. Lego MindStorms (Last modified: version 2.02)
    1. Making Hardware into Jini Services
    2. MindStorms
    3. MindStorms as a Jini Service
    4. RCXPort
    5. RCX Programs
    6. Jini classes
    7. Getting it running
    8. Entry objects for a robot
    9. A client-side RCX class
    10. Higher level mechanisms: Not Quite C
    11. Summary
  2. CORBA and Jini (Last modified: version 0.12)
    1. CORBA
    2. CORBA to Java Mapping
    3. Jini Proxies
    4. Simple Example
    5. Room Booking Example
    6. Migrating a CORBA Client to Jini
    7. Jini Service as a CORBA Object
    8. Summary
  3. Servlets (Last modified: version 2.08)
    1. Dynamic Web pages
    2. Servlets
    3. Jakarta Tomcat Configuration
    4. Servlet as Jini client
    5. Lookup Service Monitor
    6. FileClassifierServlet
    7. Deploying the Servlet
  4. Java Network Launching Protocol (Last modified: version 2.08)
    1. JNLP
    2. JNLP file
    3. Jini and JNLP Comparison
    4. Combining Jini and JNLP
    5. Configuring the Browser
    6. Non-core Files
    7. Security
    8. Setting Lookup Service Locations
    9. Example
  5. Architecture (Last modified: version 2.02)
    1. Threads

1.2 Appendices

  1. Properties used in Jini

2. Files

The source to the programs is available as a zip file programs.zip. The compiled classes are available as a zip file classes.zip.

The documentation files are also available as a zip file docs.zip. This includes HTML versions of the files. I am using XML as document format, using a mishmash of the DocBook DTD with extra tags and HTML thrown in. A Perl program, xml_handler.pl, is a handler called by my Apache Web server to deliver XML files as HTML.

Postscript versions of the documentation files are in postscript.zip. These are generated using html2ps, and I know this produces Postscript that does not print on all printers - in particular, our Kyocera printers. If you have problems printing these, let me know the solution only. Please note that the copyright license allows you to make single printed copies for your own use, but not multiple printed copies.

3. Update Information

This tutorial will be updated on a regular basis, maybe several times a week. If you want to receive an email announcement of each version release, send email to jan@newmarch.name with subject ``Jini tutorial update''

4. Feedback

I would appreciate any feedback on this tutorial, to ensure that it is correct and meets the needs of readers. The feedback that I have already received has been very valuable. Please send comments/corrections/requests, etc, to jan@newmarch.name

5. Other Resources

  1. The Jini FAQ at http://www.artima.com/jini/faq.html
  2. Jini Community Web Site http://www.jini.org/
  3. Noel Enete's ``Nuggets'' tutorial at www.enete.com/download/#_nuggets_
  4. Eran Davidov's timeservice example at www.artima.com/jini/resources/timeservice.html
  5. Roger Whitney's lecture notes on ``Java Distributed Computing'' at http://www.eli.sdsu.edu/courses/spring99/cs696/notes/
  6. Benot Marchal's articles for Digital Cat's Java Resource Center at www.javacats.com/US/articles/Ben/Jini1.html (and Jini2.html, Jini3.html, etc)
  7. Jini Home page http://www.sun.com/jini/index.html
  8. RMI Home page http://java.sun.com/products/jdk/rmi/index.html
  9. Jini mailing list jini-users@java.sun.com
  10. Jini mailing list archives http://archives.java.sun.com/archives/jini-users.html
  11. RMI mailing list rmi-users@java.sun.com
  12. RMI mailing list archives http://archives.java.sun.com/archives/rmi-users.html
  13. Jini Interface Repository for standardised service interfaces (empty at present) http://www.artima.com/jini/interrepo/

6. Changes

See the file Changes for the list of version releases and changes made between versions.

7. Copyright Information

This tutorial (and the pages it contains) are covered by the OpenContent license. This basically gives you freedom to do what you want with the document in a similar way to the GNU license for software. Any changes or additions that you make to this set of pages as a Web document must be made publically available, and may be folded into later versions of this tutorial. Any such inclusions will of course be credited with your copyright, under the OpenContent license.

On the other hand, the programs that this tutorial references are also available unbundled from the tutorial, and do not have the restriction that source derived from them must be made publically available. So you can derive your own source code from them, without having to make it public. I'm not sure what suitable license will do this...

And, of course, there is no warranty...

8. Acknowledgements

The author is grateful for comments on this tutorial from

  1. Brian Jeltema, jeltema@richdist.east.sun.com
  2. Roger Whitney, whitney@cs.sdsu.edu
  3. Robbert van den Beld, rbe@mms-dresden.de
  4. Chitrarasu Muthaiyan, chitrarasu@cswl.com
  5. Stuart Remphrey, Stuart.Remphrey@Aus.Sun.COM
  6. JJ Larrea, jlarrea@redtop.com
  7. John McClain, John.McClain@East.Sun.COM
  8. Bob Scheifler, rws@east.sun.com
  9. Michel, michel@mailblocks.com

The work reported in this tutorial has been funded in part by the Co-operative Research Centre Program through the Department of Industry, Science and Tourism of the Commonwealth Government of Australia.

9. Copyright

If you found this chapter of value, the full book "Foundations of Jini 2 Programming" is available from APress or Amazon .

This file is Copyright (©) 1999, 2000, 2001, 2003, 2004, 2005 by Jan Newmarch (http://jan.newmarch.name) jan@newmarch.name.

Creative Commons License This work is licensed under a Creative Commons License, the replacement for the earlier Open Content License.