Openwings API Documentation (v1.1)

net.openwings.component
Interface UseServiceListener


public interface UseServiceListener

This interface defines a callback which can be passed to the useService() methods of the Component interface to register ongoing interest in certain services. The criteria used to identify these services consists of the service interface and (optional) UseServiceParameters object passed to useService()


Method Summary
 void providedServiceRemoved(UniqueID service)
          This callback method is invoked whenever a service provider calls the removeService() of the Component interface on a service object previously passed to serviceProvided().
 void serviceProvided(java.lang.Class serviceInterface, ServiceResult serviceResult)
          This callback method is invoked when a new service becomes available which meets the criteria passed to the useService() method of the Component interface.
 

Method Detail

serviceProvided

public void serviceProvided(java.lang.Class serviceInterface,
                            ServiceResult serviceResult)
This callback method is invoked when a new service becomes available which meets the criteria passed to the useService() method of the Component interface. The Class object serviceInterface fully describes the service being used, so the same UseServiceListener could listen for different types of services.

If an application or other interface is to be attached to the service, that attachment would take place before the serviceProvided() method is called.

Parameters:
serviceInterface - interface describing the service provided.
serviceResult - object containing the provided service plus additional information such as the service unique identifier.

providedServiceRemoved

public void providedServiceRemoved(UniqueID service)
This callback method is invoked whenever a service provider calls the removeService() of the Component interface on a service object previously passed to serviceProvided().


Openwings API Documentation (v1.1)