Adds an event handler for background polling events.

@param hostEventHandler An event handler.
347644
public void addHostEventHandler(IHostEventHandler hostEventHandler) {
        synchronized (hostEventHandlers) {
            if (!hostEventHandlers.contains(hostEventHandler)) {
                hostEventHandlers.add(hostEventHandler);
            }
        }
    }
271558
public void addHandler(AptEvent event, AptMethod eventHandler)
    {
        assert event.getEventSet() == _eventSet;
        _handlerMap.put(event, eventHandler);
    }
1008175
public void initEventHandlers(final CmsSitemapTreeNode node) {

        node.getOpener().addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            public void buttonClick(ClickEvent event) {

                CmsSitemapTreeController.this.onClickOpen(node);
            }
        });
    }
672196
protected EventListener addListener(ADDRESST key, EventListener value) {
		synchronized (mutex()) {
			return this.listeners.put(key, value);
		}
	}
433708
public void addContainerpageEventHandler(I_CmsContainerpageEventHandler handler) {

        CmsCoreProvider.get().getEventBus().addHandler(CmsContainerpageEvent.TYPE, handler);
    }
352171
public void setSystemEventHandler(final SystemEventHandler systemEventHandler) {
    if (systemEventSubscription != null) {
      systemEventSubscription.unsubscribe();
    }
    if (systemEventHandler != null) {
      systemEventSubscription = eventBus().get()
          .filter(evt -> evt.type().equals(EventType.SYSTEM))
          .subscribe(new Subscriber<CouchbaseEvent>() {
            @Override
            public void onCompleted() { /* Ignoring on purpose. */}

            @Override
            public void onError(Throwable e) { /* Ignoring on purpose. */ }

            @Override
            public void onNext(CouchbaseEvent evt) {
              systemEventHandler.onEvent(evt);
            }
          });
    }
  }
87351
public static synchronized void initEventHandlerInstance(int maxEntries,
                                                           int flushPeriodMs)
  {
    if (eventHandler.get() == null)
    {
      eventHandler.set(new EventHandler(maxEntries, flushPeriodMs));
    }
    //eventHandler.startFlusher();
  }
93579
public void processEvent(EventObject event) {
    // Don't need to do anything except resend if challenged
    // (we only get here for a stateless NOTIFY)

    if (event instanceof ResponseEvent) {
      receivedResponses.add(new SipResponse((ResponseEvent) event));
      resendWithAuthorization((ResponseEvent) event);
    }
  }
604760
public void setInputHandler(ProducerInputHandler inputHandler)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setInputHandler", inputHandler);
    this.inputHandler = inputHandler;
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setInputHandler");
  }
89168
public void setInvocationHandler(Object proxy, InvocationHandler handler) {
        Field field = getInvocationHandlerField();
        try {
            field.set(proxy, handler);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
240977
public void setSessionHandler(SessionHandler sessionHandler) {
        handler.setSessionsEnabled(sessionHandler != null);
        handler.setSessionHandler(sessionHandler);
    }
1149006
static void captureEvent(final Element elem, String eventName, final EventHandler handler) {
    // register regular event handler on the element
    HtmlPlatform.captureEvent(elem, eventName, handler);
  }
1234090
public void runtimeEventOccurred(RuntimeEvent event)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "runtimeEventOccurred", event);
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "runtimeEventOccurred");    
  }
379264
protected void raiseOrtcEvent(EventEnum eventToRaise, Object... args) {
		switch (eventToRaise) {
		case OnConnected:
			raiseOnConnected(args);
			break;
		case OnDisconnected:
			raiseOnDisconnected(args);
			break;
		case OnException:
			raiseOnException(args);
			break;
		case OnReconnected:
			raiseOnReconnected(args);
			break;
		case OnReconnecting:
			raiseOnReconnecting(args);
			break;
		case OnSubscribed:
			raiseOnSubscribed(args);
			break;
		case OnUnsubscribed:
			raiseOnUnsubscribed(args);
			break;
		case OnReceived:
			raiseOnReceived(args);
			break;
		}
	}
718789
private void executeHandlers(List<Event> filteredEvents) {
        for (EventHandler current : eventHandlers) {
            for (Event event : filteredEvents) {
                current.handleEvent(event);
            }
        }
    }
929713
public <T> void handleEvent(final T event) throws EventException {
		final Class<?> type = event.getClass();
		if (!this.cachedListeners.containsKey(event.getClass())) {
			this.cachedListeners.put(type, new LinkedList<ListenerInstancePair<?>>());
			for (final ListenerInstancePair<?> listener : this.listeners) {
				final Type observableType = GenericsUtil.getEntityGenericType(listener.listener.getClass(), 0, Listener.class);
				final Class<?> observable = GenericsUtil.guessClazz(observableType);
				if (observable.isAssignableFrom(type)) {
					this.cachedListeners.get(type).add(listener);
				}
			}
		}
		@SuppressWarnings("unchecked")
		final List<ListenerInstancePair<T>> resolvedListeners = List.class.cast(this.cachedListeners.get(event.getClass()));
		for (final ListenerInstancePair<T> listener : resolvedListeners) {
			listener.handleEvent(event, null);
		}
	}
911529
function setEventHandler(name, handler, dom, tag) {
  var eventName,
    cb = handleEvent.bind(tag, dom, handler);

  // avoid to bind twice the same event
  // possible fix for #2332
  dom[name] = null;

  // normalize event name
  eventName = name.replace(RE_EVENTS_PREFIX, '');

  // cache the listener into the listeners array
  if (!contains(tag.__.listeners, dom)) { tag.__.listeners.push(dom); }
  if (!dom[RIOT_EVENTS_KEY]) { dom[RIOT_EVENTS_KEY] = {}; }
  if (dom[RIOT_EVENTS_KEY][name]) { dom.removeEventListener(eventName, dom[RIOT_EVENTS_KEY][name]); }

  dom[RIOT_EVENTS_KEY][name] = cb;
  dom.addEventListener(eventName, cb, false);
}