--- ADD REMOTE 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();
			}
		}
	}
166852
@Override
  public void addCreateListener( AsyncCallback<T> callback )
  {
    DataSubscription subscription = new DataSubscription( RTDataEvents.created, tableName, createCallback( callback ) );
    addEventListener( subscription );
  }
44520
@Override
  public void onNext(final RemoteEvent<T> value) {
    try {

      LOG.log(Level.FINEST, "Link: {0} event: {1}", new Object[] {linkRef, value});

      if (linkRef.get() == null) {
        queue.add(value);

        final Link<byte[]> link = transport.get(value.remoteAddress());
        if (link != null) {
          LOG.log(Level.FINEST, "transport get link: {0}", link);
          setLink(link);
          return;
        }

        final ConnectFutureTask<Link<byte[]>> cf = new ConnectFutureTask<>(
            new ConnectCallable(transport, value.localAddress(), value.remoteAddress()),
            new ConnectEventHandler<>(this));
        executor.submit(cf);

      } else {
        // encode and write bytes
        // consumeQueue();
        LOG.log(Level.FINEST, "Send: {0} event: {1}", new Object[] {linkRef, value});
        linkRef.get().write(encoder.encode(value));
      }

    } catch (final RemoteRuntimeException ex) {
      LOG.log(Level.SEVERE, "Remote Exception", ex);
      throw ex;
    }
  }
685068
public boolean addFailOverListener(FailOverListener localListener) {
		if (logger.isDebugEnabled()) {
			logger.debug("Adding local listener " + localListener);
		}
		for(FailOverListener failOverListener : failOverListeners) {
			if (failOverListener.getBaseFqn().getFqn().equals(localListener.getBaseFqn().getFqn())) {
				return false; 
			}
		}
		return failOverListeners.add(localListener);		
	}
1020247
public void addListener(GramJobListener listener) {
	if (listeners == null) listeners = new Vector();
	listeners.addElement(listener);
    }
1109873
function Connection (remote, options) {
  EventEmitter.call(this);

  if (remote[remote.length - 1] === '/') {
    remote = remote.substr(0, remote.length - 1);
  }

  this._remote = remote;
  this._retry = options.retry || 3;
  this._options = options || {};
  this._request_internal = createInternalConnection(options.mode);
}
791969
@Override
	public void addInputChannel(RemoteInputChannel listener) throws IOException {
		checkError();

		inputChannels.putIfAbsent(listener.getInputChannelId(), listener);
	}
886297
public void addListener(FieldListener listener, BaseField field)
    {
        super.addListener(listener, field);
        if (listener.getOwner().getRecord() == this.getRecord())   // Only replicate listeners added to base.
        {
            Iterator<BaseTable> iterator = this.getTables();
            while (iterator.hasNext())
            {
                BaseTable table = iterator.next();
                if ((table != null) && (table != this.getNextTable()))
                {
                    BaseField fldInTable = table.getRecord().getField(field.getFieldName());
                    if (fldInTable != null)
                    {
                        FieldListener newBehavior = null; // Clone the file behaviors
                        try   {
                            newBehavior = (FieldListener)listener.clone(fldInTable);  // Clone the file behaviors
                        } catch (CloneNotSupportedException ex)   {
                            newBehavior = null;
                        }
                        if (newBehavior != null)
                            if (newBehavior.getOwner() == null)     // This should have been set, just being careful (ie., next line never called)
                                fldInTable.addListener(newBehavior);        // Add them to the new query
                    }
                }
            }
        }
    }
1122191
public void addSslListener(InetSocketAddress addr, Configuration sslConf,
      boolean needClientAuth) throws IOException {
    if (webServer.isStarted()) {
      throw new IOException("Failed to add ssl listener");
    }
    if (needClientAuth) {
      // setting up SSL truststore for authenticating clients
      System.setProperty("javax.net.ssl.trustStore", sslConf.get(
          "ssl.server.truststore.location", ""));
      System.setProperty("javax.net.ssl.trustStorePassword", sslConf.get(
          "ssl.server.truststore.password", ""));
      System.setProperty("javax.net.ssl.trustStoreType", sslConf.get(
          "ssl.server.truststore.type", "jks"));
    }
    SslSocketConnector sslListener = new SslSocketConnector();
    sslListener.setHost(addr.getAddress().getHostAddress());
    sslListener.setPort(addr.getPort());
    sslListener.setKeystore(sslConf.get("ssl.server.keystore.location"));
    sslListener.setPassword(sslConf.get("ssl.server.keystore.password", ""));
    sslListener.setKeyPassword(sslConf.get("ssl.server.keystore.keypassword", ""));
    sslListener.setKeystoreType(sslConf.get("ssl.server.keystore.type", "jks"));
    sslListener.setNeedClientAuth(needClientAuth);
    webServer.addConnector(sslListener);
  }
312968
def add_listener(self, listener):
        
        self.logger.debug('installing listener %r', listener)
        if not isinstance(listener, SessionListener):
            raise SessionError("Listener must be a SessionListener type")
        with self._lock:
            self._listeners.add(listener)
1072100
public void addConnectionListener(KNXListener l)
	{
		if (l == null)
			return;
		synchronized (listeners) {
			if (!listeners.contains(l)) {
				listeners.add(l);
				listenersCopy = new ArrayList(listeners);
			}
			else
				logger.warn("event listener already registered");
		}
	}
1320077
function(listenerId) {
        var ctx = u.context(SMALL);
        logger.debugf('Invoke removeListener(msgId=%d,listenerId=%s) remotely', ctx.id, listenerId);
        var conn = p.findConnectionListener(listenerId);
        if (!f.existy(conn))
          return Promise.reject(
            new Error('No server connection for listener (listenerId=' + listenerId + ')'));

        var remote = futurePinned(ctx, 0x27, p.encodeListenerId(listenerId), p.complete(p.hasSuccess), conn);
        return remote.then(function (success) {
          if (success) {
            p.removeListeners(listenerId);
            return true;
          }
          return false;
        })
      }
840958
public static void listen(int tryCount, long delay, ClipboardListener listener, boolean sync) {
		ClipboardMonitor.INSTANCE//
				.setTryCount(tryCount)//
				.setDelay(delay)//
				.addListener(listener)//
				.listen(sync);
	}
239095
function Remote(server, socket, version, maxFrameSize, encoder, decoder, delay) {

    // Events
    Emitter.call(this);

    // Internals
    this._server = server;
    this._socket = socket;
    this._isPending = true;

    // Public properties
    this.id = socket.remoteAddress + ':' + socket.remotePort;
    this.address = socket.remoteAddress;
    this.port = socket.remotePort;
    this.bytesSend = 0;
    this.bytesReceived = 0;
    this.version = version;
    this.delay = delay || 0;

    // Protocol
    this._encoder = encoder;
    this._decoder = decoder;
    this._protocol = Protocol(this, socket, version, maxFrameSize);
    Protocol.bind(this._protocol, this, socket, this.delay);
    this._protocol.init();

}
969438
public synchronized void addListener(AuthListener listener) {
        if (getListeners().contains(listener)){
            return;
        }
        mListeners.add(new WeakReference<>(listener));
    }
1258717
@Override
    public void subscribe(ListEngineDisplayListener<T> listener) {
        if (!listeners.contains(listener)) {
            listeners.add(listener);
        }
    }
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);
        }
    }