Sends a built {@link Event} to the Sentry server.

@param event event to send to Sentry.
342469
public void sendEvent(Event event) {
        for (ShouldSendEventCallback shouldSendEventCallback : shouldSendEventCallbacks) {
            if (!shouldSendEventCallback.shouldSend(event)) {
                logger.trace("Not sending Event because of ShouldSendEventCallback: {}", shouldSendEventCallback);
                return;
            }
        }

        try {
            connection.send(event);
        } catch (LockedDownException | TooManyRequestsException e) {
            logger.debug("Dropping an Event due to lockdown: " + event);
        } catch (Exception e) {
            logger.error("An exception occurred while sending the event to Sentry.", e);
        } finally {
            getContext().setLastEventId(event.getId());
        }
    }
135506
protected synchronized void fireMPDChangeEvent(MPDChangeEvent.Event event) {
        MPDChangeEvent mce = new MPDChangeEvent(this, event);

        for (MPDChangeListener mcl : listeners) {
            mcl.mpdChanged(mce);
        }
    }
286648
public void update(MsNotifyEvent event) {
		logger.info("resource updated : event FQN " + event.getEventID().getFqn());
		if(session != null && link != null && event.getEventID().equals(MsAnnouncement.COMPLETED)) {						
			try {
				SipServletRequest byeRequest = session.createRequest("BYE");				
				byeRequest.send();																	
			} catch (IOException e) {
				logger.error("Unexpected error while sending the BYE request", e);				
			}
			link.release();			
		}
	}
248460
private void safePostEvent(Event event) {
        EventAdmin ea = eventAdminRef.getService();
        if (ea != null) {
            ea.postEvent(event);
        } else if (tc.isEventEnabled()) {
            Tr.event(tc, "The EventAdmin service is unavailable. Unable to post the Event: " + event);
        }
    }
1157428
@Override
	public void put(ContentEvent event) {
		for (SamzaSystemStream stream:systemStreams) {
			stream.send(collector,event);
		}
	}
501165
private void onMessageSent(MessageSentEvent event) {
        handler.post(() -> listener.onMessageSent(event));
        log("Event published " + event.toString());
    }
423445
private void send(JainMgcpCommandEvent event) {

		sent = true;

		String host = "";
		int port = 0;

		switch (event.getObjectIdentifier()) {
		case Constants.CMD_NOTIFY:
			Notify notifyCommand = (Notify) event;
			NotifiedEntity notifiedEntity = notifyCommand.getNotifiedEntity();
			if (notifiedEntity == null) {
				notifiedEntity = this.stack.provider.getNotifiedEntity();
			}
			port = notifiedEntity.getPortNumber();
			// if (notifiedEntity.getLocalName() != null) {
			// host = notifiedEntity.getLocalName() + "@";
			// }
			host += notifiedEntity.getDomainName();

			break;
			
        case Constants.CMD_DELETE_CONNECTION:
		case Constants.CMD_RESTART_IN_PROGRESS:
			if(remoteAddress!=null)
			{
				host = remoteAddress.getHostAddress();
				port = remotePort;
				break;
			}
			
		default:
			// determite destination address and port to send request to
			// from endpoint identifier parameter.
			String domainName = event.getEndpointIdentifier().getDomainName();

			// now checks does port number is specified in the domain name
			// if port number is not specified use 2427 by default
			int pos = domainName.indexOf(':');
			if (pos > 0) {
				port = Integer.parseInt(domainName.substring(pos + 1));
				host = domainName.substring(0, pos);
			} else {
				port = 2427;
				host = domainName;
			}
			break;
		}

		// construct the destination as InetAddress object
		InetAddress address = null;
		try {
			address = InetAddress.getByName(host);
		} catch (UnknownHostException e) {
			throw new IllegalArgumentException("Unknown endpoint " + host);
		}

		// save this tx in stack and start timer
		remoteTID = event.getTransactionHandle();
		source = event.getSource();
		event.setTransactionHandle(localTID);

		// encode event object as MGCP command and send over UDP.		
		if(originalPacket==null)
			originalPacket=stack.allocatePacket();
		
		originalPacket.setLength(encode(event,originalPacket.getRawData()));
		InetSocketAddress inetSocketAddress = new InetSocketAddress(address, port);
		originalPacket.setRemoteAddress(inetSocketAddress);		
		
		resetReTransmissionTimer();
		resetTHISTTimerTask(false);

		if (logger.isDebugEnabled())
			logger.debug("Send command event to " + address + "remote TX ID:" + remoteTID + ", message\n" + new String(originalPacket.getRawData(),0,originalPacket.getLength()));
		
		countOfCommandRetransmitted++;
		stack.send(originalPacket);
		
	}
334082
public void processEvent(EventObject event) // for asynchronous
  // (nonblocking) response
  // handling
  {
    synchronized (this) {
    } // wail til message sending has finished (transaction attribute set)

    if (event instanceof ResponseEvent) {
      processResponse((ResponseEvent) event);
    } else if (event instanceof TimeoutEvent) {
      processTimeout((TimeoutEvent) event);
    }

    // note, requests don't come through here, they are handled via the
    // listen/waitFor methods.
  }
808751
synchronized void fireEvent(final Event<?> event) {
        final String eventType = event.getType();
        List<Event<?>> events = synchronizedEvents.get(eventType);
        if (null == events) {
            events = new ArrayList<>();
            synchronizedEvents.put(eventType, events);
        }

        events.add(event);
        setChanged();
        notifyListeners(event);
    }
298179
public void messageReceived (MessageEvent event)
    {
        if (_msghandlers != null) {
            MessageHandler handler = _msghandlers.get(event.getName());
            if (handler != null) {
                handler.handleEvent(event, this);
            }
        }

        // If the message is directed at us, see if it's a request for a method invocation
        if (event.isPrivate()) { // aka if (event instanceof ServerMessageEvent)
            // the first argument should be the client object of the caller or null if it is
            // a server-originated event
            int srcoid = event.getSourceOid();
            DObject source = (srcoid <= 0) ? null : _omgr.getObject(srcoid);
            String method = event.getName();
            Object[] args = event.getArgs(), nargs;

            // validate that this call is allowed
            if (!allowManagerCall(method)) {
                log.warning("Client tried to invoke forbidden manager call!",
                    "source", source, "method", method, "args", args);
                return;
            }

            if (args == null) {
                nargs = new Object[] { source };
            } else {
                nargs = new Object[args.length+1];
                nargs[0] = source;
                System.arraycopy(args, 0, nargs, 1, args.length);
            }

            // Lazily create our dispatcher now that it's actually getting a message
            if (_dispatcher == null) {
                Class<?> clazz = getClass();
                MethodFinder finder = _dispatcherFinders.get(clazz);
                if (finder == null) {
                    finder = new MethodFinder(clazz);
                    _dispatcherFinders.put(clazz, finder);
                }
                _dispatcher = new DynamicListener<DSet.Entry>(this, finder);
            }
            _dispatcher.dispatchMethod(method, nargs);
        }
    }
195039
public void processEvent(EventObject event) {
    if (event instanceof RequestEvent) {
      processRequest((RequestEvent) event);
    } else if (event instanceof ResponseEvent) {
      processResponse((ResponseEvent) event);
    } else if (event instanceof TimeoutEvent) {
      processTimeout((TimeoutEvent) event);
    } else {
      LOG.error("invalid event type received: {}: {}", event.getClass().getName(), event.toString());
    }
  }
822958
private void fireEvent(ManagerEvent event)
    {
        synchronized (eventListeners)
        {
            for (ManagerEventListener listener : eventListeners)
            {
                try
                {
                    listener.onManagerEvent(event);
                }
                catch (RuntimeException e)
                {
                    logger.warn("Unexpected exception in eventHandler " + listener.getClass().getName(), e);
                }
            }
        }
    }
46579
public void cmsEvent(CmsEvent event) {

        if (!isStaticExportEnabled()) {
            if (LOG.isWarnEnabled()) {
                LOG.warn(Messages.get().getBundle().key(Messages.LOG_STATIC_EXPORT_DISABLED_0));
            }
            return;
        }
        I_CmsReport report = null;
        Map<String, Object> data = event.getData();
        if (data != null) {
            report = (I_CmsReport)data.get(I_CmsEventListener.KEY_REPORT);
        }
        if (report == null) {
            report = new CmsLogReport(CmsLocaleManager.getDefaultLocale(), getClass());
        }
        switch (event.getType()) {
            case I_CmsEventListener.EVENT_UPDATE_EXPORTS:
                scrubExportFolders(report);
                clearCaches(event);
                break;
            case I_CmsEventListener.EVENT_PUBLISH_PROJECT:
                if (data == null) {
                    if (LOG.isErrorEnabled()) {
                        LOG.error(Messages.get().getBundle().key(Messages.ERR_EMPTY_EVENT_DATA_0));
                    }
                    return;
                }
                // event data contains a list of the published resources
                CmsUUID publishHistoryId = new CmsUUID((String)data.get(I_CmsEventListener.KEY_PUBLISHID));
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_EVENT_PUBLISH_PROJECT_1, publishHistoryId));
                }
                synchronized (m_lockCmsEvent) {
                    getHandler().performEventPublishProject(publishHistoryId, report);
                }
                clearCaches(event);

                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_EVENT_PUBLISH_PROJECT_FINISHED_1,
                            publishHistoryId));
                }

                break;
            case I_CmsEventListener.EVENT_CLEAR_CACHES:
                clearCaches(event);
                break;
            default:
                // no operation
        }
    }
412138
public function sendEvent(Event $event)
    {
        try {
            $this->eventFactory->addDefaultTagsToEntity($event);
            $this->sendEventThroughSenders($event);
        } catch (\Exception $exception) {
            $this->logException($exception);
        }
    }
836516
@MainThread
    private void handleEventPost(Event event) {
        Utils.log(event.getKey(), "Handling posted event");

        int sizeBefore = executionQueue.size();

        scheduleStatusUpdates(event, EventStatus.STARTED);
        scheduleSubscribersInvocation(event);

        if (((EventBase) event).handlersCount == 0) {
            Utils.log(event.getKey(), "No subscribers found");
            // Removing all scheduled STARTED status callbacks
            while (executionQueue.size() > sizeBefore) {
                executionQueue.removeLast();
            }
        } else {
            activeEvents.add(event);
            executeTasks(false);
        }
    }
205017
public void onEvent(final WatchEvent<Path> event) {
        Kind kind = event.kind();
        if (StandardWatchEventKind.ENTRY_CREATE.equals(kind)) {
            File file = new File(event.context().toString());
            listener.fileCreated(file);
        } else if (StandardWatchEventKind.ENTRY_DELETE.equals(kind)) {
            File file = new File(event.context().toString());
            listener.fileDeleted(file);
        } else if (StandardWatchEventKind.ENTRY_MODIFY.equals(kind)) {
            File file = new File(event.context().toString());
            listener.fileChanged(file);
        }
    }
688784
private void sendEvents(final List<Event> events) {
        if (null != handlers) {
            for (EventHandler current : handlers) {
                for (Event event : events) {
                    current.handleEvent(event);
                }
            }
        }

        LOG.info("Put events(" + events.size() + ") to Monitoring Server.");

        try {
            if (sendToEventadmin) {
                EventAdminPublisher.publish(events);
            } else {
                monitoringServiceClient.putEvents(events);
            }
        } catch (MonitoringException e) {
            throw e;
        } catch (Exception e) {
            throw new MonitoringException("002",
                                          "Unknown error while execute put events to Monitoring Server", e);
        }

    }