public interface IRemoteServiceTrackerCustomizer
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.
Modifier and Type | Method and Description |
---|---|
IRemoteService |
addingService(IRemoteServiceReference reference)
A service is being added to the
RemoteServiceTracker object. |
void |
modifiedService(IRemoteServiceReference reference,
IRemoteService remoteService)
A remote service tracked by the
RemoteServiceTracker object has been
modified. |
void |
removedService(IRemoteServiceReference reference,
IRemoteService remoteService)
A remote service tracked by the
RemoteServiceTracker object has been
removed. |
IRemoteService addingService(IRemoteServiceReference reference)
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.
reference
- remote reference to remote service being added to the
RemoteServiceTracker
object.IRemoteServiceReference
object or null
if
the IRemoteServiceReference
object should not be tracked.void modifiedService(IRemoteServiceReference reference, IRemoteService remoteService)
RemoteServiceTracker
object has been
modified.
This method is called when a remote service being tracked by the
RemoteServiceTracker
object has had it properties modified.
reference
- IRemoteServiceReference to service that has been modified.remoteService
- The remote service object for the modified remote service.void removedService(IRemoteServiceReference reference, IRemoteService remoteService)
RemoteServiceTracker
object has been
removed.
This method is called after a remote service is no longer being tracked by the
RemoteServiceTracker
object.
reference
- IRemoteServiceReference to remote service that has been removed.remoteService
- The service object for the removed service.