29.

previous chapter table of contents next chapter
  

ServiceRegistrar

A server for a service finds a service locator using either a unicast lookup with a LookupLocator or a multicast search using LookupDiscovery . In both cases, a ServiceRegistrar object is returned to act as a proxy for the lookup service.

The server then registers the service with the service locator using the ServiceRegistrar 's register() method:

 package net.jini.core.lookup; public Class ServiceRegistrar {     public ServiceRegistration register(ServiceItem item,                                        long leaseDuration)                                throws java.rmi.RemoteException; } 

The second parameter here, leaseDuration , is a request for the length of time (in milliseconds ) the lookup service will keep the service registered. This request need not be honored ”the lookup service may reject it completely, or only grant a lesser time interval. This is discussed in Chapter 7.

The first parameter is of ServiceItem type.

  


A Programmer[ap]s Guide to Jini Technology
A Programmer[ap]s Guide to Jini Technology
ISBN: 1893115801
EAN: N/A
Year: 2000
Pages: 189

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net