com.artima.place
Interface ServicePresenterHolder

All Known Implementing Classes:
URLFactory

public interface ServicePresenterHolder

Interface implemented by services that may wish to activate Links on behalf of users, and delegate some or all of the Link activation responsibility to the client. A ServicePresenter represents a kind of "proxy" to the client, enabling a mobile object to ask the client to present a service to the user. When a Jini service arrives in a client, the client can determine if the service proxy implements ServicePresenterHolder, and if so, pass a ServicePresenter to that newly arrived service via the setServicePresenter method.


Method Summary
 ServicePresenter getServicePresenter()
          Gets the ServicePresenter for this service.
 void setServicePresenter(ServicePresenter presenter)
          Sets the ServicePresenter.
 

Method Detail

setServicePresenter

public void setServicePresenter(ServicePresenter presenter)
Sets the ServicePresenter. This method would usually be invoked by the client to pass in a the service presenter context object to the Presentable service, before attaching a service or client UI.
Parameters:
presenter - the ServicePresenter to which this service may wish to delegate link activations

getServicePresenter

public ServicePresenter getServicePresenter()
Gets the ServicePresenter for this service. This method will return the object passed to the setServicePresenter method in its most recent invocation. If the setServicePresenter method has not yet been invoked, this method will throw IllegalStateException.

This method could be called by a service or client UI for a service whose proxy implements ServicePresenterHolder when the UI detects that the user wishes to activate a link. The UI can delegate the actual activation activation of that link to the ServicePresenter returned by this method.

Returns:
the ServicePresenter to which this service may wish to delegate link activations