public void addListener(ComponentEventListener listener) {
        listeners.add(listener);
        // Notify the new listener about existing components
        for (String domain : routingTable.getComponentsDomains()) {
            JID componentJID = new JID(domain);
            listener.componentRegistered(componentJID);
            // Check if there is disco#info stored for the component
            IQ disco = componentInfo.get(domain);
            if (disco != null) {
                listener.componentInfoReceived(disco);
            }
        }
    }
Adds a new listener that will be notified of component events. Events being
notified are: 1) when a component is added to the component manager, 2) when
a component is deleted and 3) when disco#info is received from a component.

@param listener the new listener to notify of component events.
xmppserver/src/main/java/org/jivesoftware/openfire/component/InternalComponentManager.java