public class ServiceAvailableTracker<S> extends Object implements AutoCloseable
| Constructor and Description |
|---|
ServiceAvailableTracker(org.osgi.framework.BundleContext bundleContext,
org.osgi.framework.Filter filter,
Consumer<org.osgi.framework.ServiceReference<S>> onServiceAvailable,
Runnable onServiceUnavailable) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this
ServiceTracker. |
void |
open()
Open this
ServiceTracker and begin tracking services. |
void |
open(boolean trackAllServices)
Open this
ServiceTracker and begin tracking services. |
public void open()
ServiceTracker and begin tracking services.IllegalStateException - If the BundleContext with
which this ServiceTracker was created is no longer valid.open(boolean)public void open(boolean trackAllServices)
ServiceTracker and begin tracking services.
Services which match the search criteria specified when this
ServiceTracker was created are now tracked by this
ServiceTracker.
trackAllServices - If true, then this ServiceTracker
will track all matching services regardless of class loader
accessibility. If false, then this ServiceTracker
will only track matching services which are class loader
accessible to the bundle whose BundleContext is used by
this ServiceTracker.IllegalStateException - If the BundleContext with
which this ServiceTracker was created is no longer valid.public void close()
ServiceTracker.
This method should be called when this ServiceTracker should end
the tracking of services.
close in interface AutoCloseableCopyright © 2013–2020 mklinger GmbH. All rights reserved.