Handle this message.
Update the model depending of the message.
@param message The message to handle.
761200
public int handleMessage(BaseMessage message)
    {
        Map<String,Object> properties = new HashMap<String,Object>();
        String strMessageType =  (String)message.get(MessageConstants.MESSAGE_TYPE_PARAM);
        String strStartIndex = (String)message.get(START_INDEX_PARAM);
        String strEndIndex = (String)message.get(END_INDEX_PARAM);
        if (strMessageType != null)
            properties.put(MessageConstants.MESSAGE_TYPE_PARAM, strMessageType);
        if (strStartIndex != null)
            properties.put(START_INDEX_PARAM, strStartIndex);
        if (strEndIndex != null)
            properties.put(END_INDEX_PARAM, strEndIndex);
        Map<String,Object> propertiesHdr = null;
        if (message.getMessageHeader() != null)
            propertiesHdr = message.getMessageHeader().getProperties();
        if (propertiesHdr != null)
            properties.putAll(propertiesHdr); // Merge them to simplify access
        if (properties != null)
        {
            strMessageType =  (String)properties.get(MessageConstants.MESSAGE_TYPE_PARAM);
            try {
                int iMessageType = Integer.parseInt(strMessageType);
                if ((Constants.AFTER_ADD_TYPE == iMessageType)
                    || (Constants.AFTER_DELETE_TYPE == iMessageType)
                    || (Constants.AFTER_UPDATE_TYPE == iMessageType))
                {
                    SwingUtilities.invokeLater(new UpdateGridTable(properties));
                }
            } catch (NumberFormatException ex) {
                // Ignore
            }
        }
        return super.handleMessage(message);
    }
1234338
public void sendMessage(Message message)
    {
        if (message == null)
            return;     // Don't allow a null message to be sent.
        m_stack.add(message);
        if (m_bWaiting)
        {
            synchronized (m_thread)
            {
                if (m_bWaiting) // Inside the sync block
                    m_thread.notify();
            }
        }
    }
572121
public void setMessage(String message) {
    pushData.clear();
    Map<String, Object> map = AVUtils.createStringObjectMap("alert", message);
    pushData.put("data", map);
  }
674817
@Override
    public void onMessage(Message message) {
        MDC.put("name", name);
        try {
            // Make sure thread priority is correct
            if (!Thread.currentThread().getName().equals(thread.getName())) {
                Thread.currentThread().setName(thread.getName());
                Thread.currentThread().setPriority(thread.getPriority());
            }

            // Get the message details
            String text = ((TextMessage) message).getText();
            JsonSimple config = new JsonSimple(text);
            String event = config.getString(null, "event");
            if (event == null) {
                log.error("Invalid message received: '{}'", text);
                return;
            }

            // Commit on the index
            if (event.equals("commit")) {
                log.debug("Commit received");
                submitBuffer(true);
            }
            // Index the incoming document
            if (event.equals("index")) {
                String index = config.getString(null, "index");
                String document = config.getString(null, "document");
                if (index == null || document == null) {
                    log.error("Invalid message received: '{}'", text);
                    return;
                }
                addToBuffer(index, document);
            }

        } catch (JMSException jmse) {
            log.error("Failed to send/receive message: {}", jmse.getMessage());
        } catch (IOException ioe) {
            log.error("Failed to parse message: {}", ioe.getMessage());
        }
    }
272627
@Override
    public void handleMessage(final Message message) throws Fault {
        OutputStream os = message.getContent(OutputStream.class);

        if (null == os) {
            String encoding = (String) message.get(Message.ENCODING);
            if (encoding == null) {
                encoding = "UTF-8";
            }

            final Writer writer = message.getContent(Writer.class);
            if (null != writer) {
                os = new WriterOutputStream(writer, encoding);
                message.setContent(Writer.class,null);
            }
        }

        if (null != os) {
            final CacheAndWriteTapOutputStream newOut = new CacheAndWriteTapOutputStream(os);

            message.setContent(OutputStream.class, newOut);

            if (WireTapHelper
                    .isMessageContentToBeLogged(message, logMessageContent, logMessageContentOverride)) {
                message.setContent(CachedOutputStream.class, newOut);
            }else {
                try {
                    final CachedOutputStream cos = new CachedOutputStream();
                    cos.write(WireTapHelper.CONTENT_LOGGING_IS_DISABLED.getBytes(Charset.forName("UTF-8")));
                    message.setContent(CachedOutputStream.class, cos);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            if (wireTap != null) {
                newOut.registerCallback(new CallBack(message));
            }
        }
    }
1046030
private void updateActionStatus(final Message message) {
        final DmfActionUpdateStatus actionUpdateStatus = convertMessage(message, DmfActionUpdateStatus.class);
        final Action action = checkActionExist(message, actionUpdateStatus);

        final List<String> messages = actionUpdateStatus.getMessage();

        if (isCorrelationIdNotEmpty(message)) {
            messages.add(RepositoryConstants.SERVER_MESSAGE_PREFIX + "DMF message correlation-id "
                    + message.getMessageProperties().getCorrelationId());
        }

        final Status status = mapStatus(message, actionUpdateStatus, action);
        final ActionStatusCreate actionStatus = entityFactory.actionStatus().create(action.getId()).status(status)
                .messages(messages);

        final Action addUpdateActionStatus = getUpdateActionStatus(status, actionStatus);

        if (!addUpdateActionStatus.isActive() || (addUpdateActionStatus.hasMaintenanceSchedule()
                && addUpdateActionStatus.isMaintenanceWindowAvailable())) {
            lookIfUpdateAvailable(action.getTarget());
        }
    }
1165226
public void addMessageNow(String message) {
    ActionMessages messages = (ActionMessages) now.get(Flash.MESSAGES);
    if (null == messages) {
      messages = new ActionMessages();
      now.put(Flash.MESSAGES, messages);
    }
    messages.getMessages().add(message);
  }
28401
@Override
    public void handleMessage(final Message message) throws Fault {
        final InputStream is = message.getContent(InputStream.class);
        if (WireTapHelper.isMessageContentToBeLogged(message, logMessageContent, logMessageContentOverride)) {
            if (null == is) {
                Reader reader = message.getContent(Reader.class);
                if (null != reader) {
                    String encoding = (String) message.get(Message.ENCODING);
                    if (encoding == null) {
                        encoding = "UTF-8";
                    }
                    try {
                        final CachedOutputStream cos = new CachedOutputStream();
                        final Writer writer = new OutputStreamWriter(cos, encoding);
                        IOUtils.copy(reader, writer, 1024);
                        reader.reset();
                        writer.flush();
                        message.setContent(InputStream.class, cos.getInputStream());
                        message.setContent(Reader.class, null);
                        message.setContent(CachedOutputStream.class, cos);
                        closeCachedOutputStream(message, cos);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    } finally {
                        try {
                            reader.reset();
                        } catch (IOException e) {
                        }
                    }
                }
            } else {
                try {
                    final CachedOutputStream cos = new CachedOutputStream();
                    // TODO: We should try to make this streaming
                    //WireTapInputStream wtis = new WireTapInputStream(is, cos);
                    //message.setContent(InputStream.class, wtis);
                    IOUtils.copyAndCloseInput(is, cos);
                    message.setContent(InputStream.class, cos.getInputStream());
                    message.setContent(CachedOutputStream.class, cos);
                    closeCachedOutputStream(message, cos);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }else {
            try {
                final CachedOutputStream cos = new CachedOutputStream();
                cos.write(WireTapHelper.CONTENT_LOGGING_IS_DISABLED.getBytes(Charset.forName("UTF-8")));
                message.setContent(CachedOutputStream.class, cos);
                message.setContent(InputStream.class, is);
                closeCachedOutputStream(message, cos);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
928680
protected void handleMessage(VehicleMessage message) {
        if(message != null) {
            message.timestamp();
            if(mCallback != null) {
                mCallback.receive(message);
            }
        }
    }
984003
@Override
    public void handleMessage(Message msg) {
        if (msg.what == ASYNC) {
            mAsyncDispatcher.dispatch();
        } else if (msg.what == SYNC) {
            mSyncDispatcher.dispatch();
        } else super.handleMessage(msg);
    }
1209750
public Observable<Boolean> handleMessage(final ChatMessage message) {

        String sender = message.getSentBy();

        Observable<Boolean> replaceMessages = persistenceController.updateStoreWithNewMessage(message, noConversationListener);

        if (!TextUtils.isEmpty(sender) && !sender.equals(getProfileId())) {

            final Set<String> ids = new HashSet<>();
            ids.add(message.getMessageId());

            return Observable.zip(replaceMessages, markDelivered(message.getConversationId(), ids), (saved, result) -> saved && result.isSuccessful());

        } else {

            return replaceMessages;
        }
    }
347749
private void handleCommandCallback(final String message) {
		// JSON callback
        final JSONObject jsonObject = new JSONObject(message);
		final String eventType = jsonObject.getString("event");

		final CommandCallbackHandler commandCallbackHandler = commandCallbacks.get(eventType);
		if( commandCallbackHandler == null ) {
			logger.error("Unknown event: {}", message);
			return;
		}
		try {
			commandCallbackHandler.handleChannelData(jsonObject);
		} catch (final BitfinexClientException e) {
			logger.error("Got an exception while handling callback");
		}
	}
1193215
public void init(BaseMessage message, Object objRawMessage)
    {
        m_message = message;
        if (message != null)
            message.setExternalMessage(this);
        if (objRawMessage != null)
            this.setRawData(objRawMessage);
    }
960846
private void initMessage(HttpMessage message) {
        StaticMessageContentBuilder staticMessageContentBuilder = StaticMessageContentBuilder.withMessage(message);
        staticMessageContentBuilder.setMessageHeaders(message.getHeaders());
        getAction().setMessageBuilder(new HttpMessageContentBuilder(message, staticMessageContentBuilder));
    }
613351
public int handleMessage(BaseMessage message)
    {
        Utility.getLogger().info("RemoteQueue handling message " + message);
        if (message.getProcessedByClientSession() == this.getParentSession())
            return DBConstants.NORMAL_RETURN;     // Do not process this message (the client has already taken care of it).
//?        if (message.getProcessedByClientSession() instanceof RemoteObject)
//?            if (this.getParentSession() instanceof RemoteObject) // Always
//?                if (((RemoteObject)this.getParentSession()).getRef().remoteEquals(((RemoteObject)message.getProcessedByClientSession()).getRef()))
//?                    return DBConstants.NORMAL_RETURN;   // Same client.
        if (message == m_messageLastMessage)
            return DBConstants.NORMAL_RETURN;   // Don't send a message to the same client twice.
        m_messageLastMessage = message;
        this.getMessageStack().sendMessage(message);
        return DBConstants.NORMAL_RETURN;
    }
594201
public void sendMessage(String message) {
        EventBuilder eventBuilder = new EventBuilder().withMessage(message)
            .withLevel(Event.Level.INFO);
        sendEvent(eventBuilder);
    }
506031
public void deliver(final byte[] message) {
    synchronized (this.heartBeatManager) {
      if (this.currentStatus.isNotRunning()) {
        LOG.log(Level.WARNING,
            "Trying to send a message to a task that is in state: {0}. Ignoring.",
            this.currentStatus.getState());
      } else {
        try {
          this.deliverMessageToTask(message);
        } catch (final TaskMessageHandlerFailure taskMessageHandlerFailure) {
          LOG.log(Level.WARNING, "Exception while executing task close handler.",
              taskMessageHandlerFailure.getCause());
          this.currentStatus.setException(taskMessageHandlerFailure.getCause());
        }
      }
    }
  }