Subscribes the listener object to receive events of the given type.

@param eventListener
the listener object to register
@param eventType
the type of event to register the listener for
551647
@Override
	public void subscribeToEvent(EventListener eventListener, Class<? extends AbstractTaskEvent> eventType) {
		this.eventHandler.subscribeToEvent(eventListener, eventType);
	}
652975
function addEventListener(event, listener) {
    this._eventListeners[event] = this._eventListeners[event] || [];
    this._eventListeners[event].push(listener);
  }
1091266
function(element, type, handler) {
    if(element.addEventListener) {
      addEvent = function(element, type, handler) {
        element.addEventListener(type, handler, false);
      };
    } else if(element.attachEvent) {
      addEvent = function(element, type, handler) {
        element.attachEvent('on' + type, handler);
      };
    } else {
      addEvent = function(element, type, handler) {
        element['on' + type] = handler;
      };
    }
    addEvent(element, type, handler);
  }
1372255
public void addListener(final TypingListener typingListener) {
        if (typingListener != null) {
            MessagingListener messagingListener = new MessagingListener() {

                @Override
                public void onParticipantIsTyping(ParticipantTypingEvent event) {
                    typingListener.participantTyping(event.getConversationId(), event.getProfileId(), true);
                }

                @Override
                public void onParticipantTypingOff(ParticipantTypingOffEvent event) {
                    typingListener.participantTyping(event.getConversationId(), event.getProfileId(), false);
                }
            };
            typingListeners.put(typingListener, messagingListener);
            client.addListener(messagingListener);
        }
    }
528200
function addTypeListener(emitter, type, event, listener) {
    if (!emitter._listeners) {
        emitter._listeners = {
            on: {},
            after: {},
            before: {}
        };
    }

    if (!emitter._listeners[type][event]) {
        emitter._listeners[type][event] = [];
    }
    if ('on' == type && emitter._listeners[type][event].length) {
        throw Error('Listener for event "' + event + '" already defined.');
    }

    emitter._listeners[type][event].push(listener);

    return function remove() {
        const index = emitter._listeners[type][event].indexOf(listener);
        if (-1 !== index) {
            emitter._listeners[type][event].splice(index, 1);
        }
    };
}
954681
public static <T> Listener<T> createListenerToFire(Event<T> event) {
		return new Listener<T>() {
			@Override
			public void fire(T obj) {
				event.fire(obj);
			}
		};
	}
851548
def _create_event_listeners(self):
        """"""
        LOG.debug("Create the event listeners.")
        for event_type, callback in self._event_callback_pairs:
            LOG.debug("Create listener for %r event", event_type)
            listener = self._utils.get_vnic_event_listener(event_type)
            eventlet.spawn_n(listener, callback)
350768
public void fireEvent(Type eventType, Object event, Annotation... qualifiers) {
        final EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers);
        notifier.fireEvent(eventType, event, metadata, qualifiers);
    }
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);
    }
1016095
public void trigger(Object event){

        Set<Class> eventTypes = getAllInheritedClasses(event.getClass());

        for (Class eventType : eventTypes) {
            if(observers.containsKey(eventType)){
                for (EventObserver eventObserver : observers.get(eventType)) {
                    executionQueue.get().add(new EventExecution(event, eventObserver));
                }
            }
        }

        triggerQueue();
    }
217749
@Override
	public void unsubscribeFromEvent(EventListener eventListener, Class<? extends AbstractTaskEvent> eventType) {
		this.eventHandler.unsubscribeFromEvent(eventListener, eventType);
	}
1156891
function on(eventName, callback) {
  	if (objectType(eventName) !== "string") {
  		throw new TypeError("eventName must be a string when registering a listener");
  	} else if (!inArray(eventName, SUPPORTED_EVENTS)) {
  		var events = SUPPORTED_EVENTS.join(", ");
  		throw new Error("\"" + eventName + "\" is not a valid event; must be one of: " + events + ".");
  	} else if (objectType(callback) !== "function") {
  		throw new TypeError("callback must be a function when registering a listener");
  	}

  	if (!LISTENERS[eventName]) {
  		LISTENERS[eventName] = [];
  	}

  	// Don't register the same callback more than once
  	if (!inArray(callback, LISTENERS[eventName])) {
  		LISTENERS[eventName].push(callback);
  	}
  }
761258
public <V extends Event> B on(EventType<V, ?> type, EventCallbackFn<V> callback) {
        bind(get(), type, callback);
        return that();
    }
531427
protected <E extends Event> Listener subscribeSystemEvent(Class<E> eventClass, final Class<? extends Listener<E>> listenerClass) {
        Listener<E> listener = locator.createAndInitialize(listenerClass);
        SystemEventBus.subscribe(eventClass, listener);
        return listener;
    }
1010809
public void addEventListener(EventListener listener)
    	throws IllegalArgumentException
    {
       
        if (_eventListeners==null)
            _eventListeners=new ArrayList();
        
        if (listener instanceof ComponentListener ||
            listener instanceof LifeCycleListener )
        {
            if(log.isDebugEnabled())log.debug("addEventListener: "+listener);      
            _eventListeners=LazyList.add(_eventListeners,listener);
        }
      
    }
562487
function addEventListener(type, listener, useCapture) {
      if (type === 'DOMContentLoaded') type = 'load';
      var target = this;
      var f = function(e) {
        e._timeStamp = Date.now();
        e._currentTarget = target;
        listener.call(this, e);
        e._currentTarget = null;
      };
      this['_' + type + listener] = f;
      this.attachEvent('on' + type, f);
    }
810445
private <E extends Event> EventListener<E> getEventListener(E event) {
        @SuppressWarnings("unchecked")
        EventListener<E> eventListener = (EventListener<E>) eventListenerMap.get(event.getClass());
        return eventListener;
    }