Method addChainEventListener. Enables external entities to be
notified of chain events on each of the chains in the group
described in ChainEventListener interface.

@param listener
353385
public final void addChainEventListener(ChainEventListener listener) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addChainEventListener: " + listener);
        }
        if ((null != listener) && (!getChainEventListeners().contains(listener))) {
            // Add the listener to the set monitored by this group.
            getChainEventListeners().add(listener);
            // Add the listener to each of the chains in this group.
            // Extract the chain data array from the group data object
            for (ChainData chain : getChains()) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Adding listener to chain, " + chain.getName());
                }
                ((ChainDataImpl) chain).addChainEventListener(listener);
            }
        }
    }
754600
public void addListener( IDmListener listener ) {

		if( listener == null ) {
			this.logger.info( "An invalid DM listener failed to be added." );

		} else {
			synchronized( this.dmListeners ) {
				this.dmListeners.add( listener );
			}

			if( this.enableNotifications.get())
				listener.enableNotifications();

			this.logger.info( "The listener '" + listener.getId() + "' is now available in Roboconf's DM." );
		}

		listListeners();
	}
242354
public final void removeChainEventListener(ChainEventListener listener) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "removeChainEventListener: " + listener);
        }
        if (null != listener) {
            if (!this.chainEventListeners.remove(listener)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(this, tc, "Cannot find listener to be removed");
                }
            }
        }
    }
24021
public void registerListener(IPluginEvent listener) {
        if (pluginEventListeners1 == null) {
            pluginEventListeners1 = new ArrayList<>();
        }

        if (!pluginEventListeners1.contains(listener)) {
            pluginEventListeners1.add(listener);
        }
    }
1320738
@Override
    public synchronized void addChainEventListener(ChainEventListener cel, String chainName) throws InvalidChainNameException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addChainEventListener: chain=" + chainName + " listener=" + cel);
        }
        ChainDataImpl chainData = null;

        if (null == chainName) {
            InvalidChainNameException e = new InvalidChainNameException("Unable to register a listener for a chain with null name");
            //Race condition can occur where chain is stopped before we register the listener, no need to FFDC
            //FFDCFilter.processException(e, getClass().getName() + ".addChainEventListener", "2910", this, new Object[] { chainName, this });
            throw e;
        }

        // Handle a listener registering for events from all chains.
        if (chainName.equals(ChainEventListener.ALL_CHAINS)) {
            for (ChainData chain : this.chainDataMap.values()) {
                ((ChainDataImpl) chain).addChainEventListener(cel);
            }
            this.globalChainEventListeners.add(cel);
        } else {
            // Extract the chain config from the framework.
            chainData = this.chainDataMap.get(chainName);
            // Verify the chain config is in the framework
            if (null == chainData) {
                InvalidChainNameException e = new InvalidChainNameException("Unable to register listener for unknown chain config, " + chainName);
                //Race condition can occur where chain is stopped before we register the listener, no need to FFDC
                //FFDCFilter.processException(e, getClass().getName() + ".addChainEventListener", "2910", this, new Object[] { chainName, this });
                throw e;
            }
            chainData.addChainEventListener(cel);
        }
    }
1182419
public synchronized void addListener(CollectionProxyListener listener)
    {
        if (_listeners == null)
        {
            _listeners = new ArrayList();
        }
        // to avoid multi-add of same listener, do check
        if(!_listeners.contains(listener))
        {
            _listeners.add(listener);
        }
    }
1104360
public void addInventoryListener(InventoryListener listener) {
        this.inventoryListenerSupport.inventoryListenerRWLock.writeLock().lock();
        try {
            status.assertInitialOrStopped(getClass(), "addInventoryListener()");
            this.inventoryListenerSupport.inventoryListeners.add(listener);
            LOG.debugf("Added inventory listener [%s] for endpoint [%s]", listener, getMonitoredEndpoint());
        } finally {
            this.inventoryListenerSupport.inventoryListenerRWLock.writeLock().unlock();
        }
    }
878840
public <T> void addListener(final Listener<T> listener, final Object instance) {
		final ListenerInstancePair<T> pair = new ListenerInstancePair<T>(listener, instance);
		this.listeners.add(pair);
		final Type observableType = GenericsUtil.getEntityGenericType(listener.getClass(), 0, Listener.class);
		final Class<?> observable = GenericsUtil.guessClazz(observableType);
		if (!this.cachedListeners.containsKey(observable)) {
			this.cachedListeners.put(observable, new LinkedList<ListenerInstancePair<?>>());
		}
		for (final Map.Entry<Class<?>, List<ListenerInstancePair<?>>> entry : this.cachedListeners.entrySet()) {
			final Class<?> type = entry.getKey();
			if (observable.isAssignableFrom(type)) {
				entry.getValue().add(pair);
			}
		}
	}
890347
public synchronized void addListener(Listener<R> listener) {
        // it might be we add a listener AFTER the result is actually produced,
        // in which case we simply inform the listener immediately.
        if (isReady()) {
            if (_error != null) {
                listener.onError(_error);
            } else {
                listener.onSuccess(_result);
            }
            return;
        }

        if (_listeners == null) {
            _listeners = new LinkedList<>();
        }
        _listeners.add(listener);
    }
499744
@Override
	public void addListeners(String nodeID, Tree config) {
		Tree events = config.get("events");
		if (events != null && events.isMap()) {
			String serviceName = Objects.requireNonNull(config.get("name", (String) null));
			writeLock.lock();
			try {
				for (Tree listenerConfig : events) {
					String subscribe = listenerConfig.get("name", "");
					String group = listenerConfig.get("group", serviceName);

					// Register remote listener
					RemoteListenerEndpoint endpoint = new RemoteListenerEndpoint(transporter, nodeID, serviceName,
							group, subscribe);

					// Get or create group map
					HashMap<String, Strategy<ListenerEndpoint>> groups = listeners.get(subscribe);
					if (groups == null) {
						groups = new HashMap<String, Strategy<ListenerEndpoint>>();
						listeners.put(subscribe, groups);
					}

					// Get or create strategy
					Strategy<ListenerEndpoint> listenerStrategy = groups.get(group);
					if (listenerStrategy == null) {
						listenerStrategy = strategy.create();
						groups.put(group, listenerStrategy);
					}
					listenerStrategy.addEndpoint(endpoint);
				}
			} finally {

				// Clear caches
				emitterCache.clear();
				broadcasterCache.clear();
				localBroadcasterCache.clear();

				// Unlock reader threads
				writeLock.unlock();
			}
		}
	}
341063
@Override
    public void initialize() throws InitializationException
    {
        ListenerChain chain = new ListenerChain();
        setListenerChain(chain);

        // Construct the listener chain in the right order. Listeners early in the chain are called before listeners
        // placed later in the chain.
        chain.addListener(this);
        chain.addListener(new HTMLMacroBlockStateChainingListener(chain));
        chain.addListener(new EmptyBlockChainingListener(chain));
        chain.addListener(new MetaDataStateChainingListener(chain));
        chain.addListener(new HTMLMacroXHTMLChainingRenderer(this.linkRenderer, this.imageRenderer, chain));
    }
1171563
public void addDiscoveredEventListener(Executor executor, PeerDiscoveredEventListener listener) {
        peerDiscoveredEventListeners.add(new ListenerRegistration<>(checkNotNull(listener), executor));
    }
914054
@Override
  public void addListener(final AgentModel.Listener listener) {
    listeners.add(listener);
    listener.tasksChanged(this);
  }
626094
public void addListener(BaseListener listener)
    {
        listener.setNextListener(null);  // Just being safe
        if ((this.getRecord() != null) && (this.getRecord().getTable() != null))
            this.getRecord().getTable().addListener((FieldListener)listener, this);   // Give the table a chance to clone this or whatever.
        else
            this.doAddListener((FieldListener)listener);
    }
130724
public void doAddListener(BaseListener listener)
    {
        if (m_nextListener != null)
            m_nextListener.doAddListener(listener);
        else
            m_nextListener = listener;
    }
1321284
@Override
    public void addConnectionListener(SICoreConnectionListener listener)
                    throws SIConnectionDroppedException,
                    SIConnectionUnavailableException {

        checkValid();

        _delegateConnection.addConnectionListener(listener);

    }
783267
public boolean addEventListener(IEventListener listener) {
        log.debug("addEventListener - scope: {} {}", getName(), listener);
        return listeners.add(listener);
    }