public class DefaultServiceTracker extends Object implements ServiceTracker
FilterWatcher: when the results of a filter change, we re-evaluate
the state and issue callback accordingly.ServiceTracker.ServiceListener| Constructor and Description |
|---|
DefaultServiceTracker() |
| Modifier and Type | Method and Description |
|---|---|
void |
setFilterWatcher(FilterWatcher filterWatcher) |
Closeable |
trackService(String serviceName,
ServiceTracker.ServiceListener listener)
Issues callbacks to the given listener for services that:
1) Have the given service name
Callbacks are expected to be issued immediately for all existing services that match the criteria.
|
Closeable |
trackServiceMatchingFilterRule(String serviceName,
String filterRule,
ServiceTracker.ServiceListener listener)
Issues callbacks to the given listener for services that:
1) Have the given service name
2) Match the given filter rule
Callbacks are expected to be issued immediately for all existing services that match the criteria.
|
public Closeable trackServiceMatchingFilterRule(String serviceName, String filterRule, ServiceTracker.ServiceListener listener)
ServiceTrackertrackServiceMatchingFilterRule in interface ServiceTrackerserviceName - only interfaces with the given service name attached will be consideredfilterRule - only interfaces that match the given filter will be considered
if null, or empty the filter will match everythinglistener - used for callbackspublic Closeable trackService(String serviceName, ServiceTracker.ServiceListener listener)
ServiceTrackertrackService in interface ServiceTrackerserviceName - only interfaces with the given service name attached will be consideredlistener - used for callbackspublic void setFilterWatcher(FilterWatcher filterWatcher)
Copyright © 2022. All rights reserved.