Interface ServiceTracker

  • All Known Implementing Classes:
    DefaultServiceTracker

    public interface ServiceTracker
    Tracking services is a pain - use this service to handle it for you.
    • Method Detail

      • trackServiceMatchingFilterRule

        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. Additional callback will be made as services are added/removed.
        Parameters:
        serviceName - only interfaces with the given service name attached will be considered
        filterRule - only interfaces that match the given filter will be considered if null, or empty the filter will match everything
        listener - used for callbacks
        Returns:
        close when done watching
      • trackService

        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. Additional callback will be made as services are added/removed.
        Parameters:
        serviceName - only interfaces with the given service name attached will be considered
        listener - used for callbacks
        Returns:
        close when done watching