Interface Link

All Superinterfaces:
All Known Implementing Classes:
URLFactoryLink, MulticastDiscoveryLink, UnicastDiscoveryLink, MarshalledServiceItemLink, WebServerLink

public interface Link

Represents a link to a service on the network. The result of any successful link activation is a Jini service item, passed to the ActivationClient via the activationSucceeded method.

Method Summary
 net.jini.core.lookup.ServiceItem retrieveService()
          Retrieve this service.
 void stopRetrieval()
          Requests a retrieval to stop.

Method Detail


public net.jini.core.lookup.ServiceItem retrieveService()
                                                 throws java.rmi.RemoteException,
Retrieve this service. This method is idempotent: If a retrieval is already in progress by one thread, and onother thread invokes this method, both threads will return the same ServiceItem, or throw the same exception. In this context, "same ServiceItem" means either a reference to the exact same ServiceItem object, or different references to multiple ServiceItem objects all of which are semantically equal (as defined by their equals method) to each other.
the ServiceItem object with which the client can interact
java.rmi.RemoteException - to indicate any sort of failure in retrieving the service
StoppedException - to indicate that the retrieval was stopped by invoking the stopRetrieval method


public void stopRetrieval()
Requests a retrieval to stop. If the retrieval is still progressing, and has not previously succeeded, failed, or been stopped, then the retrieval will stop. Otherwise, invoking stopRetrival() has no effect. The stopRetrieval() method does not throw an exception to indicate the activation has already succeeded, failed, or been aborted, but returns normally in these cases.