Interface IRemoteServiceTrackerCustomizer

All Known Implementing Classes:
RemoteServiceTracker

public interface IRemoteServiceTrackerCustomizer
The IRemoteServiceTrackerCustomizer interface allows a RemoteServiceTracker object to customize the service objects that are tracked. The IRemoteServiceTrackerCustomizer object is called when a service is being added to the RemoteServiceTracker object. The IRemoteServiceTrackerCustomizer can then return an object for the tracked service. The IRemoteServiceTrackerCustomizer object is also called when a tracked service is modified or has been removed from the RemoteServiceTracker object.

The methods in this interface may be called as the result of a IRemoteServiceEvent being received by a RemoteServiceTracker object. Since IRemoteServiceEvent s are synchronously delivered by the Framework, it is highly recommended that implementations of these methods do not register (IRemoteServiceContainerAdapter.registerService), modify ( IRemoteServiceRegistration.setProperties) or unregister ( IRemoteServiceRegistration.unregister) a service while being synchronized on any object.

The RemoteServiceTracker class is thread-safe. It does not call a IRemoteServiceTrackerCustomizer object while holding any locks. IRemoteServiceTrackerCustomizer implementations must also be thread-safe.

Since:
3.0
  • Method Details

    • addingService

      IRemoteService addingService(IRemoteServiceReference reference)
      A service is being added to the RemoteServiceTracker object.

      This method is called before a remote service which matched the search parameters of the RemoteServiceTracker object is added to it. This method should return the IRemoteServic object to be tracked for this IRemoteServiceReference object. The returned remote service object is stored in the RemoteServiceTracker object and is available from the getRemoteService and getRemoteServices methods.

      Parameters:
      reference - remote reference to remote service being added to the RemoteServiceTracker object.
      Returns:
      The remote service object to be tracked for the IRemoteServiceReference object or null if the IRemoteServiceReference object should not be tracked.
    • modifiedService

      void modifiedService(IRemoteServiceReference reference, IRemoteService remoteService)
      A remote service tracked by the RemoteServiceTracker object has been modified.

      This method is called when a remote service being tracked by the RemoteServiceTracker object has had it properties modified.

      Parameters:
      reference - IRemoteServiceReference to service that has been modified.
      remoteService - The remote service object for the modified remote service.
    • removedService

      void removedService(IRemoteServiceReference reference, IRemoteService remoteService)
      A remote service tracked by the RemoteServiceTracker object has been removed.

      This method is called after a remote service is no longer being tracked by the RemoteServiceTracker object.

      Parameters:
      reference - IRemoteServiceReference to remote service that has been removed.
      remoteService - The service object for the removed service.