* Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
ServiceTrackerCustomizerinterface allows a
ServiceTrackerto customize the service objects that are tracked. A
ServiceTrackerCustomizeris called when a service is being added to a
ServiceTrackerCustomizercan then return an object for the tracked service. A
ServiceTrackerCustomizeris also called when a tracked service is modified or has been removed from a
The methods in this interface may be called as the result of a
ServiceEvent being received by a
ServiceEvents are synchronously delivered by the Framework, it is
highly recommended that implementations of these methods do not register (
BundleContext.registerService), modify (
ServiceRegistration.setProperties) or unregister (
ServiceRegistration.unregister) a service while being synchronized on
ServiceTracker class is thread-safe. It does not call a
ServiceTrackerCustomizer while holding any locks.
ServiceTrackerCustomizer implementations must also be thread-safe.
<> The type of the service being tracked.
<> The type of the tracked object.
This method is called before a service which matched the search
parameters of the
ServiceTracker is added to the
ServiceTracker. This method should return the service object to
be tracked for the specified
ServiceReference. The returned
service object is stored in the
ServiceTracker and is available
referenceThe reference to the service being added to the
nullif the specified referenced service should not be tracked.
ServiceTrackerhas been modified.
This method is called when a service being tracked by the
ServiceTracker has had it properties modified.
referenceThe reference to the service that has been modified.
serviceThe service object for the specified referenced service.