Suspend the Task.  This calls the configured suspend handler.

@param message the optional message for the suspend handler or null if there none.
199673
public void suspend(final byte[] message) {
    synchronized (this.heartBeatManager) {
      if (this.currentStatus.isNotRunning()) {
        LOG.log(Level.WARNING, "Trying to suspend a task that is in state: {0}. Ignoring.",
            this.currentStatus.getState());
      } else {
        try {
          this.suspendTask(message);
          this.currentStatus.setSuspendRequested();
        } catch (final TaskSuspendHandlerFailure taskSuspendHandlerFailure) {
          LOG.log(Level.WARNING, "Exception while executing task suspend handler.",
              taskSuspendHandlerFailure.getCause());
          this.currentStatus.setException(taskSuspendHandlerFailure.getCause());
        }
      }
    }
  }
598267
private Handler<AsyncResult<String>> createDeploymentHandler(final Message<JsonObject> message) {
    return new Handler<AsyncResult<String>>() {
      @Override
      public void handle(AsyncResult<String> result) {
        if (result.failed()) {
          message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
        } else {
          addNewDeployment(result.result(), message.body(), new Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<String> result) {
              message.reply(new JsonObject().putString("status", "ok").putString("id", result.result()));
            }
          });
        }
      }
    };
  }
880359
public static void message(String message, Throwable e) {
    if(message == null && e != null) {
      message = e.getMessage();
    }
    logExpensive(Level.INFO, message, e);
  }
501484
public void processMessage (Message msg)
    {
        if (_client.getRunQueue().isRunning()) {
            // append it to our queue
            _actions.append(msg);
            // and queue ourselves up to be run
            _client.getRunQueue().postRunnable(this);
        } else {
            log.info("Dropping message as RunQueue is shutdown", "msg", msg);
        }
    }
1355990
public void warn(final String message) {
        messages.add(new LogMessage(message, LogMessage.Type.WARN));
        log.warn(message);
    }
288692
public void onMessage(WSMessage message) {
        log.trace("Listeners: {}", listeners.size());
        for (IWebSocketDataListener listener : listeners) {
            try {
                listener.onWSMessage(message);
            } catch (Exception e) {
                log.warn("onMessage exception", e);
            }
        }
    }
1174798
public void handleMessage (Message message)
    {
        // if the client has been getting crazy with the cheeze whiz, stick a fork in them; the
        // first time through we end our session, subsequently _throttle is null and we just drop
        // any messages that come in until we've fully shutdown
        if (_throttle == null) {
//             log.info("Dropping message from force-quit client", "conn", getConnection(),
//                      "msg", message);
            return;

        } else if (_throttle.throttleOp(message.received)) {
            handleThrottleExceeded();
        }

        dispatchMessage(message);
    }
300820
public int handleMessage(BaseMessage message)
    {
        String strClassName = this.getMessageProcessorClassName(message);
        if ((strClassName == null) || (strClassName.length() == 0))
            return this.handleOtherMessage(message);
        message.consume();      // I'll be handling this one.
        String strParams = Utility.addURLParam(null, DBParams.PROCESS, strClassName);
        App application = m_application;
        if (message.getProcessedByClientSession() instanceof RemoteTask)
            if (message.getProcessedByClientSession() instanceof Task)  // Always
                application = ((Task)message.getProcessedByClientSession()).getApplication();    // If I have the task session, run this task under the same app
        MessageProcessRunnerTask task = new MessageProcessRunnerTask(application, strParams, null);
        task.setMessage(message);
        m_application.getTaskScheduler().addTask(task);
        return DBConstants.NORMAL_RETURN;   // No need to call super.
    }
479359
@SuppressWarnings("unchecked")
  private void doMessage(final JsonObject message) {
    Object value = deserializer.deserialize(message);
    if (value != null && messageHandler != null) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("%s - Received: Message[id=%d, value=%s]", this, message.getLong("id"), value));
      }
      messageHandler.handle(value);
    }
    for (InputHook hook : hooks) {
      hook.handleReceive(value);
    }
  }
381740
@Override
    public void suspend()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "suspend");

        _suspendedUOWType = ((UOWCurrent) _tranManager).getUOWType();

        switch (_suspendedUOWType)
        {
            case UOWCurrent.UOW_LOCAL:

                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "suspending (local)");
                }

                _suspendedUOW = LocalTranCurrentSet.instance().suspend();

                break;

            case UOWCurrent.UOW_GLOBAL:

                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "suspending (global)");
                }

                _suspendedUOW = _tranManager.suspend();

                break;

            case UOWCurrent.UOW_NONE:

                _suspendedUOW = null;
                break;

            default:
                break;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "suspend", _suspendedUOWType);
    }
1236343
public void prependMessage(String message) {
        if (iMessage == null) {
            iMessage = message;
        } else if (message != null) {
            iMessage = message + ": " + iMessage;
        }
    }
777997
@Override
    public void onReceive(Object message) {
        if (message instanceof NewMessage) {
            NewMessage newMessage = (NewMessage) message;
            onNewMessage(newMessage.getPeer(), newMessage.getSender(), newMessage.getSortDate(),
                    newMessage.getContentDescription(), newMessage.getHasCurrentUserMention(),
                    newMessage.getUnreadMessagesCount(), newMessage.getUnreadDialogsCount());
        } else if (message instanceof MessagesRead) {
            MessagesRead read = (MessagesRead) message;
            onMessagesRead(read.getPeer(), read.getFromDate());
        } else if (message instanceof PauseNotifications) {
            onNotificationsPaused();
        } else if (message instanceof ResumeNotifications) {
            onNotificationsResumed();
        } else {
            super.onReceive(message);
        }
    }
276591
protected void handleMessage(@NonNull VoidMessage message) {
        if (message == null) {
            //            log.info("sI_{} got null message", getShardIndex());
            return;
        }

        if (message.getTargetId() >= 0 && message.getTargetId() != shardIndex) {
            log.warn("sI_{}: Skipping message: [{}]; TargetIdx: [{}]", shardIndex, message.getClass().getSimpleName(),
                            message.getTargetId());
            return;
        }

        //      log.info("sI_{}: Processing message: [{}]", shardIndex, message.getClass().getSimpleName());

        message.attachContext(voidConfiguration, trainer, clipboard, transport, storage, nodeRole, shardIndex);
        message.processMessage();
    }
253372
public void setMessage( Message message ) {
        Assert.notNull(message, "The message is required");
        Assert.hasText( message.getMessage(), "The message text is required" );
        this.message = message;
    }
199201
protected void addMessage(String message)
    {
        messages.add(message);
        messageCount++;
        if (messageCount > messagesQueueMax)
        {
            messages.remove();
            messageCount--;
        }
    }
260923
private void doPushMessage(AbstractMessage message) {
        if (log.isTraceEnabled()) {
            String msgType = message.getMessageType();
            log.trace("doPushMessage: {}", msgType);
        }
        IMessageOutput out = msgOutReference.get();
        if (out != null) {
            try {
                out.pushMessage(message);
                if (message instanceof RTMPMessage) {
                    IRTMPEvent body = ((RTMPMessage) message).getBody();
                    // update the last message sent's timestamp
                    lastMessageTs = body.getTimestamp();
                    IoBuffer streamData = null;
                    if (body instanceof IStreamData && (streamData = ((IStreamData<?>) body).getData()) != null) {
                        bytesSent.addAndGet(streamData.limit());
                    }
                }
            } catch (IOException err) {
                log.warn("Error while pushing message", err);
            }
        } else {
            log.warn("Push message failed due to null output pipe");
        }
    }
327292
def suspend(status)
      raise "Cannot suspend while in exclusive mode" if exclusive?
      raise "Cannot suspend a task from outside of itself" unless Task.current == self

      @status = status

      # !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
      # rubocop:disable Style/GlobalVars
      if $CELLULOID_DEBUG && @dangerous_suspend
        Internals::Logger.with_backtrace(caller[2...8]) do |logger|
          logger.warn "Dangerously suspending task: type=#{@type.inspect}, meta=#{@meta.inspect}, status=#{@status.inspect}"
        end
      end
      # rubocop:enable Style/GlobalVars

      value = signal

      @status = :running
      raise value if value.is_a?(Celluloid::Interruption)
      value
    end