Registers the given event object for publication on a call to a Spring Data repository's save methods.

@param event must not be {@literal null}.
@return the event that has been added.
422051
protected <T extends DomainEvent> T registerEvent(T event) {
        Assert.notNull(event, "Domain event must not be null!");

        this.domainEvents.add(event);
        return event;
    }
328108
public FutureAPIResponse createEventAsFuture(Event event) throws IOException {
    RequestBuilder builder = new RequestBuilder("POST");
    builder.setUrl(apiUrl + "/events.json?accessKey=" + accessKey);
    String requestJsonString = event.toJsonString();
    builder.setBody(requestJsonString);
    builder.setHeader("Content-Type", "application/json");
    builder.setHeader("Content-Length", "" + requestJsonString.length());
    return new FutureAPIResponse(client.executeRequest(builder.build(), getHandler()));
  }
174521
@Override
    public <P> void pojoDaoCreated(PojoDaoFactoryEvent<P> event) {
        Schema schema = new Schema();
        event.getPojoBinding().describe(schema.createTable(event.getTableName()), schema);
        List<SchemaStatement> statements = schema.items().map(SchemaItem::createStatement).collect(Collectors.toList());
        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("Creating table(s) to support \"{}\":\n\t{}\n", event.getPojoBinding().getPojoType().getSimpleName(), statements.stream().map(SchemaStatement::getQueryString).collect(Collectors.joining("\n\t")));
        }
        statements.forEach(session::execute);
    }
58577
def register_event(cls, event_name, event, method):
        
        log.info('@Registry.register_event `{}` with subscriber `{}`'
                 .format(event_name, method.__name__))

        if event_name not in cls._events:
            cls._events[event_name] = {}

        if event not in cls._events[event_name]:
            cls._events[event_name][event] = []

        cls._events[event_name][event].append(method)
720733
public void onPost(final GitHubTriggerEvent event) {
        if (Objects.isNull(job)) {
            return; // nothing to do
        }

        Job<?, ?> currentJob = notNull(job, "Job can't be null");

        final String pushBy = event.getTriggeredByUser();
        DescriptorImpl d = getDescriptor();
        d.checkThreadPoolSizeAndUpdateIfNecessary();
        d.queue.execute(new Runnable() {
            private boolean runPolling() {
                try {
                    StreamTaskListener listener = new StreamTaskListener(getLogFileForJob(currentJob));

                    try {
                        PrintStream logger = listener.getLogger();

                        long start = System.currentTimeMillis();
                        logger.println("Started on " + DateFormat.getDateTimeInstance().format(new Date()));
                        if (event.getOrigin() != null) {
                            logger.format("Started by event from %s on %tc%n", event.getOrigin(), event.getTimestamp());
                        }
                        SCMTriggerItem item = SCMTriggerItems.asSCMTriggerItem(currentJob);
                        if (null == item) {
                            throw new IllegalStateException("Job is not an SCMTriggerItem: " + currentJob);
                        }
                        boolean result = item.poll(listener).hasChanges();
                        logger.println("Done. Took " + Util.getTimeSpanString(System.currentTimeMillis() - start));
                        if (result) {
                            logger.println("Changes found");
                        } else {
                            logger.println("No changes");
                        }
                        return result;
                    } catch (Error e) {
                        e.printStackTrace(listener.error("Failed to record SCM polling"));
                        LOGGER.error("Failed to record SCM polling", e);
                        throw e;
                    } catch (RuntimeException e) {
                        e.printStackTrace(listener.error("Failed to record SCM polling"));
                        LOGGER.error("Failed to record SCM polling", e);
                        throw e;
                    } finally {
                        listener.close();
                    }
                } catch (IOException e) {
                    LOGGER.error("Failed to record SCM polling", e);
                }
                return false;
            }

            public void run() {
                if (runPolling()) {
                    GitHubPushCause cause;
                    try {
                        cause = new GitHubPushCause(getLogFileForJob(currentJob), pushBy);
                    } catch (IOException e) {
                        LOGGER.warn("Failed to parse the polling log", e);
                        cause = new GitHubPushCause(pushBy);
                    }

                    if (asParameterizedJobMixIn(currentJob).scheduleBuild(cause)) {
                        LOGGER.info("SCM changes detected in " + currentJob.getFullName()
                                + ". Triggering #" + currentJob.getNextBuildNumber());
                    } else {
                        LOGGER.info("SCM changes detected in " + currentJob.getFullName()
                                + ". Job is already in the queue");
                    }
                }
            }
        });
    }
470505
public void doPost(final LoggingEvent event) {
        // if event does not meet threshold, exit now
        if (!isAsSevereAsThreshold(event.getLevel())) {
            return;
        }

        // get the "local" logger for this event from the
        // configured repository.
        Logger localLogger =
                getLoggerRepository().getLogger(event.getLoggerName());

        // if the logger level is greater or equal to the level
        // of the event, use the logger to append the event.
        if (event.getLevel()
                .isGreaterOrEqual(localLogger.getEffectiveLevel())) {
            // call the loggers appenders to process the event
            localLogger.callAppenders(event);
        }
  }
4151
public void register(XEvent event) {
		Date date = XTimeExtension.instance().extractTimestamp(event);
		if(date != null) {
			register(date);
		}
	}
293157
public static EventType map(Event event) {
        EventType eventType = new EventType();
        eventType.setTimestamp(Converter.convertDate(event.getTimestamp()));
        eventType.setEventType(convertEventType(event.getEventType()));
        OriginatorType origType = mapOriginator(event.getOriginator());
        eventType.setOriginator(origType);
        MessageInfoType miType = mapMessageInfo(event.getMessageInfo());
        eventType.setMessageInfo(miType);
        eventType.setCustomInfo(convertCustomInfo(event.getCustomInfo()));
        eventType.setContentCut(event.isContentCut());
        if (event.getContent() != null) {
            DataHandler datHandler = getDataHandlerForString(event);
            eventType.setContent(datHandler);
        }
        return eventType;
    }
1187110
@Override
    public void writeEvent(Event event) {
        Originator originator = event.getOriginator();
        MessageInfo messageInfo = event.getMessageInfo();

        long id = dbDialect.getIncrementer().nextLongValue();
        event.setPersistedId(id);

        getJdbcTemplate()
            .update("insert into EVENTS (ID, EI_TIMESTAMP, EI_EVENT_TYPE,"
                    + " ORIG_PROCESS_ID, ORIG_IP, ORIG_HOSTNAME, "
                    + " ORIG_CUSTOM_ID, ORIG_PRINCIPAL,"
                    + " MI_MESSAGE_ID, MI_FLOW_ID, MI_PORT_TYPE,"
                    + " MI_OPERATION_NAME, MI_TRANSPORT_TYPE,"
                    + " CONTENT_CUT, MESSAGE_CONTENT) "
                    + " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
                    event.getPersistedId(), event.getTimestamp(), event.getEventType().toString(),
                    originator.getProcessId(), originator.getIp(), originator.getHostname(),
                    originator.getCustomId(), originator.getPrincipal(),
                    messageInfo.getMessageId(), messageInfo.getFlowId(), messageInfo.getPortType(),
                    messageInfo.getOperationName(), messageInfo.getTransportType(),
                    event.isContentCut(), event.getContent());

        writeCustomInfo(event);

        if (LOG.isLoggable(Level.INFO)) {
            LOG.info("event [message_id=" + messageInfo.getMessageId() + "] persist to Database successful."
                + " ID=" + id);
        }
    }
480252
def create_event(self, event):
        
        ev = api.Event.create(self.journal.collection, event)
        ev.save()
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);
                }

            });
        }
    }
916361
public ADDRESST registerParticipant(ADDRESST address, EventListener entity) {
		synchronized (mutex()) {
			addListener(address, entity);
			this.participants.put(entity.getID(), address);
		}
		return address;
	}
954681
public static <T> Listener<T> createListenerToFire(Event<T> event) {
		return new Listener<T>() {
			@Override
			public void fire(T obj) {
				event.fire(obj);
			}
		};
	}
896270
@Override
    public void configurationEvent(ConfigurationEvent event) {
        LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
        try {
            lock.lock();
            final List<InstanceDeclaration> impacted
                    = getDeclarationsByConfiguration(event.getPid(), event.getFactoryPid());

            if (impacted.isEmpty()) {
                return;
            }

            switch (event.getType()) {
                case ConfigurationEvent.CM_DELETED:
                    for (InstanceDeclaration declaration : impacted) {
                        LOGGER.info("Configuration " + event.getPid() + " deleted");
                        declaration.dispose(event.getPid());
                    }
                    break;
                case ConfigurationEvent.CM_UPDATED:
                    for (InstanceDeclaration declaration : impacted) {
                        final Configuration configuration = find(event.getPid());
                        if (configuration == null) {
                            LOGGER.error("Weird case, a matching declaration was found, but cannot be found a second " +
                                    "times, may be because of rapid changes in the config admin");
                        } else {
                            declaration.attachOrUpdate(configuration);
                        }
                    }

                    break;
            }
        } finally {
            lock.unlock();
        }

    }
1258420
function Event (eventstream, event, eventMappings) {
  if (!eventstream) {
    var errStreamMsg = 'eventstream not injected!';
    debug(errStreamMsg);
    throw new Error(errStreamMsg);
  }

  if (!event) {
    var errEvtMsg = 'event not injected!';
    debug(errEvtMsg);
    throw new Error(errEvtMsg);
  }

  if (!eventstream.aggregateId) {
    var errAggIdMsg = 'eventstream.aggregateId not injected!';
    debug(errAggIdMsg);
    throw new Error(errAggIdMsg);
  }

  if (!_.isArray(eventstream.uncommittedEvents)) {
    var errAggIdMsg = 'eventstream.uncommittedEvents not injected!';
    debug(errAggIdMsg);
    throw new Error(errAggIdMsg);
  }

  eventMappings = eventMappings || {};

  this.streamId = eventstream.aggregateId;
  this.aggregateId = eventstream.aggregateId;
  this.aggregate = eventstream.aggregate;
  this.context = eventstream.context;
  this.streamRevision = null;
  this.commitId = null;
  this.commitSequence = null;
  this.commitStamp = null;
  this.payload = event || null;
  this.position = null;

  this.applyMappings = function applyMappings() {
    _.keys(eventMappings).forEach(function (key) {
      if (this[key] !== undefined && this[key] !== null) {
        dotty.put(this.payload, eventMappings[key], this[key]);
      }
    }.bind(this));
  };

  eventstream.uncommittedEvents.push(this);
}
937882
public void publishEvent(@Observes Object event) throws IOException {
        Class<?> eventType = event.getClass();
        LOGGER.debug("Receiving event of type {}", eventType.getSimpleName());
        if (! publisherConfigurations.containsKey(eventType)) {
            LOGGER.debug("No publisher configured for event of type {}", eventType.getSimpleName());
            return;
        }
        PublisherConfiguration publisherConfiguration = publisherConfigurations.get(eventType);
        MessagePublisher publisher = providePublisher(publisherConfiguration.reliability, eventType);
        Message message = buildMessage(publisherConfiguration, event);
        try {
            LOGGER.info("Publishing event of type {}", eventType.getSimpleName());
            publisher.publish(message, publisherConfiguration.deliveryOptions);
            LOGGER.info("Successfully published event of type {}", eventType.getSimpleName());
        } catch (IOException e) {
            LOGGER.error("Failed to publish event {}", eventType.getSimpleName(), e);
            throw e;
        }
    }
477341
@Override
    public <P> void pojoDaoCreated(PojoDaoFactoryEvent<P> event) {
        event.getPojoBinding().verifySchema(session.getCluster().getMetadata().getKeyspace(session.getLoggedKeyspace()), event.getTableName());
    }