|
ServiceItemThe service provider will create a ServiceItem object by using the constructor, shown here: package net.jini.core.lookup; public Class ServiceItem { public ServiceID serviceID; public java.lang.Object service; public Entry[] attributeSets; public ServiceItem(ServiceID serviceID, java.lang.Object service, Entry[] attrSets); } Once the service provider has created the ServiceItem object, it is passed into register() . The first parameter, serviceID , is set to null when the service is registered for the first time. The lookup service will set a non-null value as it registers the service. On subsequent registrations or re-registrations, this non-null value should be used. The serviceID is used as a globally unique identifier for the service. The second parameter, service , is the service object that is being registered. This object will be serialized and sent to the service locator for storage. When a client later requests a service, this is the object it will be given. There are several things to note about the service object:
The third parameter in the ServiceItem constructor, attrSets , is a set of entries giving information about the service in addition to the service object/service proxy itself. If there is no additional information, this can be null . |