Page 2 of 5
Let's look at an example of how Jini works in an actual system. We'll use an inventory management system based on an idea brought up during the Conference on Electronic Commerce and Marketplace last April at the University of Austin. You're given an inventory management system in which each type of item in the inventory is managed by an agent. The agent is responsible for allocating ("selling") its items to the agents requesting ("buying") them. Essentially, with competing agents providing products of a similar type, you create a stock market-like exchange system with agents bidding for items to satisfy a request. A real-world example of this system might be the relationship between a car parts dealer and the various manufacturers selling the parts.
In a JavaSpaces system, a customer would go to the car parts dealer and put in a request for a carburetor for a 1989 4-cylinder
Chevy Beretta. The order goes into the distributed JavaSpaces system (a "space"). It first enters the subsection of the space
represented by the warehouse, or the warehouse space. This warehouse space then negotiates with the subsections of the car
manufacturers (the car manufacturer's spaces) or parts distributors (the parts distributors' space). It issues a template
describing the part. The various spaces respond with a list of available entries. The warehouse space server object compares
them for price, features, reliability, and so on, and then issues either a read operation in the case of a car manufacturer (since it can make any number of identical copies of the part), or a take operation in the case of a parts distributor (since it has a given supply of the part); in truth, the car manufacturer space
doesn't have an unlimited supply, but this is just an example. Let's say the customer wants to give back its defective carburetor,
which is usually sent back to the manufacturer because it may be recoverable. In this case, the client reads the part from the car parts store warehouse space and writes it to the car manufacturers space.
During our analysis and in talking to other developers, it becomes clear that Jini and JavaSpaces share similarities with a number of existing technologies. To give you a firm understanding, we'll make a few comparisons.
First, let's compare JavaSpaces-Jini with some of the other technologies from Sun's Java Software Division. JavaSpaces is a system for developing distributed applications. A distributed application usually consists of components running on several machines that communicate with each other to process the application. Think of this as a server-side application, where the server application is broken into several parts, each running on a different machine but still working as a whole.
Sun JavaServer
The Sun JavaServer (a.k.a. Jeeves) is simply an extended Web server with a backend programming interface that allows you
to create servlets. It is directly comparable to the traditional CGI model, whereby accessing a link on a Web page can execute
a program. However, servlets do not break into separate applications that automatically run across several computers to execute
your program. You can make them do that, but you'll have to build the mechanism yourself.