This method is invoked by the RemoteManager when a message from the evaluator shim is received.

@param statusMessage the message from the evaluator shim indicating that the shim has started and is ready to
start the evaluator process.
181326
@Override
  public void onNext(final RemoteMessage<EvaluatorShimProtocol.EvaluatorShimStatusProto> statusMessage) {

    EvaluatorShimProtocol.EvaluatorShimStatusProto message = statusMessage.getMessage();
    String containerId = message.getContainerId();
    String remoteId = message.getRemoteIdentifier();

    LOG.log(Level.INFO, "Got a status message from evaluator shim = {0} with containerId = {1} and status = {2}.",
        new String[]{remoteId, containerId, message.getStatus().toString()});

    if (message.getStatus() != EvaluatorShimProtocol.EvaluatorShimStatus.ONLINE) {
      LOG.log(Level.SEVERE, "Unexpected status returned from the evaluator shim: {0}. Ignoring the message.",
          message.getStatus().toString());
      return;
    }

    this.onResourceAllocated(containerId, remoteId, Optional.<CloudTask>empty());
  }
675045
private void checkStarted() throws SIResourceException {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "checkStarted");

        synchronized (_mpStartStopLock) {
            if (!isStarted()) {
                if (TraceComponent.isAnyTracingEnabled()
                    && tc.isEntryEnabled())
                    SibTr.exit(tc, "checkStarted", "ME not started");

                throw new SIResourceException(nls.getFormattedMessage(
                                                                      "MESSAGE_PROCESSOR_NOT_STARTED_ERROR_CWSIP0211",
                                                                      new Object[] { getMessagingEngineName(),
                                                                                    getMessagingEngineBus() }, null));
            }
        }

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "checkStarted");
    }
572739
@Override
  public void onNext(final Alarm alarm) {
    String jobId = this.azureBatchHelper.getAzureBatchJobId();
    List<CloudTask> allTasks = this.azureBatchHelper.getTaskStatusForJob(jobId);

    // Report status if the task has an associated active container.
    LOG.log(Level.FINER, "Found {0} tasks from job id {1}", new Object[]{allTasks.size(), jobId});
    for (CloudTask task : allTasks) {
      Optional<EvaluatorManager> optionalEvaluatorManager = this.evaluators.get(task.id());

      if (!optionalEvaluatorManager.isPresent() && !TaskState.COMPLETED.equals(task.state())) {
        // This usually means that the evaluator shim has started, but hasn't sent the status message
        // back to the driver yet.
        LOG.log(Level.FINE, "No Evaluator found for Azure Batch task id = {0}. Ignoring.", task.id());
      } else if (!optionalEvaluatorManager.isPresent() && TaskState.COMPLETED.equals(task.state())) {
        // This indicates that the evaluator shim exited prematurely. We inform REEF of resource allocation
        // so it's possible to trigger an event signaling resource failure later.
        LOG.log(Level.INFO, "Azure Batch task id = {0} is in 'COMPLETED' state, but it does not have " +
            "an Evaluator associated with it. This indicates that the evaluator shim has failed before " +
            "it could send a callback to the driver.", task.id());
        this.evaluatorShimManager.get().onResourceAllocated(task.id(), PLACEHOLDER_REMOTE_ID, Optional.of(task));
      } else if (optionalEvaluatorManager.get().isClosedOrClosing()) {
        LOG.log(Level.FINE, "Evaluator id = {0} is closed. Ignoring.", task.id());
      } else {
        LOG.log(Level.FINE, "Reporting status for Task Id: {0} is [Azure Batch Status]:{1} ",
            new Object[]{task.id(), task.state().toString()});
        this.evaluatorShimManager.get().onAzureBatchTaskStatus(task);
      }
    }

    synchronized (this) {
      if (this.isAlarmEnabled()) {
        this.scheduleAlarm();
      }
    }
  }
1094736
public void deleteMessageFromQueue(Message sqsMessage, ProgressStatus progressStatus) {
        final Object reportObject = progressReporter.reportStart(progressStatus);
        boolean deleteMessageSuccess = false;
        try {
            sqsClient.deleteMessage(new DeleteMessageRequest(config.getSqsUrl(), sqsMessage.getReceiptHandle()));
            deleteMessageSuccess = true;
        } catch (AmazonServiceException e) {
            LibraryUtils.handleException(exceptionHandler, progressStatus, e, "Failed to delete sqs message.");
        }
        LibraryUtils.endToProcess(progressReporter, deleteMessageSuccess, progressStatus, reportObject);
    }
1064183
@Override
    public void onReceive(Object message) {
        try {
            // Start all workers
            if (message instanceof InitialRequestToManager) {
                director = getSender();
                logger.info("parallec task state : "
                        + ParallelTaskState.IN_PROGRESS.toString());
                task.setState(ParallelTaskState.IN_PROGRESS);
                task.setExecuteStartTime(startTime);

                taskId = task.getTaskId();

                // assumption: at least REDUCE_LEN
                taskIdTrim = taskId.length() <= REDUCE_LEN ? taskId : taskId
                        .substring(taskId.length() - REDUCE_LEN,
                                taskId.length());

                httpMeta = task.getHttpMeta();
                targetHostMeta = task.getTargetHostMeta();
                final RequestProtocol requestProtocol = task
                        .getRequestProtocol();

                // Get request parameters to construct a REST CALL
                final String requestUrlPrefixOrig = httpMeta
                        .getRequestUrlPostfix();
                final HttpMethod httpMethod = httpMeta.getHttpMethod();

                String requestPortStrOrig = httpMeta.getRequestPort();

                final boolean pollable = httpMeta.isPollable();

                final int maxConcurrency = task.getConcurrency();

                Map<String, NodeReqResponse> nodeDataMapValid = task
                        .getParallelTaskResult();

                logger.info("Before Safety Check: total entry count: "
                        + nodeDataMapValid.size());

                Map<String, NodeReqResponse> nodeDataMapValidSafe = new HashMap<String, NodeReqResponse>();

                InternalDataProvider.getInstance()
                        .filterUnsafeOrUnnecessaryRequest(nodeDataMapValid,
                                nodeDataMapValidSafe);

                logger.info(
                        "After Safety Check: total entry count in nodeDataMapValidSafe: {}",
                        nodeDataMapValidSafe.size());

                logger.debug("maxConcurrency : {}", maxConcurrency);

                // after filter, no duplicated target hosts for this count.
                requestCount = nodeDataMapValidSafe.size();
                task.setRequestNumActual(requestCount);

                logger.info("!Obtain command request for target host meta id "
                        + targetHostMeta.getTargetHostId() + "  with count: "
                        + requestCount);
                // If there are no target hosts in the incoming message, send a
                // message back
                if (requestCount <= 0) {
                    getSender().tell(new ResponseFromManager(requestCount),
                            getSelf());
                    logger.info("req count <=0. return");
                    // not really error. just no task to run
                    reply(ParallelTaskState.COMPLETED_WITHOUT_ERROR,
                            new RuntimeException(
                                    "ReqCount after trim is 0. Return."));
                    return;
                }

                int sentRequestCounter = 0;

                asyncHttpClientGlobal = task.getAsyncHttpClient();

                final AsyncHttpClient asyncHttpClient = asyncHttpClientGlobal;

                // always send with valid safe data.
                for (Entry<String, NodeReqResponse> entry : nodeDataMapValidSafe
                        .entrySet()) {

                    final String targetHost = entry.getKey();
                    NodeReqResponse nodeReqResponse = entry.getValue();

                    final String requestContentOrig = nodeReqResponse
                            .getRequestParameters().get(
                                    PcConstants.REQUEST_BODY_PLACE_HOLDER);

                    final String requestContent = NodeReqResponse
                            .replaceStrByMap(
                                    nodeReqResponse.getRequestParameters(),
                                    requestContentOrig);
                    final String resourcePath = NodeReqResponse
                            .replaceStrByMap(
                                    nodeReqResponse.getRequestParameters(),
                                    requestUrlPrefixOrig);
                    // add support for port replacement
                    final String requestPortStr = NodeReqResponse
                            .replaceStrByMap(
                                    nodeReqResponse.getRequestParameters(),
                                    requestPortStrOrig);
                    int requestPort = 80;
                    try {
                        requestPort = Integer.parseInt(requestPortStr);
                    } catch (NumberFormatException nfe) {
                        logger.error(
                                "Error parsing replacable port with NumberFormatException. "
                                        + "No valid port for host {}. Now use default port 80",
                                targetHost);
                    }
                    // only pass when it is not in manager
                    final ParallecResponseHandler handler = task.getConfig()
                            .getHandlerExecutionLocation() == HandlerExecutionLocation.MANAGER ? null
                            : task.getHandler();
                    final Map<String, Object> responseContext = task
                            .getConfig().getHandlerExecutionLocation() == HandlerExecutionLocation.MANAGER ? null
                            : task.getResponseContext();
                    Map<String, String> httpHeaderMapLocal = new HashMap<String, String>();
                    httpHeaderMapLocal.putAll(httpMeta.getHeaderMetadata()
                            .getHeaderMap());

                    // 3rd, add the dynamic part ; generic var based
                    // replacement.
                    PcHttpUtils.replaceHttpHeaderMapNodeSpecific(
                            httpHeaderMapLocal,
                            nodeReqResponse.getRequestParameters());

                    /**
                     * If want to print to check
                     */
                    if (task.getConfig().isPrintHttpTrueHeaderMap()) {

                        for (Entry<String, String> headerEntry : httpHeaderMapLocal
                                .entrySet()) {
                            String headerKey = headerEntry.getKey();
                            String headerValue = headerEntry.getValue();

                            nodeReqResponse
                                    .getRequestParameters()
                                    .put(PcConstants.REQUEST_PARAMETER_HTTP_HEADER_PREFIX
                                            + headerKey, headerValue);
                        }

                    }

                    if (task.getConfig().isPrintPoller()) {
                        // put the one before encoding
                        nodeReqResponse.getRequestParameters().put(
                                PcConstants.NODE_REQUEST_NEED_POLLER,
                                Boolean.toString(pollable));
                    }

                    /**
                     * 20140310: END add pass HTTP header into Operation worker
                     * as part of the
                     */

                    String targetHostNew = nodeReqResponse
                            .getRequestParameters()
                            .get(PcConstants.UNIFORM_TARGET_HOST_VAR_WHEN_CHECK);
                    if (targetHostNew != null) {
                        nodeReqResponse.getRequestParameters().put(
                                PcConstants.NODE_REQUEST_TRUE_TARGET_NODE,
                                targetHostNew);
                    }

                    final String hostUniform = (targetHostNew == null) ? null
                            : targetHostNew;

                    nodeReqResponse.getRequestParameters().put(
                            PcConstants.NODE_REQUEST_STATUS,
                            SingleTargetTaskStatus.IN_PROGRESS.toString());

                    nodeReqResponse.getRequestParameters().put(
                            PcConstants.NODE_REQUEST_TRUE_CONTENT,
                            requestContent);

                    // put the one before encoding
                    nodeReqResponse.getRequestParameters().put(
                            PcConstants.NODE_REQUEST_TRUE_URL, resourcePath);

                    nodeReqResponse.getRequestParameters().put(
                            PcConstants.NODE_REQUEST_TRUE_PORT,
                            Integer.toString(requestPort));

                    nodeReqResponse.getRequestParameters().put(
                            PcConstants.NODE_REQUEST_HTTP_HEADER_META,
                            httpMeta.getHeaderMetadata().getHeaderStr());

                    long prepareRequestTime = System.currentTimeMillis();

                    String prepareRequestTimeStr = PcDateUtils
                            .getDateTimeStrStandard(new Date(prepareRequestTime));
                    nodeReqResponse.getRequestParameters().put(
                            PcConstants.NODE_REQUEST_PREPARE_TIME,
                            prepareRequestTimeStr);

                    final SshMeta sshMeta = task.getSshMeta();
                    final TcpMeta tcpMeta = task.getTcpMeta();
                    final UdpMeta udpMeta = task.getUdpMeta();

                    final PingMeta pingMeta = task.getPingMeta();
                    final ResponseHeaderMeta responseHeaderMeta = task
                            .getHttpMeta().getResponseHeaderMeta();

                    logger.debug("REQUEST GENERATED: "
                            + (sentRequestCounter + 1)
                            + " / "
                            + requestCount
                            + " after "
                            + Double.toString((prepareRequestTime - startTime) / 1000.0)
                            + " secs" + ":  (NOT SEND YET) " + targetHost
                            + " at " + prepareRequestTimeStr);

                    ActorRef worker = getContext().system().actorOf(
                            Props.create(OperationWorker.class,
                                    new TaskRequest(task.getConfig()
                                            .getActorMaxOperationTimeoutSec(),
                                            requestProtocol, targetHost,
                                            hostUniform, requestPort,
                                            resourcePath, requestContent,
                                            httpMethod, pollable,
                                            httpHeaderMapLocal, handler,
                                            responseContext, sshMeta, tcpMeta,
                                            udpMeta, pingMeta,
                                            responseHeaderMeta),
                                    asyncHttpClient, task.getHttpMeta()
                                            .getHttpPollerProcessor()

                            ));

                    workers.put(targetHost, worker);

                    ++sentRequestCounter;

                }// end for loop

                final RequestToBatchSenderAsstManager requestToBatchSenderAsstManager = new RequestToBatchSenderAsstManager(
                        taskId, task.getConfig()
                                .getAsstManagerRetryIntervalMillis(),
                        new ArrayList<ActorRef>(workers.values()), getSelf(),
                        maxConcurrency);

                batchSenderAsstManager = getContext().system().actorOf(
                        Props.create(AssistantExecutionManager.class),
                        "RequestToBatchSenderAsstManager-"
                                + UUID.randomUUID().toString());

                batchSenderAsstManager.tell(requestToBatchSenderAsstManager,
                        getSelf());

                final FiniteDuration timeOutDuration = Duration
                        .create(task.getConfig().getTimeoutInManagerSec(),
                                TimeUnit.SECONDS);
                timeoutMessageCancellable = getContext()
                        .system()
                        .scheduler()
                        .scheduleOnce(timeOutDuration, getSelf(),
                                ExecutionManagerMsgType.OPERATION_TIMEOUT,
                                getContext().system().dispatcher(), getSelf());

                logger.debug(
                        "Scheduled TIMEOUT_IN_MANAGER_SCONDS OPERATION_TIMEOUT after SEC {} ",
                        task.getConfig().getTimeoutInManagerSec());
            } else if (message instanceof ResponseOnSingleTask) {

                ResponseOnSingleTask taskResponse = (ResponseOnSingleTask) message;

                this.responseCount += 1;
                task.setResponsedNum(responseCount);

                /**
                 * add feedback of current responseCount to asst manager
                 * ResponseCountToBatchSenderAsstManager
                 */
                final ResponseCountToBatchSenderAsstManager responseCountToBatchSenderAsstManager = new ResponseCountToBatchSenderAsstManager(
                        this.responseCount);

                batchSenderAsstManager.tell(
                        responseCountToBatchSenderAsstManager, getSelf());

                logger.debug("Send batchSenderAsstManager to responseCountToBatchSenderAsstManager: "
                        + this.responseCount);

                String hostName = taskResponse.getRequest().getHost();
                if (responseMap.containsKey(hostName)) {
                    logger.error("ERROR: duplicate response received {}", hostName);
                }
                responseMap.put(hostName, taskResponse);

                String responseSummary = taskResponse.isError() ? "FAIL_GET_RESPONSE: "
                        + taskResponse.getErrorMessage()
                        : taskResponse.getStatusCode();
                Map<String, LinkedHashSet<String>> resultMap = task
                        .getAggregateResultMap();
                if (resultMap.containsKey(responseSummary)) {
                    resultMap.get(responseSummary).add(hostName);
                } else {
                    LinkedHashSet<String> set = new LinkedHashSet<String>();
                    set.add(hostName);
                    resultMap.put(responseSummary, set);
                }

                // save response to result map
                NodeReqResponse nrr = task.getParallelTaskResult()
                        .get(hostName);
                nrr.setSingleTaskResponse(taskResponse);

                String responseTrim = taskResponse.getResponseContent() == null ? null
                        : taskResponse.getResponseContent().trim();
                String displayResponse = (Strings.isNullOrEmpty(responseTrim)) ? "EMPTY"
                        : responseTrim
                                .substring(
                                        0,
                                        Math.min(
                                                PcConstants.AGNET_RESPONSE_MAX_RESPONSE_DISPLAY_BYTE,
                                                responseTrim.length()));

                long responseReceiveTime = System.currentTimeMillis();
                // %.5g%n
                double progressPercent = (double) (responseCount)
                        / (double) (requestCount) * 100.0;
                String responseReceiveTimeStr = PcDateUtils
                        .getDateTimeStrStandard(new Date(responseReceiveTime));
                String secondElapsedStr = Double
                        .toString((responseReceiveTime - startTime) / 1000.0);

                // log the first/ last 5 percent; then sample the middle
                if (requestCount < ParallecGlobalConfig.logAllResponseIfTotalLessThan
                        || responseCount <= ParallecGlobalConfig.logAllResponseBeforeInitCount
                        || progressPercent < ParallecGlobalConfig.logAllResponseBeforePercent
                        || progressPercent > ParallecGlobalConfig.logAllResponseAfterPercent
                        || responseCount
                                % ParallecGlobalConfig.logResponseInterval == 0) {
                    // percent is escaped using percent sign; hostName
                    logger.info(String
                            .format("\n[%d]__RESP_RECV_IN_MGR %d (+%d) / %d (%.5g%%)  "
                                    + "AFT %s S @ %s @ %s , TaskID : %s , CODE: %s, RESP_BRIEF: %s %s",
                                    responseCount,
                                    responseCount,
                                    requestCount - responseCount,
                                    requestCount,
                                    progressPercent,
                                    secondElapsedStr,
                                    hostName,
                                    responseReceiveTimeStr,
                                    taskIdTrim,
                                    taskResponse.getStatusCode(),
                                    displayResponse,
                                    taskResponse.getErrorMessage() == null ? ""
                                            : ", ERR: "
                                                    + taskResponse
                                                            .getErrorMessage()));
                }

                nrr.getRequestParameters().put(PcConstants.NODE_REQUEST_STATUS,
                        SingleTargetTaskStatus.COMPLETED.toString());

                if (task.getConfig().getHandlerExecutionLocation() == HandlerExecutionLocation.MANAGER
                        && task != null && task.getHandler() != null) {
                    try {
                        // logger.debug("HANDLE In manager: " +
                        // taskResponse.getHost());
                        task.getHandler().onCompleted(taskResponse,
                                task.getResponseContext());
                    } catch (Exception t) {
                        logger.error(
                                "Error handling onCompleted in manager for response: {} Error {}",
                                taskResponse.toString(),
                                t.getLocalizedMessage());
                    }
                }

                if (!task.getConfig().isSaveResponseToTask()) {
                    taskResponse.setResponseContent(PcConstants.NOT_SAVED);
                    taskResponse.setResponseHeaders(null);
                    logger.debug("Erased single task response content and response headers to save space.");
                }

                if (this.responseCount == this.requestCount) {
                    if (wasIssuedCancel) {
                        ExecutionManagerExecutionException exCanceled = new ExecutionManagerExecutionException(
                                "ExecutionManager: task was canceled by user",
                                ManagerExceptionType.CANCEL);
                        reply(ParallelTaskState.COMPLETED_WITH_ERROR,
                                exCanceled);
                    } else {
                        reply(ParallelTaskState.COMPLETED_WITHOUT_ERROR, null);
                    }

                }// end when all requests have resonponse

            } else if (message instanceof CancelTaskOnHostRequest) {
                CancelTaskOnHostRequest msg = (CancelTaskOnHostRequest) message;
                cancelRequestAndWorkerOnHost(msg.getTargetHosts());

            } else if (message instanceof ExecutionManagerMsgType) {
                switch ((ExecutionManagerMsgType) message) {

                // this will immediately return. not waiting for the op workers
                // reply
                case OPERATION_TIMEOUT:
                    cancelRequestAndWorkers();
                    String msg = "Execution manager timeout on whole Parallel Task.";
                    ExecutionManagerExecutionException ex = new ExecutionManagerExecutionException(
                            msg,
                            ManagerExceptionType.TIMEOUT);
                    logger.error(msg);
                    reply(ParallelTaskState.COMPLETED_WITH_ERROR, ex);
                    
                    break;
                // this will wait for the works to reply.
                case CANCEL:
                    cancelRequestAndWorkers();
                    wasIssuedCancel = true;
                    break;
                default:
                    break;
                }
            } else {
                logger.error("Unhandled: " + message);
                unhandled(message);
            }

        } catch (Exception t) {
            logger.error("Command Manager error: " + t + " trace: ", t);

            // not to terminate: but add error details. Will exit after timeout
            // or cancel
            task.getTaskErrorMetas().add(
                    new TaskErrorMeta(TaskErrorType.COMMAND_MANAGER_ERROR,
                            t == null ? "NA" : t.getLocalizedMessage()));
            reply(ParallelTaskState.COMPLETED_WITH_ERROR, t);

        }

    }
855566
private void notifyStatus(SmsMessage message) {
        URI callback = message.getStatusCallback();
        if (callback != null) {
            String method = message.getStatusCallbackMethod();
            if (method != null && !method.isEmpty()) {

                if (!org.apache.http.client.methods.HttpGet.METHOD_NAME.equalsIgnoreCase(method)
                        && !org.apache.http.client.methods.HttpPost.METHOD_NAME.equalsIgnoreCase(method)) {
                    final Notification notification = notification(WARNING_NOTIFICATION, 14104, method
                            + " is not a valid HTTP method for <Sms>");
                    storage.getNotificationsDao().addNotification(notification);
                    method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
                }
            } else {
                method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
            }


            List<NameValuePair> parameters = populateReqParams(message);
            HttpRequestDescriptor request = new HttpRequestDescriptor(callback, method, parameters);
            downloader().tell(request, self());

        }
    }
689530
def showStatus(self, msg):
        
        log.debug(msg)
        self.statusBar().showMessage(msg)
574783
public synchronized void statusMachine(final String status, final DeviceState state) throws DevFailed {
        if (status != null) {
            logger.debug("Changing status to: {}", status);
            this.status = status;
            if (setStatusMethod != null) {
                try {
                    setStatusMethod.invoke(businessObject, status);
                } catch (final IllegalArgumentException e) {
                    throw DevFailedUtils.newDevFailed(e);
                } catch (final IllegalAccessException e) {
                    throw DevFailedUtils.newDevFailed(e);
                } catch (final InvocationTargetException e) {
                    if (e.getCause() instanceof DevFailed) {
                        throw (DevFailed) e.getCause();
                    } else {
                        throw DevFailedUtils.newDevFailed(e.getCause());
                    }
                }
            }
        }
    }
1346445
public void onResourceStatusMessage(final ResourceStatusEvent resourceStatusEvent) {

    synchronized (this.evaluatorDescriptor) {

      final State state = resourceStatusEvent.getState();
      LOG.log(Level.FINEST, "Resource manager state update: {0}", state);

      if (!this.stateManager.isAvailable()) {

        LOG.log(Level.FINE,
            "Ignoring resource status update for Evaluator {0} which is already in state {1}.",
            new Object[] {this.getId(), this.stateManager});

      } else if (state.isCompleted() && this.stateManager.isAvailable()) {

        // Something is wrong. The resource manager reports that the Evaluator is done or failed,
        // but the Driver assumes it to be alive.
        final StringBuilder messageBuilder = new StringBuilder("Evaluator [")
            .append(this.evaluatorId)
            .append("] is assumed to be in state [")
            .append(this.stateManager.toString())
            .append("]. But the resource manager reports it to be in state [")
            .append(state)
            .append("].");

        if (this.stateManager.isSubmitted()) {
          messageBuilder
              .append(" This most likely means that the Evaluator suffered a failure before establishing " +
                  "a communications link to the driver.");
        } else if (this.stateManager.isAllocated()) {
          messageBuilder.append(" This most likely means that the Evaluator suffered a failure before being used.");
        } else if (this.stateManager.isRunning()) {
          messageBuilder.append(" This means that the Evaluator failed but wasn't able to send an error message " +
              "back to the driver.");
        }

        if (this.task.isPresent()) {
          messageBuilder.append(" Task [")
              .append(this.task.get().getId())
              .append("] was running when the Evaluator crashed.");
        }

        if (resourceStatusEvent.getState() == State.KILLED) {
          this.onEvaluatorException(
              new EvaluatorKilledByResourceManagerException(this.evaluatorId, messageBuilder.toString()));
        } else {
          this.onEvaluatorException(new EvaluatorException(this.evaluatorId, messageBuilder.toString()));
        }
      }
    }
  }
478368
@Override
    public void notifyMessageReceived(SQSMessage message) throws JMSException {
        SQSMessageIdentifier messageIdentifier = SQSMessageIdentifier.fromSQSMessage(message);
        if (!unAckMessages.contains(messageIdentifier)) {
            unAckMessages.add(messageIdentifier);
        }
    }
1215449
private synchronized void remoteStatus(final String anode,
            final boolean up, final Object info) {
        if (handler == null) {
            return;
        }
        try {
            handler.remoteStatus(anode, up, info);
        } catch (final Exception e) {
        }
    }
506037
public void sendSilenceMessage(
     long startStamp,
     long endStamp,
     long completedPrefix,
     boolean requestedOnly,
     int priority,
     Reliability reliability,
     SIBUuid12 stream)
     throws SIResourceException
   {

     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
       SibTr.entry(tc, "sendSilenceMessage",
         new Object[] {
           new Long(startStamp),
           new Long(endStamp),
           new Long(completedPrefix),
           new Integer(priority),
           reliability });

     ControlSilence sMsg;
     try
     {
       // Create new Silence message
       sMsg = _cmf.createNewControlSilence();
     }
     catch (Exception e)
     {
       // FFDC
       FFDCFilter.processException(
         e,
         "com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendSilenceMessage",
         "1:787:1.164.1.5",
         this);

       SibTr.exception(tc, e);
       SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
         new Object[] {
           "com.ibm.ws.sib.processor.impl.PubSubOutputHandler",
           "1:794:1.164.1.5",
           e });

       if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
         SibTr.exit(tc, "sendSilenceMessage", e);

       throw new SIResourceException(
         nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.impl.PubSubOutputHandler",
            "1:805:1.164.1.5",
            e },
          null),
         e);
     }

     // As we are using the Guaranteed Header - set all the attributes as 
     // well as the ones we want.
     SIMPUtils.setGuaranteedDeliveryProperties(sMsg,
         _messageProcessor.getMessagingEngineUuid(), 
         null,
         stream,
         null,
         _destinationHandler.getUuid(),
         ProtocolType.PUBSUBINPUT,
         GDConfig.PROTOCOL_VERSION);
    
     sMsg.setStartTick(startStamp);
     sMsg.setEndTick(endStamp);
     sMsg.setPriority(priority);
     sMsg.setReliability(reliability);
     sMsg.setCompletedPrefix(completedPrefix);
     sMsg.setRequestedOnly(requestedOnly);
     
     // If the destination in a Link add Link specific properties to message
     if( _isLink )
     {
       sMsg = (ControlSilence)addLinkProps(sMsg);
     }
    
     // Send message to destination
     // Using MPIO

     // Send the message to the MessageTransmitter
     //add a target cellule to the array for sending
     SIBUuid8[] fromTo = new SIBUuid8[1];
     fromTo[0] = _targetMEUuid;
      
     // Send at priority+1 if this is a response to a Nack
     if( requestedOnly )
       _mpio.sendDownTree(fromTo, priority+1, sMsg);
     else
       _mpio.sendDownTree(fromTo, priority, sMsg);

     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
       SibTr.exit(tc, "sendSilenceMessage");

   }
70953
public void onReceive(Object message) {

        // Start all workers
        if (message instanceof RequestToBatchSenderAsstManager) {

            // clear responseMap

            RequestToBatchSenderAsstManager request = (RequestToBatchSenderAsstManager) message;
            originalManager = getSender();
            taskId = request.getTaskId();
            asstManagerRetryIntervalMillis = request
                    .getAsstManagerRetryIntervalMillis();
            // assumption: at least 12
            taskIdTrim = taskId.length() <= 12 ? taskId
                    : taskId.substring(taskId.length() - 12,
                            taskId.length());
            workers = request.getWorkers();
            maxConcurrencyAdjusted = request.getMaxConcurrency();

            requestTotalCount = workers.size();

            sendMessageUntilStopCount(maxConcurrencyAdjusted);

            // if not completed; will schedule a continue send msg
            if (processedWorkerCount < requestTotalCount) {

                waitAndRetry();
                return;
            } else {
                logger.info("Now finished sending all needed messages. Done job of ASST Manager at "
                        + PcDateUtils.getNowDateTimeStrStandard());
                return;
            }
        } else if (message instanceof ContinueToSendToBatchSenderAsstManager) {

            // now reaching the end; have processed all of them, just waiting
            // the response to come back
            int notProcessedNodeCount = requestTotalCount
                    - processedWorkerCount;
            if (notProcessedNodeCount <= 0) {
                logger.info("!Finished sending all msg in ASST MANAGER at "
                        + PcDateUtils.getNowDateTimeStrStandard()

                        + " STOP doing wait and retry.");
                return;
            }

            int extraSendCount = maxConcurrencyAdjusted
                    - (processedWorkerCount - responseCount);

            if (extraSendCount > 0) {
                logger.info("HAVE ROOM to send extra of : " + extraSendCount
                        + " MSG. now Send at "
                        + PcDateUtils.getNowDateTimeStrStandard());

                sendMessageUntilStopCount(processedWorkerCount + extraSendCount);
                waitAndRetry();
            } else {
                logger.info("NO ROOM to send extra. Windowns is full. extraSendCount is negative: "
                        + extraSendCount
                        + " reschedule now at "
                        + PcDateUtils.getNowDateTimeStrStandard());
                waitAndRetry();

            }
        } else if (message instanceof ResponseCountToBatchSenderAsstManager) {

            responseCount = ((ResponseCountToBatchSenderAsstManager) message)
                    .getResponseCount();

            logger.debug("RECV IN batchSenderAsstManager FROM ExecutionManager responseCount: "
                    + responseCount);

        }
    }
1257688
@Test
    public void managed_send_and_receive_is_working() throws JMSException {
        testSender1.send("MANAGED");

        try {
            managed.await(1, TimeUnit.SECONDS);

            Assertions.assertThat(textManaged).isEqualTo("MANAGED");
        } catch (InterruptedException e) {
            fail("Thread interrupted");
        }
    }
465399
public void setStatus(int code,String message)
    {
        setStatus(code);
        Integer code_integer=TypeUtil.newInteger(code);
        if (message == null)
        {
            message = (String)__statusMsg.get(code_integer);
            if (message==null)
                message=""+code;
            setReason(message);
        }
        else
            setReason(UrlEncoded.encodeString(message));
    }
1188010
public synchronized void setJobAsFailed(String errorMessage) {
    mJobInfo.setStatus(Status.FAILED);
    mJobInfo.setErrorMessage(errorMessage);
  }
669862
public synchronized void messagingEngineInitializing(
            final JsMessagingEngine messagingEngine) {

        final String methodName = "messagingEngineInitializing";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, messagingEngine);
        }

        if (_remoteMessagingEngine
                && messagingEngine.getBusName().equals(
                        _endpointConfiguration.getBusName())) {

            /*
             * A remote connection is no longer required. Stop any timers
             * attempting to connect and close any existing remote connection.
             */

            SibTr.info(TRACE, "ME_INITIALIZING_CWSIV0778", new Object[] {
                    messagingEngine.getName(),
                    _endpointConfiguration.getBusName(), this });

            _remoteMessagingEngine = false;
            if (_remoteConnection != null) {
                _remoteConnection.close();
            }
            _timer.cancel();

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }