Package org.opennms.netmgt.dao.api
Interface ServiceTracker
-
- All Known Implementing Classes:
DefaultServiceTracker
public interface ServiceTracker
Tracking services is a pain - use this service to handle it for you.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ServiceTracker.ServiceListener
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.Closeable
trackService(java.lang.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.java.io.Closeable
trackServiceMatchingFilterRule(java.lang.String serviceName, java.lang.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.
-
-
-
Method Detail
-
trackServiceMatchingFilterRule
java.io.Closeable trackServiceMatchingFilterRule(java.lang.String serviceName, java.lang.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. Additional callback will be made as services are added/removed.- Parameters:
serviceName
- 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 callbacks- Returns:
- close when done watching
-
trackService
java.io.Closeable trackService(java.lang.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. Additional callback will be made as services are added/removed.- Parameters:
serviceName
- only interfaces with the given service name attached will be consideredlistener
- used for callbacks- Returns:
- close when done watching
-
-