Interface IRemoteServiceTrackerCustomizer
- All Known Implementing Classes:
RemoteServiceTracker
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 Summary
Modifier and TypeMethodDescriptionaddingService
(IRemoteServiceReference reference) A service is being added to theRemoteServiceTracker
object.void
modifiedService
(IRemoteServiceReference reference, IRemoteService remoteService) A remote service tracked by theRemoteServiceTracker
object has been modified.void
removedService
(IRemoteServiceReference reference, IRemoteService remoteService) A remote service tracked by theRemoteServiceTracker
object has been removed.
-
Method Details
-
addingService
A service is being added to theRemoteServiceTracker
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 thisIRemoteServiceReference
object. The returned remote service object is stored in theRemoteServiceTracker
object and is available from thegetRemoteService
andgetRemoteServices
methods.- Parameters:
reference
- remote reference to remote service being added to theRemoteServiceTracker
object.- Returns:
- The remote service object to be tracked for the
IRemoteServiceReference
object ornull
if theIRemoteServiceReference
object should not be tracked.
-
modifiedService
A remote service tracked by theRemoteServiceTracker
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
A remote service tracked by theRemoteServiceTracker
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.
-