Add a J2SSH Listener to the list of listeners that will be sent events

@param threadPrefix
listen to threads whose name have this prefix, string must not
contain any '-' except the final character which must be a
'-'.
@param listener
344921
public synchronized void addListener(String threadPrefix,
			EventListener listener) {
		if (threadPrefix.trim().equals("")) {
			globalListeners.addElement(listener);
		} else {
			keyedListeners.put(threadPrefix.trim(), listener);
		}
	}
667331
private static String makeThreadName(String suffix) {
        String name = Thread.currentThread().getName()
                .replaceAll("-EventThread", "");
        return name + suffix;
    }
1352779
public void registerListener(ConfigurationListener<T> listener) {
        Util.notNull(listener, "Configuration listener");
        listeners.add(listener);
    }
580073
@NonNull
    @Override
    public ListenerToken addChangeListener(@NonNull QueryChangeListener listener) {
        if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }
        return addChangeListener(null, listener);
    }
848308
public void addMessageListener(JMessageListener listener)
    {
        if (listener == null)
            return; // Never
        this.removeDuplicateFilters(listener);  // Remove any duplicate record filters
        if (m_vListenerList == null)
            m_vListenerList = new Vector<JMessageListener>();
        for (int i = 0; i < m_vListenerList.size(); i++)
        {
            if (m_vListenerList.get(i) == listener)
            {
                Util.getLogger().warning("--------Error-Added message listener twice--------");
                return;     // I'm sure you didn't mean to do that.
            }
        }
        m_vListenerList.add(listener);
        listener.addListenerMessageFilter(this);
    }
281575
public ProxyDataSourceBuilder listener(JdbcLifecycleEventListener listener) {
        JdbcLifecycleEventExecutionListener executionListener = new JdbcLifecycleEventExecutionListener(listener);
        this.queryExecutionListeners.add(executionListener);
        this.methodExecutionListeners.add(executionListener);
        return this;
    }
795261
public static ThreadFactory buildThreadFactory(@NotNull String threadNamePrefix, @NotNull boolean daemon) {
		return new ThreadFactoryBuilder().setNameFormat(threadNamePrefix + "-%d").setDaemon(daemon).build();
	}
546719
function (listener, eventPrefix) {
        var lastName;

        eventPrefix = eventPrefix || '';

        this.receive({
            test: function (val) {
                lastName = val;
                return true;
            }
        }, function (data) {
            listener.emit(eventPrefix + lastName, data);
        });
        return this;
    }
1196592
public void setRuntimeEventListener(RuntimeEventListener listener) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "setRuntimeEventListener", listener);
        _runtimeEventListener = listener;
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "setRuntimeEventListener");
    }
1175712
RunListener wrapIfNotThreadSafe(RunListener listener) {
        return listener.getClass().isAnnotationPresent(RunListener.ThreadSafe.class) ?
                listener : new SynchronizedRunListener(listener, this);
    }
1236582
public void addListener(ChangeListener listener) {
        synchronized (hsChangeListeners) {
            hsChangeListeners.add(listener);
            changeListenerCount = hsChangeListeners.size();
            bUpdateChangeListener = true;
        }
    }
544689
public void addChangeListener(javax.swing.event.ChangeListener LISTENER) {
        LISTENER_LIST.add(javax.swing.event.ChangeListener.class, LISTENER);
    }
812862
public void addListener(StageListener listener) {
        if (logger.isDebugEnabled()) {
            logger.debug("## pipeline[{}] add listener [{}]", getPipelineId(),
                         ClassUtils.getShortClassName(listener.getClass()));
        }

        this.listeners.add(listener);
    }
791815
public void addBOSHClientConnListener(
            final BOSHClientConnListener listener) {
        if (listener == null) {
            throw(new IllegalArgumentException(NULL_LISTENER));
        }
        connListeners.add(listener);
    }
1282084
public void addNameSourceListener( NameSource.Listener listener ) {
        if ( nameSourceListeners == null )
            nameSourceListeners = new ArrayList();
        nameSourceListeners.add( listener );
    }
257979
public final void addChainEventListener(ChainEventListener listener) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "addChainEventListener: " + listener);
        }
        if (null != listener) {
            this.chainEventListeners.add(listener);
        }
    }
1175611
@SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public synchronized void start(final Listener listener, final Infrastructure infra) {
        if (listener == null)
            throw new IllegalArgumentException("Cannot pass null to " + BlockingQueueReceiver.class.getSimpleName() + ".setListener");
        if (this.listener != null)
            throw new IllegalStateException(
                    "Cannot set a new Listener (" + SafeString.objectDescription(listener) + ") on a " + BlockingQueueReceiver.class.getSimpleName()
                            + " when there's one already set (" + SafeString.objectDescription(this.listener) + ")");
        this.listener = listener;
        infra.getThreadingModel().runDaemon(this, "BQReceiver-" + address.toString());
    }