Deploy code servers in Jini systems
Set up HTTP servers for dynamic code download
By Joshua Fox, JavaWorld.com, 12/21/01
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Jini is one of Java's most exciting applications. With dynamic download of behavior, a universal code-execution platform,
and simple construction of distributed systems, it promises to bring us to an era in which disparate software and hardware
can simply locate each other and interact, without determining the communication protocol in advance.
Jini's conceptual simplicity is impressive, but newcomers may find the complexity of setting up and running a Jini system
daunting. Just to run a simple Jini system, you need to launch six or seven processes:
- The Remote Method Invocation Daemon,
rmid
- A lookup service
- An HTTP server for the lookup service
- Your application-layer Jini service
- An HTTP server for your service
- The client for your Jini service
- If callback code for events needs to be downloaded: An HTTP server for the client
The following figure illustrates this deployment process.

Deployment diagram
These HTTP servers serve jar files or classfiles to the Jini client, which uses them to run the Jini proxy in its own process
space; likewise, these servers can serve code on the client's behalf, for use in events.
HTTP servers, by themselves, are of course not Jini-specific; they are familiar from the World Wide Web. On the Web, the deployment
scenario is simple: the clients make HTTP requests from the server. In a Jini system, though, any component may need code
served on its behalf, and so we may have to set up many HTTP servers for even the simplest systems. As the Jini Testing Handbook at Jini.org puts it:
The codebase property and dynamic downloading of code can be a confusing hurdle for many Jini programmers.
We need a simple code-serving process. During development, we don't want to repeatedly stop and restart the system. Even after
development, we'd like to simplify deployment of the system, with all its associated clients, services, and HTTP servers.
Several helpful solutions exist. I review these options for serving code, and discuss their pros and cons for various scenarios.
In this article, I don't cover Jini basics, remote classloading principles, and other configuration problems, including log
files, codebase definition, and security restrictions. (See Resources for information on these topics.) Instead, I focus on technologies useful in deploying a Jini system's code-serving portion.
For this article, I assume you're using Jini's reference implementation.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- Read JavaWorld's Jiniology column for in-depth discussions of Jini technology
http://www.javaworld.com/columns/jw-jiniology-index.shtml
- "Jan Newmarch's Guide to Jini Technologies," Jan Newmarch (June 2001)
http://jan.netcomp.monash.edu.au/java/jini/tutorial/Jini.xml
- Sun's Jini homepage
http://www.sun.com/jini/
- See the Jini Community Website for community projects and Jini tools
http://www.jini.org
- The Jini Testing Handbook at the Jini Out-of-the-box Project
http://developer.jini.org/exchange/projects/outofbox/tools/jini_testing_handbook.html
- Jerome Scheuring's JavaOne 2000 presentation "Class Management Services for Jini Connection Technology Environments"
http://servlet.java.sun.com/javaone/javaone2000/pdfs/TS-1583.pdf
- Vagrant, an all-in-one-process Jini wrapper
http://developer.jini.org/exchange/projects/vagrant/
- DynaServer, a mini Web server used for dynamic classloading in RMI
http://www.dreambean.com/projects/dynaserver/
- Java Jini Tools Project, which includes Vagrant and DynaServer among other useful utilities
http://sourceforge.net/projects/jini-tools
- W. Keith Edwards's Jini site, including "The Service Writer's Toolkit" with ClassExporter, and articles "How Codebase Works"
and "Developing for Deployment"
http://www.kedwards.com/jini
- Ken Arnold's comments on a codebase service
http://archives.java.sun.com/cgi-bin/wa?A2=ind0104&L=jini-users&O=D&P=15833
- "Jini-Talk with Jim Waldo," Frank Sommers with Bill Venners (JavaWorld, November 2001) is an in-depth interview with Jini's creator
http://www.javaworld.com/javaworld/jw-11-2001/jw-1121-jiniology.html
- In "The End of Protocols," Jim Waldo discusses the principles behind Jini
http://developer.java.sun.com/developer/technicalArticles/jini/protocols.html
- The Event Service for Jiro network management technology
http://www.jiro.com/education/recipes/event/posting.html
- The Brazil project, with an embeddable and extensible server from Sun
http://www.sun.com/research/brazil/
- Also by Joshua Fox, "When Is a Singleton Not a Singleton" (JavaWorld, January 2001)
http://www.javaworld.com/jw-01-2001/jw-0112-singleton.htm
- Joshua Fox's software engineering Website
http://www.joshuafox.com
- Jakarta Ant, a convenient and powerful open source build tool for automating the complex Jini build process
http://jakarta.apache.org/ant/index.html
- Read more Jini articles in JavaWorld's Jini Index
http://www.javaworld.com/channel_content/jw-jini-index.shtml
- For more server-side Java articles, browse JavaWorld's Enterprise Java Index
http://www.javaworld.com/channel_content/jw-enterprise-index.shtml
- Subscribe to JavaWorld's free weekly email newsletters
http://www.javaworld.com/subscribe
- Speak out in our Java Forum
http://forums.idg.net/webx?13@@.ee6b802
- You'll find a wealth of IT-related articles from our sister publications at IDG.net