A Jini Tutorial

Jan Newmarch

Version 0.11

27 July 1999

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

1. Contents

1.1 Chapters

  1. Overview
    1. Jini
    2. Components
    3. Service Registration
    4. Client Lookup
    5. Proxies
    6. Server Structure
    7. Client Structure
    8. Summary
  2. Running Jini
    1. The Chapter that Shouldn't Exist
    2. Java Packages
    3. Jini Packages
    4. Lookup Service
    5. RMI Stubs
  3. Discovering a Lookup Service
    1. Lookup Service
    2. Unicast discovery
    3. Broadcast discovery
    4. ServiceRegistrar
    5. Summary
  4. Entry Objects
    1. Entry class
    2. Restrictions on entries
    3. Convenience Classes
    4. Summary
  5. Service Registration
    1. ServiceRegistrar
    2. ServiceItem
    3. Registration
    4. ServiceRegistration
    5. Entries
    6. Summary
  6. Client Search
    1. ServiceRegistrar
    2. ServiceMatches
    3. Matching
    4. Summary
  7. Leasing
    1. Leases
    2. LeaseRenewalManager
    3. Granting and handling leases
    4. Summary
  8. Simple Example
    1. Problem Description
    2. Client
    3. Server Design Options
    4. Option 2: Uploading a Complete Service
    5. Option 3: Uploading a Proxy
    6. Summary
  9. Join Manager
    1. Join Manager
    2. Getting information from JoinManager
    3. Summary
  10. Security
    1. Quick Fix
    2. Why AllPermission is Bad
    3. Removing AllPermission
    4. Jini with Protection
    5. Service Requirements
    6. Client Requirements
  11. RMI
    1. Re-using RMI Proxies
    2. Using the Naming service
    3. Avoiding RMI
  12. More Complex Examples
    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
  13. Remote Events
    1. Event Models
    2. Remote Events
    3. Event Registration
    4. Listener List
    5. Listener Source
    6. File Classifier with Events
    7. Summary
  14. Lego MindStorms
    1. MindStorms
    2. MindStorms as a Jini Service
    3. RCXPort
    4. RCX Programs
    5. Jini classes
    6. Getting it running
    7. Entry objects for a robot
    8. Adding entries to a server
    9. A client-side RCX class
    10. Higher level mechanisms: Not Quite C
    11. Summary
  15. Architecture
    1. Threads
  16. etc (to come :-)

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. You might not like what you get from this doc file - 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. Another perl program, docbook2html.pl, will convert them standalone, but it will leave the hypertext links pointing to the XML files.

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

The author is currently on a sabbatical program at the CRC for Distributed Systems Technology, http://www.dstc.edu.au and 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.


This file is Copyright (©) 1999 by Jan Newmarch (http://jan.newmarch.name) jan@newmarch.name.

This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v0.4 or later (the latest version is presently available at http://www.opencontent.org/openpub/). Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.