Add a listener to the chain.
@param theBehavior Listener or Filter to add to this record - calls doAddListener.
187649
public void addListener(BaseListener listener)
    {
        listener.setNextListener(null);  // Just being safe
        if (this.getTable() != null)
            this.getTable().addListener(this, (FileListener)listener);   // Give the table a chance to clone this or whatever.
        else
            this.doAddListener((FileListener)listener);
    }
1008389
public void addLifecycleListener(java.util.EventListener listener) {
        String listenerClassName = getClassName(listener);
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                logger.entering(CLASS_NAME, "addLifecycleListener : listenerClass = " + listenerClassName);     
        }       

        if (listener != null) {
            if (listener instanceof javax.servlet.ServletContextListener) {
                addServletContextListener(listener);
            }
            if (listener instanceof javax.servlet.ServletContextAttributeListener) {
                // add to the context attr listener list
                servletContextLAttrListeners.add(listener);
            }

            if (listener instanceof javax.servlet.http.HttpSessionListener) {
                // add to the session listener list
                this.sessionCtx.addHttpSessionListener((javax.servlet.http.HttpSessionListener) listener, name);

                // 434577
                // add to a mirror list because we can't get access to the list
                // the
                // session context is holding on to later on.

                this.sessionListeners.add(listener);
                this.addedSessionListeners.add(listener);
            }
            
            // Servlet 3.1
            checkForSessionIdListenerAndAdd(listener);

            // \PK34418 begins
            if (listener instanceof javax.servlet.http.HttpSessionAttributeListener) {
                // add to the session attribute listener list
                if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                    logger
                            .logp(Level.FINE, CLASS_NAME, "addLifecycleListener",
                                    "listener instanceof javax.servlet.http.HttpSessionAttributeListener");
                    logger.logp(Level.FINE, CLASS_NAME, "addLifecycleListener", "name : " + name);
                }
                this.sessionCtx.addHttpSessionAttributeListener((HttpSessionAttributeListener) listener, name);

                // 434577
                // add to a mirror list because we can't get access to the list
                // the
                // session context is holding on to later on.

                this.sessionAttrListeners.add(listener);
                this.addedSessionAttrListeners.add(listener);

            }// PK34418

            // 2.4 Listeners
            if (listener instanceof javax.servlet.ServletRequestListener) {
                servletRequestListeners.add(listener);
            }
            if (listener instanceof javax.servlet.ServletRequestAttributeListener) {
                servletRequestLAttrListeners.add(listener);
            }

            if (listener instanceof javax.servlet.http.HttpSessionActivationListener) {
                sessionActivationListeners.add(listener);
            }

            if (listener instanceof javax.servlet.http.HttpSessionBindingListener) {
                sessionBindingListeners.add(listener);
            }
        }
        logger.exiting(CLASS_NAME, "addLifecycleListener");
    }
1191737
public void addListener(final PathAlterationListener listener) {
    if (listener != null) {
      this.listeners.put(listener, new ExceptionCatchingPathAlterationListenerDecorator(listener));
    }
  }
558265
public void addListener(ILabelProviderListener listener)
	{
		if (fListeners == null)
		{
			fListeners = new ListenerList();
		}
		fListeners.add(listener);
		if (fProblemChangedListener == null)
		{
			fProblemChangedListener = new IProblemChangedListener() {
				public void problemsChanged(IResource[] changedResources,
						boolean isMarkerChange)
				{
					fireProblemsChanged(changedResources, isMarkerChange);
				}
			};
			VdmUIPlugin.getDefault()
					.getProblemMarkerManager()
					.addListener(fProblemChangedListener);
		}
	}
1043914
public void addBehavior(String behaviorId, String behaviorClass)
    {
        Application application = getMyfacesApplicationInstance();
        if (application != null)
        {
            application.addBehavior(behaviorId, behaviorClass);
            return;
        }
        throw new UnsupportedOperationException();
    }
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);
    }
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);
            }
        }
    }
29945
public void addListener(UpdateCheckListener newListener) {
        if (newListener == null) {
            throw new IllegalArgumentException("newListener");
        }
        GatewayVersion latestGatewayVersion = getLatestGatewayVersion();
        if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) {
            newListener.newVersionAvailable(currentVersion, latestGatewayVersion);
        }
        listeners.add(newListener);
    }
1012597
public void addOnTransactionBroadcastListener(Executor executor, OnTransactionBroadcastListener listener) {
        peersTransactionBroadastEventListeners.add(new ListenerRegistration<>(checkNotNull(listener), executor));
        for (Peer peer : getConnectedPeers())
            peer.addOnTransactionBroadcastListener(executor, listener);
        for (Peer peer : getPendingPeers())
            peer.addOnTransactionBroadcastListener(executor, listener);
    }
381162
public void addListeners()
    {
        super.addListeners();
        
        this.getField(Person.NAME).removeListener(this.getField(Person.NAME).getListener(CopyLastHandler.class), true);    // Only if dest is null (ie., company name is null)
        this.getField(Person.NAME).addListener(new CopyFieldHandler(this.getField(Person.NAME_SORT)));
        this.getField(Company.NAME_SORT).addListener(new CheckForTheHandler(null));
        
        CopyLastHandler listener = new CopyLastHandler(this.getField(Company.NAME_SORT));
        this.getField(Company.CONTACT).addListener(listener);    // Only if dest is null (ie., company name is null)
        listener.setOnlyIfDestNull(true);
    }
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);
    }
1288989
public void addProviderListener(ConsumerConfig consumerConfig, ProviderInfoListener listener) {
        if (listener != null) {
            RegistryUtils.initOrAddList(providerListenerMap, consumerConfig, 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();
	}
678218
public static void addListener(String name, LogEventListener listener) {
    Map<String, LogEventListener> threadListeners = listeners.get();
    if (threadListeners == null) {
      threadListeners = new HashMap<>();
    }

    threadListeners.put(name, listener);
    listeners.set(threadListeners);
  }
639590
public void addListener(final WebAppListener listener) {
		NullArgumentException.validateNotNull(listener, "Listener");
		NullArgumentException.validateNotNull(listener.getListenerClass(),
				"Listener class");
		if (!listeners.contains(listener)) {
			listeners.add(listener);
		}
	}
404252
@NonNull
    public IconicsAnimationProcessor addListener(@NonNull IconicsAnimationListener listener) {
        if (mListeners == null) {
            mListeners = new ArrayList<>();
            mAnimator.addListener(mProxyListener);
        }
        mListeners.add(listener);
        return this;
    }
1061728
public void addPagingBehavior(PagingBehavior pagingBehavior) {
		checkInitialized();

		// avoid adding the same type(!) of behavior twice, error out if that's the case
		boolean behaviorTypeAdded = pagingBehaviors
				.stream()
				.anyMatch(pbh -> pbh.getClass().equals(pagingBehavior.getClass()));

		if (!behaviorTypeAdded) {
			pagingBehaviors.add(pagingBehavior);
		}
		else {
			throw new IllegalArgumentException(
					"PagingBehavior of same type already added. Type:"
							+ pagingBehavior.getClass().getSimpleName());
		}
	}