Java Reference
In-Depth Information
protocols. It can use a LookupLocator , a LookupDiscovery , or a LookupLocatorDiscovery to discover a
lookup service.
When the client has discovered a lookup service it receives an instance of a ServiceRegistrar . The
ServiceRegistrar is very likely to be a remote object and the instance received is a proxy to that remote object.
Every service in Jini has a unique ID. A lookup service is a Jini service, so it has an unique ID. That ID should be received by the
service once and afterwards remembered whenever it restarts. Although the ServiceRegistrar proxy forwards most calls to
the remote object it doesn't make sense to make an expensive remote call when the result doesn't change.
Therefore the service proxy keeps an attribute with the value of the service ID of the lookup service.
Proxy (see page 197): The meaning of a proxy in Jini is broader than the Proxy design pattern. In the Proxy
design pattern, a proxy is a placeholder to another object. In Jini the part of the service that is downloaded to the
service consumer is called the service proxy. But that service proxy might very well be the full service, completely
transparent to the consumer.
Observer (see page 94): When a service consumer is looking for a specific type of service, the service might not
be available at the time of the request. It would be inefficient to repeat the lookup until a service is found. It is
much better to do the lookup once and be notified when a change has occurred. To do that the client uses the
notify method on the ServiceRegistrar object. Because this involves remote event handling the consumer
supplies the template for the service it is looking for, the handback object, the remote listener instance to be
notified of the change, a requested lease duration and the type of transitions.
Search WWH ::




Custom Search