Publishes events to listeners.

@param events list of map event to publish
160783
private void publish(List<AtomicMapEvent<K, byte[]>> events) {
    listeners.forEach(listener -> events.forEach(event -> getSession(listener).accept(client -> client.change(event))));
  }
503591
public void setEvents(java.util.Collection<Event> events) {
        if (events == null) {
            this.events = null;
            return;
        }

        this.events = new java.util.ArrayList<Event>(events);
    }
1045597
private void publishEvent(WSJobInstance objectToPublish, String eventToPublishTo, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobInstanceEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
419157
public void setEventStatusCodes(java.util.Collection<String> eventStatusCodes) {
        if (eventStatusCodes == null) {
            this.eventStatusCodes = null;
            return;
        }

        this.eventStatusCodes = new java.util.ArrayList<String>(eventStatusCodes);
    }
57801
public <A> void publishEvent(final EventTranslatorOneArg<T, A> eventTranslator, final A arg)
    {
        ringBuffer.publishEvent(eventTranslator, arg);
    }
303482
public void setListeners(java.util.Collection<Listener> listeners) {
        if (listeners == null) {
            this.listeners = null;
            return;
        }

        this.listeners = new com.amazonaws.internal.SdkInternalList<Listener>(listeners);
    }
444301
public void publish(Object event) {
        Objects.requireNonNull(event, Required.EVENT.toString());
        
        this.eventBus.post(event);
        this.events.getAndIncrement();
    }
1350393
public void setDeviceEvents(java.util.Collection<DeviceEvent> deviceEvents) {
        if (deviceEvents == null) {
            this.deviceEvents = null;
            return;
        }

        this.deviceEvents = new java.util.ArrayList<DeviceEvent>(deviceEvents);
    }
842595
function publishDidValidateEvents( events ) {
      events.forEach( event => {
         testEventBus.publish( `didValidate.${event.resource}`, event );
      } );
      testEventBus.flush();
   }
364023
public EventsBatch withEvents(java.util.Map<String, Event> events) {
        setEvents(events);
        return this;
    }
329020
public void dispatch(Event<?> event) {
		//eventManagement.dispatch(event);
		for (EventListener listener : KReflection.Holder.INSTANCE.listeners) {
			try {
				listener.handleEvent(event);
			} catch (Exception e) {
				// ignore
				// TODO add message kind
			}
		}
	}
574263
public void publish(Event event) {
        logger.debug("Dispatching event: " + event.getClass().toString());
        final ArrayList<Class<? extends Subscriber>> subscriberClasses = subscriptionMap.get(event.getClass());
        if (subscriberClasses == null) {
            logger.debug("No subscribers to inform from event: " + event.getClass().getName());
            return;
        }
        for (Class<? extends Subscriber> clazz: subscriberClasses) {
            logger.debug("Alerting subscriber " + clazz.getName());

            if (event instanceof ChainableEvent) {
                addTrackedEvent((ChainableEvent)event);
            }

            // Check to see if the Event is Unblocked. If so, use a separate executor pool from normal events
            final ExecutorService executorService = event instanceof UnblockedEvent  ? dynamicExecutor : executor;

            executorService.execute(() -> {
                try (AlpineQueryManager qm = new AlpineQueryManager()) {
                    final EventServiceLog eventServiceLog = qm.createEventServiceLog(clazz);
                    final Subscriber subscriber = clazz.getDeclaredConstructor().newInstance();
                    subscriber.inform(event);
                    qm.updateEventServiceLog(eventServiceLog);
                    if (event instanceof ChainableEvent) {
                        ChainableEvent chainableEvent = (ChainableEvent)event;
                        logger.debug("Calling onSuccess");
                        for (ChainLink chainLink: chainableEvent.onSuccess()) {
                            if (chainLink.getSuccessEventService() != null) {
                                Method method = chainLink.getSuccessEventService().getMethod("getInstance");
                                IEventService es = (IEventService) method.invoke(chainLink.getSuccessEventService(), new Object[0]);
                                es.publish(chainLink.getSuccessEvent());
                            } else {
                                Event.dispatch(chainLink.getSuccessEvent());
                            }
                        }
                    }
                } catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException | SecurityException e) {
                    logger.error("An error occurred while informing subscriber: " + e);
                    if (event instanceof ChainableEvent) {
                        ChainableEvent chainableEvent = (ChainableEvent)event;
                        logger.debug("Calling onFailure");
                        for (ChainLink chainLink: chainableEvent.onFailure()) {
                            if (chainLink.getFailureEventService() != null) {
                                try {
                                    Method method = chainLink.getFailureEventService().getMethod("getInstance");
                                    IEventService es = (IEventService) method.invoke(chainLink.getFailureEventService(), new Object[0]);
                                    es.publish(chainLink.getFailureEvent());
                                } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) {
                                    logger.error("Exception while calling onFailure callback", ex);
                                }
                            } else {
                                Event.dispatch(chainLink.getFailureEvent());
                            }
                        }
                    }
                }

                if (event instanceof ChainableEvent) {
                    removeTrackedEvent((ChainableEvent)event);
                }

            });
        }
    }
1105780
public void setServerEvents(java.util.Collection<ServerEvent> serverEvents) {
        if (serverEvents == null) {
            this.serverEvents = null;
            return;
        }

        this.serverEvents = new java.util.ArrayList<ServerEvent>(serverEvents);
    }
133397
public void putEvents(List<Event> events) {
        Exception lastException;
        List<EventType> eventTypes = new ArrayList<EventType>();
        for (Event event : events) {
            EventType eventType = EventMapper.map(event);
            eventTypes.add(eventType);
        }

        int i = 0;
        lastException = null;
        while (i < numberOfRetries) {
            try {
                monitoringService.putEvents(eventTypes);
                break;
            } catch (Exception e) {
                lastException = e;
                i++;
            }
            if(i < numberOfRetries) {
                try {
                    Thread.sleep(delayBetweenRetry);
                } catch (InterruptedException e) {
                    break;
                }
            }
        }

        if (i == numberOfRetries) {
            throw new MonitoringException("1104", "Could not send events to monitoring service after "
                                                  + numberOfRetries + " retries.", lastException, events);
        }
    }
267410
public function publish(\Caridea\Event\Event $event)
    {
        foreach (iterator_to_array($this->listeners) as $listener) {
            $listener->notify($event);
        }
    }
884344
private void sendEvents(EventHolder event) {
    // Only send events to the client if this server is the leader.
    if (server.isLeader()) {
      eventExecutor.execute(() -> {
        PublishRequest request = PublishRequest.builder()
            .withSession(sessionId().id())
            .withEventIndex(event.eventIndex)
            .withPreviousIndex(event.previousIndex)
            .withEvents(event.events)
            .build();

        log.trace("Sending {}", request);
        protocol.publish(memberId(), request);
      });
    }
  }
49479
protected void notifyListeners (int event)
    {
        int size = _listeners.size();
        for (int ii = 0; ii < size; ii++) {
            _listeners.get(ii).modelChanged(event);
        }
    }