Fires the specified event to a list of event listeners.<p>

@param listeners the listeners to fire
@param event the event to fire
327252
protected void fireEventHandler(List<I_CmsEventListener> listeners, CmsEvent event) {

        if (!LOG.isDebugEnabled()) {
            // no logging required
            if ((listeners != null) && (listeners.size() > 0)) {
                // handle all event listeners that listen to this event type
                I_CmsEventListener[] list = listeners.toArray(EVENT_LIST);
                // loop through all registered event listeners
                for (int i = 0; i < list.length; i++) {
                    try {
                        // fire the event
                        list[i].cmsEvent(event);
                    } catch (Throwable t) {
                        LOG.error(
                            Messages.get().getBundle().key(
                                Messages.ERR_CALLING_EVENT_LISTENER_FAILED_2,
                                list[i].getClass().getName(),
                                event.toString()),
                            t);
                    }
                }
            }
        } else {
            // add lots of event debug output (this should usually be disabled)
            // repeat event handling code to avoid multiple "is log enabled" checks in normal operation
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_DEBUG_EVENT_1, event.toString()));
            if ((listeners != null) && (listeners.size() > 0)) {
                // handle all event listeners that listen to this event type
                I_CmsEventListener[] list = listeners.toArray(EVENT_LIST);
                // log the event data
                if (event.getData() != null) {
                    Iterator<String> i = event.getData().keySet().iterator();
                    while (i.hasNext()) {
                        String key = i.next();
                        Object value = event.getData().get(key);
                        LOG.debug(
                            Messages.get().getBundle().key(
                                Messages.LOG_DEBUG_EVENT_VALUE_3,
                                key,
                                value,
                                event.toString()));
                    }
                } else {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_DEBUG_NO_EVENT_VALUE_1, event.toString()));
                }
                // log all the registered event listeners
                for (int j = 0; j < list.length; j++) {
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_DEBUG_EVENT_LISTENERS_3,
                            list[j],
                            new Integer(j),
                            event.toString()));
                }
                // loop through all registered event listeners
                for (int i = 0; i < list.length; i++) {
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_DEBUG_EVENT_START_LISTENER_3,
                            list[i],
                            new Integer(i),
                            event.toString()));
                    try {
                        // fire the event
                        list[i].cmsEvent(event);
                    } catch (Throwable t) {
                        LOG.error(
                            Messages.get().getBundle().key(
                                Messages.ERR_CALLING_EVENT_LISTENER_FAILED_2,
                                list[i].getClass().getName(),
                                event.toString()),
                            t);
                    }
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_DEBUG_EVENT_END_LISTENER_3,
                            list[i],
                            new Integer(i),
                            event.toString()));
                }
            } else {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_DEBUG_EVENT_NO_LISTENER_1, event.toString()));
            }
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_DEBUG_EVENT_COMPLETE_1, event.toString()));
        }
    }
87847
@SuppressWarnings("unchecked")
  public <T> Listener<T> onEvent(String event, Consumer listener) {
    Set<Consumer> listeners = eventListeners.computeIfAbsent(event, e -> new CopyOnWriteArraySet<>());
    listeners.add(listener);
    return new Listener<T>() {
      @Override
      public void accept(T event) {
        listener.accept(event);
      }
      @Override
      public void close() {
        listeners.remove(listener);
      }
    };
  }
496725
public void fire(T event) {
		ArrayList<Listener<T>> list1;
		ArrayList<Runnable> list2;
		synchronized (this) {
			if (listeners == null) list1 = null;
			else list1 = new ArrayList<>(listeners);
			if (listenersRunnable == null) list2 = null;
			else list2 = new ArrayList<>(listenersRunnable);
		}
		if (list1 != null)
			for (int i = 0; i < list1.size(); ++i)
				try { list1.get(i).fire(event); }
				catch (Throwable t) {
					LCCore.getApplication().getDefaultLogger().error("Event listener error: " + list1.get(i), t);
				}
		if (list2 != null)
			for (int i = 0; i < list2.size(); ++i)
				try { list2.get(i).run(); }
				catch (Throwable t) {
					LCCore.getApplication().getDefaultLogger().error("Event listener error: " + list2.get(i), t);
				}
	}
677635
public void setEvents(java.util.Collection<HistoryEvent> events) {
        if (events == null) {
            this.events = null;
            return;
        }

        this.events = new java.util.ArrayList<HistoryEvent>(events);
    }
804637
public void addCmsEventListener(I_CmsEventListener listener, int[] eventTypes) {

        synchronized (m_eventListeners) {
            if (eventTypes == null) {
                // no event types given - register the listener for all event types
                eventTypes = new int[] {I_CmsEventListener.LISTENERS_FOR_ALL_EVENTS.intValue()};
            }
            for (int i = 0; i < eventTypes.length; i++) {
                // register the listener for all configured event types
                Integer eventType = new Integer(eventTypes[i]);
                List<I_CmsEventListener> listeners = m_eventListeners.get(eventType);
                if (listeners == null) {
                    listeners = new ArrayList<I_CmsEventListener>();
                    m_eventListeners.put(eventType, listeners);
                }
                if (!listeners.contains(listener)) {
                    // add listerner only if it is not already registered
                    listeners.add(listener);
                }
            }
        }
    }
667710
public static void fireSREChanged(PropertyChangeEvent event) {
		for (final Object listener : SRE_LISTENERS.getListeners()) {
			((ISREInstallChangedListener) listener).sreChanged(event);
		}
	}
1119325
public static void fire(final HasShowHandlers source) {
        if (TYPE != null) {
            ShowEvent event = new ShowEvent();
            source.fireEvent(event);
        }
    }
992328
void firePropertyChildRemoved(TreeNodeRemovedEvent event) {
		if (this.nodeListeners != null) {
			for (final TreeNodeListener listener : this.nodeListeners) {
				if (listener != null) {
					listener.treeNodeChildRemoved(event);
				}
			}
		}
		final N parentNode = getParentNode();
		if (parentNode != null) {
			parentNode.firePropertyChildRemoved(event);
		}
	}
1072817
protected void firePluginAddedEvent(PluginEvent event) {
        PluginListener[] listeners = new PluginListener[mPluginListeners.size()];
        listeners = mPluginListeners.toArray(listeners);
        for (int i=0; i < listeners.length; i++) {			
            listeners[i].pluginAdded(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;
		}
	}
695787
public void setListenerDescriptions(java.util.Collection<ListenerDescription> listenerDescriptions) {
        if (listenerDescriptions == null) {
            this.listenerDescriptions = null;
            return;
        }

        this.listenerDescriptions = new com.amazonaws.internal.SdkInternalList<ListenerDescription>(listenerDescriptions);
    }
628696
protected function makeEventAndListeners($event, $listeners)
    {
        if (! Str::contains($event, '\\')) {
            return;
        }

        $this->call('generate:event', ['name' => $event]);

        $this->makeListeners($event, $listeners);
    }
130029
public static void fire(final HasSummernoteChangeHandlers source) {
        if (TYPE != null) {
            SummernoteChangeEvent event = new SummernoteChangeEvent();
            source.fireEvent(event);
        }
    }
975743
public void addProjectListeners(List<ProjectListener> listeners)
   {
      if (listeners != null)
      {
         for (ProjectListener listener : listeners)
         {
            addProjectListener(listener);
         }
      }
   }
1341569
public void fireEvent(EventModel event) throws IllegalIDException, org.intellimate.izou.events.MultipleEventsException {
        if(events == null) return;
        if(events.isEmpty()) {
            events.add(event);
        } else {
            throw new org.intellimate.izou.events.MultipleEventsException();
        }
    }
872014
public void setListeners(Listener[] listeners) {
        if (listeners != null && listeners.length > 0
                && this.listeners != null && this.listeners.length > 0) {
            Listener[] oldListeners = this.listeners;
            this.listeners = new Listener[oldListeners.length + listeners.length];
            System.arraycopy(oldListeners, 0, this.listeners, 0, oldListeners.length);
            System.arraycopy(listeners, 0, this.listeners, oldListeners.length, listeners.length);
        } else {
            this.listeners = listeners;
        }
    }
1116339
function relayEvents(listener, emitter, events) {
  events.forEach(eventName => listener.on(eventName, event => emitter.emit(eventName, event)));
}