Dispatch conversation message update event.

@param event Event to dispatch.
546904
private void onMessageDelivered(MessageDeliveredEvent event) {
        handler.post(() -> listener.onMessageDelivered(event));
        log("Event published " + event.toString());
    }
675969
protected void dispatchEvent (DEvent event)
    {
//         Log.info("Dispatching event: " + evt);

        // look up the object on which we're dispatching this event
        int remoteOid = event.getTargetOid();
        DObject target = _ocache.get(remoteOid);
        if (target == null) {
            if (!_dead.containsKey(remoteOid)) {
                log.warning("Unable to dispatch event on non-proxied object " + event + ".");
            }
            return;
        }

        // because we might be acting as a proxy for a remote server, we may need to fiddle with
        // this event before we dispatch it
        _client.convertFromRemote(target, event);

        // if this is a compound event, we need to process its contained events in order
        if (event instanceof CompoundEvent) {
            // notify our proxy subscribers in one fell swoop
            target.notifyProxies(event);

            // now break the event up and dispatch each event to listeners individually
            List<DEvent> events = ((CompoundEvent)event).getEvents();
            int ecount = events.size();
            for (int ii = 0; ii < ecount; ii++) {
                dispatchEvent(remoteOid, target, events.get(ii));
            }

        } else {
            // forward to any proxies (or not if we're dispatching part of a compound event)
            target.notifyProxies(event);

            // and dispatch the event to regular listeners
            dispatchEvent(remoteOid, target, event);
        }
    }
758770
public function addMessage(AddMessageEvent $event)
    {
        /** @var Message $messageAdapter */
        $messageAdapter = $this->framework->getAdapter(Message::class);

        $messageAdapter->add($event->getContent(), 'TL_' . strtoupper($event->getType()));
    }
1214871
public function onEvent(Event $event = null)
    {
        while (!empty($this->messages)) {
            $message = array_shift($this->messages);

            $this->handle($message, $this->dispatcher);
        }
    }
1024255
public void onMemberInfoUpdated(AVIMClient client, AVIMConversation conversation,
                                  AVIMConversationMemberInfo memberInfo, List<String> updatedProperties, String operator) {
    LOGGER.d("Notification --- " + operator + " updated memberInfo: " + memberInfo.toString());
  }
1212484
protected final void startConversation(Event event, String methodName) {
        startConversation(event.getSender().getId(), methodName);
    }
681784
@Override
    public void onMessageRead(MessageReadEvent event) {
        for (IMessagingListener listener : messagingListeners) {
            try {
                listener.onMessageRead(event);
            } catch (Exception e) {
                logError(e, "message read "+event.getMessageId());
            }
        }
    }
728692
private void handleConversationStateChange(Conversation conversation) {
		ApptentiveLog.d(CONVERSATION, "Conversation state changed: %s", conversation);
		checkConversationQueue();

		assertTrue(conversation != null && !conversation.hasState(UNDEFINED));

		if (conversation != null && !conversation.hasState(UNDEFINED)) {

			ApptentiveNotificationCenter.defaultCenter()
				.postNotification(NOTIFICATION_CONVERSATION_STATE_DID_CHANGE,
					NOTIFICATION_KEY_CONVERSATION, conversation);

			if (conversation.hasActiveState()) {
				if (appIsInForeground) {
					// ConversationManager listens to the foreground event to fetch interactions when it comes to foreground
					conversation.fetchInteractions(getContext());
					// Message Manager listens to foreground/background events itself
					conversation.getMessageManager().attemptToStartMessagePolling();
				}

				// Fetch app configuration
				fetchAppConfiguration(conversation);

				// Update conversation with push configuration changes that happened while it wasn't active.
				SharedPreferences prefs = ApptentiveInternal.getInstance().getGlobalSharedPrefs();
				int pushProvider = prefs.getInt(Constants.PREF_KEY_PUSH_PROVIDER, -1);
				String pushToken = prefs.getString(Constants.PREF_KEY_PUSH_TOKEN, null);
				if (pushProvider != -1 && pushToken != null) {
					conversation.setPushIntegration(pushProvider, pushToken);
				}
			}

			updateMetadataItems(conversation);
			if (ApptentiveLog.canLog(VERBOSE)) {
				printMetadata(conversationMetadata, "Updated Metadata");
			}
		}
	}
868480
protected function update(Event $event)
    {
        $this->dispatch(static::EVENT_UPDATE_BEFORE, $event);
        if (!$event->isPropagationStopped()) {
            $this->updateProcess($event);
            if (!$event->isPropagationStopped()) {
                $this->dispatch(static::EVENT_UPDATE_AFTER, $event);
            }
        }
    }
309587
public void afterResponse(Event event) {
		ChaincodeMessage message = messageHelper(event);
		try {
			sendChannel(message);
			logger.debug(String.format("[%s]Received %s, communicated (state:%s)",
					shortID(message), message.getType(), fsm.current()));
		} catch (Exception e) {
			logger.error(String.format("[%s]error sending %s (state:%s): %s", shortID(message),
					message.getType(), fsm.current(), e));
		}
	}
93579
public void processEvent(EventObject event) {
    // Don't need to do anything except resend if challenged
    // (we only get here for a stateless NOTIFY)

    if (event instanceof ResponseEvent) {
      receivedResponses.add(new SipResponse((ResponseEvent) event));
      resendWithAuthorization((ResponseEvent) event);
    }
  }
402870
private void onConversationDeleted(ConversationDeleteEvent event) {
        handler.post(() -> listener.onConversationDeleted(event));
        log("Event published " + event.toString());
    }
274284
@Controller(next = "askWhetherToRepeat")
    public void askTimeForMeeting(Event event) {
        if (event.getMessage().getText().contains("yes")) {
            reply(event, "Okay. Would you like me to set a reminder for you?");
            nextConversation(event);    // jump to next question in conversation  
        } else {
            reply(event, "No problem. You can always schedule one with 'setup meeting' command.");
            stopConversation(event);    // stop conversation only if user says no
        }
    }
391293
protected void dispatchEvents() {

    while (true) {

      Object event = this.eventQueue.poll();
      if (event == null) {
        return;
      }
      Collection<Throwable> errors = new LinkedList<>();
      dispatchEvent(event, errors);
      if (!errors.isEmpty()) {
        handleErrors(errors, event);
      }
    }
  }
661504
private void dispatchEvent(XoaEvent event) {
        LOG.entering(CLASS_NAME, "dispatchEvent", event);
        
        try {
            Integer handlerId = event.getHandlerId();
            
            XoaEventKind eventKind = event.getEvent();
            if (LOG.isLoggable(Level.FINEST)) {
                LOG.finest("XOA --> SOA: " + handlerId  + " event: " + eventKind.name());
            }
            
            BridgeDelegate handler = xoaObjectMap.get(handlerId);
            if (handler == null) {
                if (LOG.isLoggable(Level.FINEST)) {
                    LOG.finest("No handler for handler id: " + handlerId);
                }
                return;
            }
            
            /* Allow only one bridge crossing per handler at a time */
            synchronized (handler) {
                // dispatch to SOA
                Object[] args = { handlerId, eventKind.toString(), event.getParams() };
                firePropertyChange(XOP_MESSAGE, null, args);
            }

        } catch (Exception e) {
            LOG.log(Level.FINE, "While dispatching event: "+e.getMessage(), e);
            throw new IllegalStateException("Unable to dispatch an event from the cross origin proxy", e);
        }

    }
1112308
@Override
    public void onEvent(InteractionEvent event) {
        switch (event.getType()) {
        case BEFORE_WAIT:
            onBeforeWaitEvent((BeforeWaitInteractionEvent) event);
            break;
        case BEFORE:
            onBeforeEvent((BeforeInteractionEvent) event);
            break;
        case AFTER_SUCCESS:
            onAfterSuccessEvent((AfterSuccessInteractionEvent) event);
            onAfterEvent((AfterInteractionEvent) event);
            break;
        case AFTER_FAIL:
            onAfterFailEvent((AfterFailInteractionEvent) event);
            onAfterEvent((AfterInteractionEvent) event);
            break;
        }
    }
1065409
public void dispatchEvent(IEvent event) {
        for (IEventListener listener : listeners) {
            if (event.getSource() == null || event.getSource() != listener) {
                listener.notifyEvent(event);
            }
        }
    }