Add a listener to be notified when notifyChanged is called.
The listener must not be null. AcceptsListener must return
true for the listener.  Attempts to concurrently
register the identical listener more than once will be
silently ignored.
507797
public void addListener(EventListener l) {
        if (l == null) {
            throw new NullPointerException();
        }

        if (acceptsListener(l)) {
            synchronized (notifyLock) {
                if (listeners == null) {
                    listeners = new ArrayList<EventListener>();
                } else {
                    // identity equality check
                    for (EventListener ll : listeners) {
                        if (ll == l) {
                            return;
                        }
                    }
                }

                listeners.add(l);
            }
        } else {
            throw new IllegalStateException("Listener invalid for this notifier.");
        }
    }
957544
public final void addListener(@NonNull final HideViewOnScrollAnimationListener listener) {
        Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null");
        listeners.add(listener);
    }
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);
    }
639590
public void addListener(final WebAppListener listener) {
		NullArgumentException.validateNotNull(listener, "Listener");
		NullArgumentException.validateNotNull(listener.getListenerClass(),
				"Listener class");
		if (!listeners.contains(listener)) {
			listeners.add(listener);
		}
	}
454817
public void setListener(T listener) {
		Assert.notNull(listener, "Listener must not be null");
		Assert.isTrue(isSupportedType(listener), "Listener is not of a supported type");
		this.listener = listener;
	}
52339
private void notifyChangeListeners(final Replication.ChangeEvent changeEvent) {
        if (changeListenerNotifyStyle == ChangeListenerNotifyStyle.SYNC) {
            for (ChangeListener changeListener : changeListeners) {
                try {
                    changeListener.changed(changeEvent);
                } catch (Exception e) {
                    Log.e(Log.TAG_SYNC, "Unknown Error in changeListener.changed(changeEvent)", e);
                }
            }
        } else {
            // ASYNC
            synchronized (executor) {
                if (!executor.isShutdown()) {
                    executor.submit(new Runnable() {
                        @Override
                        public void run() {
                            try {
                                for (ChangeListener changeListener : changeListeners)
                                    changeListener.changed(changeEvent);
                            } catch (Exception e) {
                                Log.e(Log.TAG_SYNC, "Exception notifying replication listener: %s", e, this);
                                throw new RuntimeException(e);
                            }
                        }
                    });
                }
            }
        }
    }
544689
public void addChangeListener(javax.swing.event.ChangeListener LISTENER) {
        LISTENER_LIST.add(javax.swing.event.ChangeListener.class, LISTENER);
    }
350891
public synchronized boolean addChangeListener(ChangeListener listener) {
        if (bEnableListener && listener != null) {
            eventSource.addListener(listener);
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "addChangeListener() cacheName=" + this.cacheName + " listener=" + eventSource.getChangeListenerCount());
            }
            return true;
        }
        return false;
    }
231197
private ListenerToken addDatabaseChangeListener(Executor executor, DatabaseChangeListener listener) {
        // NOTE: caller method is synchronized.
        if (dbChangeNotifier == null) {
            dbChangeNotifier = new ChangeNotifier<>();
            registerC4DBObserver();
        }
        return dbChangeNotifier.addChangeListener(executor, listener);
    }
828096
public boolean addHangupListener(CallHangupListener listener)
    {
        boolean callStillUp = true;

        if ((this._originatingParty != null && this._originatingParty.isLive())
                || (this._acceptingParty != null && this._acceptingParty.isLive())
                || (this._transferTargetParty != null && this._transferTargetParty.isLive()))
            this._hangupListeners.add(listener);
        else
            callStillUp = false;
        return callStillUp;

    }
1070734
public synchronized void addWeakListener(L listener) {
    Preconditions.checkNotNull(listener);

    _log.info("Adding a weak listener " + listener);
    _autoListeners.put(listener, null);
  }
941163
public void addListener(TransactionableResourceManagerListener listener)
   {
      TransactionContext ctx = contexts.get();
      if (ctx == null)
      {
         throw new IllegalStateException("There is no active transaction context");
      }
      XidContext xidCtx = ctx.getXidContext();
      if (xidCtx == null)
      {
         throw new IllegalStateException("There is no active xid context");
      }
      xidCtx.addListener(listener);
   }
706907
void addNetworkReachabilityListener(NetworkReachabilityListener listener) {
        synchronized (listeners) {
            listeners.add(listener);
            if (listeners.size() == 1) { startListening(); }
        }
    }
549902
public void add(SensorListener sensorListener) {
        if (!listeners.contains(sensorListener)) {
            listeners.add(sensorListener);
            if (!isEnabled()) {
                setEnabled(true);
            }
        }
    }
450112
public void addEntityChangeListener(I_CmsEntityChangeListener changeListener, String changeScope) {

        if (m_observerdEntity == null) {
            throw new RuntimeException("The Observer has been cleared, no listener registration possible.");
        }
        if (!m_changeListeners.containsKey(changeScope)) {
            m_changeListeners.put(changeScope, new ArrayList<I_CmsEntityChangeListener>());
            // if changeScope==null, it is a global change listener, and we don't need a scope value
            if (changeScope != null) {
                // save the current change scope value
                m_scopeValues.put(changeScope, CmsContentDefinition.getValueForPath(m_observerdEntity, changeScope));
            }
        }
        m_changeListeners.get(changeScope).add(changeListener);
    }
153471
private void addChangeListener(JavaScriptObject changeListener, String changeScope) {

        try {
            System.out.println("Adding native listener for scope " + changeScope);
            m_entityObserver.addEntityChangeListener(new CmsEntityChangeListenerWrapper(changeListener), changeScope);
        } catch (Exception e) {

            CmsDebugLog.getInstance().printLine("Exception occured during listener registration" + e.getMessage());
        }
    }
1127807
public boolean addNotificationListener(String mbeanName, NotificationListener listener) throws Exception {
        if (isConnected()) {
            ObjectName objectName = new ObjectName(mbeanName);
            jmxc.addConnectionNotificationListener(listener, null, null);
            mbsc.addNotificationListener(objectName, listener, null, null);
            return true;
        } else {
            return false;
        }
    }