Skip to main content

skip to main content

developerWorks  >  Java technology  >

High-impact Web tier clustering, Part 2: Building adaptive, scalable solutions with JavaSpaces

All about Jini

developerWorks

Return to article.

Jini is a software substrate built on top of the Java platform's RMI mechanism that enables the creation and dissemination of spontaneously formed ad hoc networks. See the Resources section for information on where to get the latest 2.x release of the Jini Technology Starter Kit (JSK).

The operation of Jini depends on one or more distributed lookup services. A Jini client can use a lookup service to find instances of Jini services that it wants to use. The lookup is performed by type (class, interface, and so on). This enables a client to specify a Java interface, corresponding to a known set of functionalities, that a service must implement. Since the lookup service itself is a Jini service, it is sufficient to bootstrap a Jini node with a single known lookup service. This bootstrap lookup service can then be used to locate other lookup services as necessary.

A Jini node can be a client to Jini services, and it can also provide Jini services to other nodes -- thus acting as a server. A service registers its availability with the set of lookup services that its potential clients may use. This registration includes the designation of a Jini proxy object. A Jini proxy object is a Java object that will be dynamically downloaded to the client. The proxy runs inside the client's JVM, supplying the requested functionality locally. The proxy is a client's only interface to a Jini service. There is very little restriction on how a proxy must be implemented. However, a proxy typically makes a call back to the Jini server through RMI or other network means to perform the required work. In this way, people often draw parallels between Jini proxies and downloadable "drivers" for devices. As you can imagine, a robust security infrastructure is necessary because proxy code is remotely downloaded and executed on the local VM.

JavaSpaces and other Jini services
A JavaSpaces implementation is a Jini service and can be located in a Jini network through a lookup service. The JavaSpaces reference implementation that we used in this article is called outrigger, and is supplied as part of the JSK, which also includes reference implementation for lookup, transaction, and lease renewal services, among others. For details of these reference Jini service implementations, consult the JSK documentation (see Resources for a link).

Enhanced security in Jini 2
Starting with Jini 2 (the latest available version at the time of writing), the Jini security infrastructure has been significantly enhanced. As with previous versions, Jini 2 continues to support the Java 2 trust-based, fine-grain security model configured with policy files. In addition, a constraints-based model is implemented to control remote calls. Unlike standard RMI calls, Jini remote calls are now constrained by the new security infrastructure. To assist in handling the security infrastructure, a proxy object on the client side must first be prepared by a ProxyPreparer instance before use. A remote object exported on the server side should be exported using a Jini security exporter. Remote call constraints are expressed generically (for example, a constraint may be: one must authenticate the server before a call on proxy), and can be made configurable during deployment time without recompiling the code. Specific security implementations are "pluggable" and may use standard protocols (SSL, Kerboros, and so on) to satisfy the constraints. Refer to the JSK 2.x documentation (see Resources) for more detailed information on the new Jini 2 security infrastructure.

Return to article.