Lookup
From Jini.org
Jini services locate each other through specific lookup mechanisms. Lookup centers around lookup services such as Reggie, which keep track of the services available in a djinn.
Clients discover lookup services through one of two mechanisms:
- Unicast discovery - if the host and port of a lookup service is known, it is called directly
- Multicast discovery - a UDP broadcast is used to find available lookup services on the network
Once a lookup service is discovered, a client retrieves a proxy from it. The client then uses the proxy to perform lookups for the services it wants to call.
A client performs a lookup mainly by specifying a Java interface that the desired service must implement. For example, if a client wants a printer service, it may ask the lookup service for something that implements Printer. The client can also include entries (attributes) that provide further details about the desired service; for example, perhaps the Printer service needs to be able to print in color, or double-sided. It is up to each service, when it registers with a lookup service, to provide values for entries that clients may use. (Proxies that are exported automatically implement the same interfaces that their corresponding services implement, so nothing special has to be done for that.)
In response, the lookup service returns one or more proxies for services that match what the client asked for. At this point, the client has successfully looked up services and can call them directly.
