com.artima.place
Class URLFactoryLink

java.lang.Object
  |
  +--com.artima.place.URLFactoryLink
All Implemented Interfaces:
Link, java.io.Serializable

public final class URLFactoryLink
extends java.lang.Object
implements Link

Represents a URL-based link to a resource on the network. This class enables any resource on the web to be linked to via a Link. The URLFactory service returned by the retrieveService method of instances of this class produce one to many URLs, which must be used in the traditional way. The client must understand the protocol to use the URL.

See Also:
Serialized Form

Constructor Summary
URLFactoryLink(URLString url)
          Construct a URLFactoryLink with a URLString.
URLFactoryLink(URLString[] urls)
          Construct a URLFactoryLink with an array of URLStrings.
 
Method Summary
 net.jini.core.lookup.ServiceItem retrieveService()
          Retrieve this service.
 void stopRetrieval()
          Requests a retrieval to stop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLFactoryLink

public URLFactoryLink(URLString url)
Construct a URLFactoryLink with a URLString.
Parameters:
url - the URL to be contained in the URLFactory produced when this link is retrieved.
Throws:
NullPointerException - if passed url reference is null

URLFactoryLink

public URLFactoryLink(URLString[] urls)
Construct a URLFactoryLink with an array of URLStrings.
Parameters:
urls - the URLs, in order, to be contained in the URLFactory produced when this link is retrieved.
Throws:
NullPointerException - if passed urls array is null
java.lang.IllegalArgumentException - if passed urls array is empty
Method Detail

retrieveService

public net.jini.core.lookup.ServiceItem retrieveService()
                                                 throws java.rmi.RemoteException,
                                                        StoppedException
Retrieve this service. This method simply creates and returns a new instance of ServiceItem whose a serviceID field is null , attributeSets field is null, and service field contains a reference to the URLFactory passed to this object's constructor.
Specified by:
retrieveService in interface Link
Returns:
the ServiceItem object with which the client can interact
Throws:
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

stopRetrieval

public void stopRetrieval()
Requests a retrieval to stop. Since the retrieveService method merely creates a new ServiceItem that contains the URLFactory contained in this URLFactoryLink (in effect, returns immediately), this method does nothing.
Specified by:
stopRetrieval in interface Link