com.artima.place
Interface ServicePresenter


public interface ServicePresenter

Contains presentService methods that allow clients to request that the service host (likely a user agent such as a browser) present a service to the user. The service to present can be specified via a Link, LinkItem, or ServiceItem. The host can give the user feedback about the progress of service retrieval. The host can, for example, show an animation, status messages, progress bar, etc., during service retrieval.


Method Summary
 void presentService(Link link)
          Presents a service to a user.
 void presentService(LinkItem item)
          Presents a service to a user.
 void presentService(net.jini.core.lookup.ServiceItem item)
          Presents a service to a user.
 net.jini.lookup.entry.UIDescriptor selectUI(net.jini.lookup.entry.UIDescriptor[] descs)
          Selects the UIDescriptor representing the best fit UI among the UIDescriptors in the passed array.
 

Method Detail

presentService

public void presentService(Link link)
Presents a service to a user. This method will return promptly. If the method needs to do something on the network, which it often will, that something will need to be done in a different thread. This means that a GUI event handler thread should be able to safely invoke this method directly without fear that doing so will "hang" their UI.
Parameters:
link - the Link that, when activated, will produce a service to present to the user.

presentService

public void presentService(net.jini.core.lookup.ServiceItem item)
Presents a service to a user. This method will return promptly. If the method needs to do something on the network, which it often will, that something will need to be done in a different thread. This means that a GUI event handler thread should be able to safely invoke this method directly without fear that doing so will "hang" their UI.
Parameters:
item - a ServiceItem containing the service to present to the user.

presentService

public void presentService(LinkItem item)
Presents a service to a user. This method will return promptly. If the method needs to do something on the network, which it often will, that something will need to be done in a different thread. This means that a GUI event handler thread should be able to safely invoke this method directly without fear that doing so will "hang" their UI.

This method contrasts with the presentService method that takes simply a Link by including a set of attributes as well as the Link, both of which are contained in the LinkItem passed to the method. The service presenter can use these attributes to provide better feedback to the user. For example, instead of just saying "Starting service...," the service presenter could be more specific, as in "Starting Calculator service..." by grabbing the name "Calculator" from the Name attribute.

Parameters:
item - a LinkItem containing the Link that, when activated, will produce a service to present to the user, and attributes that may be used to provide feedback to the user during the activation.

selectUI

public net.jini.lookup.entry.UIDescriptor selectUI(net.jini.lookup.entry.UIDescriptor[] descs)
Selects the UIDescriptor representing the best fit UI among the UIDescriptors in the passed array. If no suitable UIDescriptor exists in the passed array, returns null. If a non-null reference is returned, will definitely be one of the UIDescriptors in the passed array.
Parameters:
descs - a ServiceItem containing the service to present to the user.
Returns:
a best fit UIDescriptor selected from the passed array