Verifies the provided Event and fires it off to the registered listeners.

@param event the Event instance to handle
@throws GitLabApiException if the event is not supported
511754
public void handleEvent(SystemHookEvent event) throws GitLabApiException {
        if (event != null) {
            LOGGER.info("handleEvent:" + event.getClass().getSimpleName() + ", eventName=" + event.getEventName());
            fireEvent(event);
        } else {
            LOGGER.warning("handleEvent: provided event cannot be null!");
        }
    }
197538
protected void processEvent (DEvent event)
    {
        // look up the target object
        DObject target = _objects.get(event.getTargetOid());
        if (target == null) {
            log.debug("Event target no longer exists", "event", event);
            return;
        }

        // check the event's permissions
        if (!target.checkPermissions(event)) {
            log.warning("Event failed permissions check", "event", event, "target", target);
            return;
        }

        if (dispatchEvent(event, target)) {
            // unless requested not to, notify any proxies
            target.notifyProxies(event);
        }
    }
1017260
@Override
    public <T> void fire(T event, NonManagedObserver<T> nonManagedObserver) {
        Validate.notNull(event, "Event must be specified");

        runtimeLogger.debug(event, true);
        // we start fresh pr new event
        handledThrowables.get().clear();

        List<ObserverMethod> observers = resolveObservers(event.getClass());
        List<ObserverMethod> interceptorObservers = resolveInterceptorObservers(event.getClass());

        ApplicationContext context = (ApplicationContext) getScopedContext(ApplicationScoped.class);
        // We need to know if we were to the one to Activate it to avoid:
        // * nested ApplicationContexts
        // * ending the scope to soon (to low in the stack)
        boolean activatedApplicationContext = false;
        try {
            if (!context.isActive()) {
                context.activate();
                activatedApplicationContext = true;
            }
            new EventContextImpl<T>(this, interceptorObservers, observers, nonManagedObserver, event,
                runtimeLogger).proceed();
        } catch (Exception e) {
            Throwable fireException = e;
            if (fireException instanceof InvocationException) {
                fireException = fireException.getCause();
            }
            if (handledThrowables.get().contains(fireException.getClass())) {
                UncheckedThrow.throwUnchecked(fireException);
            } else {
                fireException(fireException);
            }
        } finally {
            runtimeLogger.debug(event, false);
            if (activatedApplicationContext && context.isActive()) {
                context.deactivate();
            }
        }
    }
358622
public void afterCompleted(Event event) {
		ChaincodeMessage message = messageHelper(event);
		logger.debug(String.format("[%s]sending COMPLETED to validator for tid", shortID(message)));
		try {
			serialSend(message);
		} catch (Exception e) {
			event.cancel(new Exception("send COMPLETED failed %s", e));
		}
	}
266358
@Override
    public void fire(StepStartedEvent event) {
        for (LifecycleListener listener : listeners) {
            try {
                listener.fire(event);
            } catch (Exception e) {
                logError(listener, e);
            }
        }
    }
330788
protected void fireActionPerformed(ActionEvent event) {
    Object[] listeners = listenerList.getListenerList();
    for(int i = listeners.length - 2; i >= 0; i -= 2) {
      if(listeners[i] == ActionListener.class) {
        ((ActionListener) listeners[i + 1]).actionPerformed(event);
      }
    }
  }
668555
@Override
	public void servletEvent(final ServletEvent event) {
		if (LOG.isDebugEnabled()) {
			LOG.debug("Sending web event " + event + " for bundle "
					+ event.getBundleName());
		}
		synchronized (listeners) {
			callListeners(event);
			Map<String, ServletEvent> events = states.get(event.getBundleId());
			if (events == null) {
				events = new LinkedHashMap<>();
				states.put(event.getBundleId(), events);
			}
			events.put(event.getAlias(), event);
		}
	}
870232
@EventListener
    public void handleCasAuthenticationPolicyFailureEvent(final CasAuthenticationPolicyFailureEvent event) {
        if (this.casEventRepository != null) {
            val dto = prepareCasEvent(event);
            dto.setPrincipalId(event.getAuthentication().getPrincipal().getId());
            dto.putEventId(CasAuthenticationPolicyFailureEvent.class.getSimpleName());
            this.casEventRepository.save(dto);
        }
    }
1037817
public void handleEvent(HttpServletRequest request) throws GitLabApiException {

        String eventName = request.getHeader("X-Gitlab-Event");
        if (eventName == null || eventName.trim().isEmpty()) {
            String message = "X-Gitlab-Event header is missing!";
            LOGGER.warning(message);
            return;
        }

        if (!isValidSecretToken(request)) {
            String message = "X-Gitlab-Token mismatch!";
            LOGGER.warning(message);
            throw new GitLabApiException(message);
        }

        LOGGER.info("handleEvent: X-Gitlab-Event=" + eventName);
        if (!SYSTEM_HOOK_EVENT.equals(eventName)) {
            String message = "Unsupported X-Gitlab-Event, event Name=" + eventName;
            LOGGER.warning(message);
            throw new GitLabApiException(message);
        }

        // Get the JSON as a JsonNode tree.  We do not directly unmarshal the input as special handling must
        // be done for "merge_request" events.
        JsonNode tree;
        try {

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine(HttpRequestUtils.getShortRequestDump("System Hook", true, request));
                String postData = HttpRequestUtils.getPostDataAsString(request);
                LOGGER.fine("Raw POST data:\n" + postData);
                tree = jacksonJson.readTree(postData);
            } else {
                InputStreamReader reader = new InputStreamReader(request.getInputStream());
                tree = jacksonJson.readTree(reader);
            }

        } catch (Exception e) {
            LOGGER.warning("Error reading JSON data, exception=" +
                    e.getClass().getSimpleName() + ", error=" + e.getMessage());
            throw new GitLabApiException(e);
        }

        // NOTE: This is a hack based on the GitLab documentation and actual content of the "merge_request" event
        // showing that the "event_name" property is missing from the merge_request system hook event.  The hack is
        // to inject the "event_name" node so that the polymorphic deserialization of a SystemHookEvent works correctly
        // when the system hook event is a "merge_request" event.
        if (!tree.has("event_name") && tree.has("object_kind")) {

            String objectKind = tree.get("object_kind").asText();
            if (MergeRequestSystemHookEvent.MERGE_REQUEST_EVENT.equals(objectKind)) {
                ObjectNode node = (ObjectNode)tree;
                node.put("event_name", MergeRequestSystemHookEvent.MERGE_REQUEST_EVENT);
            } else {
                String message = "Unsupported object_kind for system hook event, object_kind=" + objectKind;
                LOGGER.warning(message);
                throw new GitLabApiException(message);
            }
        }

        // Unmarshal the tree to a concrete instance of a SystemHookEvent and fire the event to any listeners
        try {

            SystemHookEvent event = jacksonJson.unmarshal(SystemHookEvent.class, tree);
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine(event.getEventName() + "\n" + jacksonJson.marshal(event) + "\n");
            }

            StringBuffer requestUrl = request.getRequestURL();
            event.setRequestUrl(requestUrl != null ? requestUrl.toString() : null);
            event.setRequestQueryString(request.getQueryString());
            fireEvent(event);

        } catch (Exception e) {
            LOGGER.warning("Error processing JSON data, exception=" +
                    e.getClass().getSimpleName() + ", error=" + e.getMessage());
            throw new GitLabApiException(e);
        }
    }
1297686
protected void fireTriggerEvent(TriggerEvent event) {
        try {
            for (TriggerListener listener : listeners) {
                listener.triggerValidation(event);
            }
        } catch (RuntimeException e) {
            uncheckedExceptionHandler.handleException(e);
        } catch (Error e) {
            uncheckedExceptionHandler.handleError(e);
        }
    }
130935
public void fireLayerAttributeChangedEvent(MapLayerAttributeChangeEvent event) {
		if (isEventFirable()) {
			final MapLayerListener[] theListeners = getListeners();
			if (theListeners != null && theListeners.length > 0) {
				for (final MapLayerListener listener : theListeners) {
					listener.onMapLayerAttributeChanged(event);
				}
			}

			final GISLayerContainer<?> container = getContainer();
			if (container != null) {
				container.fireLayerAttributeChangedEvent(event);
			}
		}
	}
54137
@Override
  public synchronized void handleEvent(final Event event) {
    if (event.getType() == EventType.JOB_STARTED) {
      this.value = this.value + 1;
    } else if (event.getType() == EventType.JOB_FINISHED) {
      this.value = this.value - 1;
    }
  }
1250751
protected final void fireServiceAdded(BeanContextServiceAvailableEvent event)
	{
		Object listeners[];
		synchronized (bcsListeners)
		{
			listeners = bcsListeners.toArray();
		}
		for (int i = 0; i < listeners.length; i++)
		{
			BeanContextServicesListener l = (BeanContextServicesListener) listeners[i];
			l.serviceAvailable(event);
		}
	}
315315
public void fireEvent(CmsEvent event) {

        fireEventHandler(m_eventListeners.get(event.getTypeInteger()), event);
        fireEventHandler(m_eventListeners.get(I_CmsEventListener.LISTENERS_FOR_ALL_EVENTS), event);
    }
134349
public synchronized void fire(T event) {
		if (occured) throw new IllegalStateException("SingleEvent already fired");
		occured = true;
		data = event;
		if (listeners != null) {
			for (Listener<T> listener : listeners)
				listener.fire(event);
			listeners = null;
		}
		if (listenersRunnable != null) {
			for (Runnable listener : listenersRunnable)
				listener.run();
			listenersRunnable = null;
		}
	}
691750
private void fireEvent(RecorderEventImpl event) {
        eventSender.event = event;
        scheduler.submit(eventSender, PriorityQueueScheduler.INPUT_QUEUE);
    }
800702
public void handleDebugEvents(DebugEvent[] events)
	{
		for (int i = 0; i < events.length; i++)
		{
			DebugEvent event = events[i];
			if (event.getSource().equals(getProcess()))
			{
				Runnable r = new Runnable()
				{
					public void run()
					{
						if (fTerminate != null)
						{
							fTerminate.update();
						}
					}
				};

				DebugUIPlugin.getStandardDisplay().asyncExec(r);
			}
		}
	}