--- ADD LOCAL LISTENER ---
195012
@Override
	public void addListeners(String serviceName, Service service) {

		// Service name with version
		String name = (serviceName == null || serviceName.isEmpty()) ? service.getName() : serviceName;
		Class<? extends Service> clazz = service.getClass();
		Field[] fields = clazz.getFields();

		boolean hasListener = false;
		writeLock.lock();
		try {

			// Initialize listeners in service
			for (Field field : fields) {

				// Register event listener
				if (Listener.class.isAssignableFrom(field.getType())) {
					hasListener = true;

					// Name of the action (eg. "service.action")
					String listenerName = nameOf(name, field);

					// Process "Subscribe" annotation
					Subscribe s = field.getAnnotation(Subscribe.class);
					String subscribe = null;
					if (s != null) {
						subscribe = s.value();
					}
					if (subscribe == null || subscribe.isEmpty()) {
						subscribe = listenerName;
					}

					// Process "Group" annotation
					String group = null;
					Group g = field.getAnnotation(Group.class);
					if (g != null) {
						group = g.value();
					}
					if (group == null || group.isEmpty()) {
						group = name;
					}

					// Register listener in EventBus
					field.setAccessible(true);
					Listener listener = (Listener) field.get(service);

					// 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> strategy = groups.get(group);
					if (strategy == null) {
						strategy = this.strategy.create();
						groups.put(group, strategy);
					}

					// Add endpoint to strategy
					strategy.addEndpoint(new LocalListenerEndpoint(executor, nodeID, name, group, subscribe, listener,
							asyncLocalInvocation));
				}
			}
		} catch (Exception cause) {
			logger.error("Unable to register local listener!", cause);
		} finally {

			// Clear caches
			if (hasListener) {
				emitterCache.clear();
				broadcasterCache.clear();
				localBroadcasterCache.clear();
			}

			// Unlock reader threads
			writeLock.unlock();
		}
	}
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);
    }
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);
			}
		}
	}
1004751
synchronized void addListener(final AbstractEventListener<?> listener) {
        if (null == listener) {
            throw new NullPointerException();
        }

        final String eventType = listener.getEventType();
        if (null == eventType) {
            throw new NullPointerException();
        }

        List<AbstractEventListener<?>> listenerList = listeners.get(eventType);
        if (null == listenerList) {
            listenerList = new ArrayList<>();
            listeners.put(eventType, listenerList);
        }

        listenerList.add(listener);
    }
110471
function _addListeners() {
        // Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first
        _removeListeners();

        DocumentModule.on("documentChange", _documentChangeHandler);
        FileSystem.on("change", _debouncedFileSystemChangeHandler);
        DocumentManager.on("fileNameChange",  _fileNameChangeHandler);
    }
344921
public synchronized void addListener(String threadPrefix,
			EventListener listener) {
		if (threadPrefix.trim().equals("")) {
			globalListeners.addElement(listener);
		} else {
			keyedListeners.put(threadPrefix.trim(), listener);
		}
	}
1096768
public void addListener(EnvLoaderListener listener)
  {
    super.addListener(listener);
    synchronized (_listeners) {
      for (int i = _listeners.size() - 1; i >= 0; i--) {
        EnvLoaderListener oldListener = _listeners.get(i);

        if (listener == oldListener) {
          return;
        }
        else if (oldListener == null)
          _listeners.remove(i);
      }

      _listeners.add(listener);
    }

    if (getLifecycle().isStarting()) {
      listener.environmentBind(this);
    }

    if (getLifecycle().isStarting() && _isConfigComplete) {
      listener.environmentStart(this);
    }
  }
129209
function addListener(object, fName, event, listener) {
		listeners.push({
			object: object[fName](event, listener),
			event: event,
			listener: listener,
		})
	}
969438
public synchronized void addListener(AuthListener listener) {
        if (getListeners().contains(listener)){
            return;
        }
        mListeners.add(new WeakReference<>(listener));
    }
1070734
public synchronized void addWeakListener(L listener) {
    Preconditions.checkNotNull(listener);

    _log.info("Adding a weak listener " + listener);
    _autoListeners.put(listener, null);
  }
759067
function addListenersToStream(listeners, stream) {
    var evt, callback;
    if (listeners) {
        for (evt in listeners) {
            if (listeners.hasOwnProperty(evt)) {
                callback = listeners[evt];
                stream.on(evt, callback);
            }
        }
    }
}
509793
public void addListeners(Set<ScriptModuleListener> listeners) {
        Objects.requireNonNull(listeners);
        this.listeners.addAll(listeners);
    }
622957
@Override
    public void addListener(@Nonnull final LifecycleStage lifecycleStage, @Nonnull final LifecycleListener lifecycleListener)
    {
        if (!listeners.containsKey(lifecycleStage)) {
            throw illegalStage(lifecycleStage);
        }
        listeners.get(lifecycleStage).add(lifecycleListener);
    }
1020247
public void addListener(GramJobListener listener) {
	if (listeners == null) listeners = new Vector();
	listeners.addElement(listener);
    }
375905
public void addListener(ComObjectListener listener) {
        if(listener==null)
            throw new IllegalArgumentException("listener is null");
        if(listeners.contains(listener))
            throw new IllegalArgumentException("can't register the same listener twice");
        listeners.add(listener);
    }
229819
function _addListeners() {
        if (_automaticSort && _currentSort && _currentSort.getEvents()) {
            MainViewManager
                .on(_currentSort.getEvents(), function () {
                    _currentSort.sort();
                })
                .on("_workingSetDisableAutoSort.sort", function () {
                    setAutomatic(false);
                });
        }
    }
603538
function (lstCfg, itfWrap) {
                for (var evt in lstCfg) {
                    if (lstCfg.hasOwnProperty(evt)) {
                        lstCfg[evt].listenOnce = true;
                    }
                }
                this.$addListeners(lstCfg, itfWrap);
            }