Class ListenerTracker


  • @Beta
    @NotThreadSafe
    public class ListenerTracker
    extends Object
    Utility to keeps track of registered Listeners.

    Usage Example:

        private ListenerTracker listeners;
    
        @Activate
        protected void activate() {
            listeners = new ListenerTracker();
            listeners.addListener(mastershipService, new InternalMastershipListener())
                     .addListener(deviceService, new InternalDeviceListener())
                     .addListener(linkService, new InternalLinkListener())
                     .addListener(topologyService, new InternalTopologyListener())
                     .addListener(hostService, new InternalHostListener());
        }
    
        @Deactivate
        protected void deactivate() {
            listeners.removeListeners();
        }