net.artima.place
Interface Link

All Known Implementing Classes:
URLLink

public interface Link
extends java.io.Serializable

Represents a link to a resource on the network.


Method Summary
 void activate()
          Get and run the resource represented by this link, for a user.
 java.lang.Object getResourceFactory()
          Returns a resource factory that can produce an Object representation of the resource referred to by this link.
 ResourceInfo getResourceInfo()
          Get a ResourceInfo class that provides information about this resource suitable for display to users.
 java.lang.String getURL()
          Returns a URL expression of this Link, if one exists.
 boolean hasURL()
          Indicates whether or not this Link can be expressed in terms of a URL.
 

Method Detail

activate

public void activate()
              throws LinkActivationException,
                     java.rmi.RemoteException
Get and run the resource represented by this link, for a user. (We likely need several of these, one that take a timeout, one that blocks until the thing gets activated, etc.. An open question is: should a client that activates a link be allowed to know whether the activation was successful? If so, we can come up with various ways to let the client know, including an asynchronous call back.)

getResourceFactory

public java.lang.Object getResourceFactory()
Returns a resource factory that can produce an Object representation of the resource referred to by this link. The resource factory returned must implement one or more factory interfaces, such as those defined in package net.artima.place.factory. This method is used to allow software to get ahold of a resource represented by a link. (This contrasts with activate(), which allows a user to gain access to a resource represented by a link.)

getResourceInfo

public ResourceInfo getResourceInfo()
Get a ResourceInfo class that provides information about this resource suitable for display to users.

hasURL

public boolean hasURL()
Indicates whether or not this Link can be expressed in terms of a URL.

getURL

public java.lang.String getURL()
Returns a URL expression of this Link, if one exists. If this Link cannot be expressed in terms of a URL, throws NoURLAvailableException. If hasURL() returns true, this method will return a String URL.