Processes a BASIC_REPORT / BASIC_SET message.

@param serialMessage the incoming message to process.
@param offset the offset position from which to start message processing.
@param endpoint the endpoint or instance number this message is meant for.
486744
protected void processBasicReport(SerialMessage serialMessage, int offset, int endpoint) {
		int value = serialMessage.getMessagePayloadByte(offset + 1); 
		logger.debug(String.format("Basic report from nodeId = %d, value = 0x%02X", this.getNode().getNodeId(), value));
		Object eventValue;
		if (value == 0) {
			eventValue = "OFF";
		} else if (value < 99) {
			eventValue = value;
		} else {
			eventValue = "ON";
		}
		ZWaveEvent zEvent = new ZWaveEvent(ZWaveEventType.BASIC_EVENT, this.getNode().getNodeId(), endpoint, eventValue);
		this.getController().notifyEventListeners(zEvent);
	}
966975
public void process(final Exchange exchange) throws Exception {
        final Message in = exchange.getIn();

        final String contentType = in.getHeader(CONTENT_TYPE, "", String.class);
        final String body = in.getBody(String.class);
        final Set<String> endpoints = new HashSet<>();

        for (final String s : in.getHeader(REINDEXING_RECIPIENTS, "", String.class).split(",")) {
            endpoints.add(s.trim());
        }

        if (contentType.equals("application/json") && body != null && !body.trim().isEmpty()) {
            try {
                final JsonNode root = MAPPER.readTree(body);
                final Iterator<JsonNode> ite = root.elements();
                while (ite.hasNext()) {
                    final JsonNode n = ite.next();
                    endpoints.add(n.asText());
                }
            } catch (JsonProcessingException e) {
                LOGGER.debug("Invalid JSON", e);
                in.setHeader(HTTP_RESPONSE_CODE, BAD_REQUEST);
                in.setBody("Invalid JSON");
            }
        }
        in.setHeader(REINDEXING_RECIPIENTS, join(",", endpoints));
    }
1341802
private void handleMultiInstanceReportResponse(SerialMessage serialMessage,
			int offset) {
		logger.trace("Process Multi-instance Report");
		int commandClassCode = serialMessage.getMessagePayloadByte(offset);
		int instances = serialMessage.getMessagePayloadByte(offset + 1);

		if (instances == 0) {
			setInstances(1);
		} else 
		{
			CommandClass commandClass = CommandClass.getCommandClass(commandClassCode);
			
			if (commandClass == null) {
				logger.error(String.format("Unsupported command class 0x%02x", commandClassCode));
				return;
			}
			
			logger.debug(String.format("Node %d Requested Command Class = %s (0x%02x)", this.getNode().getNodeId(), commandClass.getLabel() , commandClassCode));
			ZWaveCommandClass zwaveCommandClass = this.getNode().getCommandClass(commandClass);
			
			if (zwaveCommandClass == null) {
				logger.error(String.format("Unsupported command class %s (0x%02x)", commandClass.getLabel(), commandClassCode));
				return;
			}
			
			zwaveCommandClass.setInstances(instances);
			logger.debug(String.format("Node %d Instances = %d, number of instances set.", this.getNode().getNodeId(), instances));
		}
		
		for (ZWaveCommandClass zwaveCommandClass : this.getNode().getCommandClasses())
			if (zwaveCommandClass.getInstances() == 0) // still waiting for an instance report of another command class. 
				return;
		
		// advance node stage.
		this.getNode().advanceNodeStage();
	}
687871
public void sendMessage(Message message)
    {
        ((DualMessageQueue)this.getMessageQueue()).getMessageStack().sendMessage(message);
        
        ((BaseMessage)message).setProcessedByClient(true);     // Make sure any server doesn't send this back up.

        super.sendMessage(message);
    }
758958
private void sendMessage(BeanMessageID type, Buffer payload) {
        Buffer buffer = new Buffer();
        buffer.writeByte((type.getRawValue() >> 8) & 0xff);
        buffer.writeByte(type.getRawValue() & 0xff);
        if (payload != null) {
            try {
                buffer.writeAll(payload);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        GattSerialMessage serialMessage = GattSerialMessage.fromPayload(buffer.readByteArray());
        gattClient.getSerialProfile().sendMessage(serialMessage.getBuffer());
    }
77326
private function receiveMessage(Message $message): void
    {
        if ($message instanceof Command) {
            $this->locator->getCommandBus()->receiveCommand($message);
            return;
        }

        if ($message instanceof Event) {
            $this->locator->getEventBus()->receiveEvent($message);
            return;
        }

        throw new BadRequestHttpException(
            'The receive endpoint cannot process requests.',
            null,
            Code::INVALID_ARGUMENT
        );
    }
1100355
@Override
    public void processMessage() {
        // this only picks up new training round
        //log.info("sI_{} Starting CBOW dot...", transport.getShardIndex());

        CbowRequestMessage cbrm = new CbowRequestMessage(rowsA, rowsB, w1, codes, negSamples, alpha, 119);
        if (negSamples > 0) {
            // unfortunately we have to get copy of negSamples here
            int negatives[] = Arrays.copyOfRange(rowsB, codes.length, rowsB.length);
            cbrm.setNegatives(negatives);
        }
        cbrm.setFrameId(-119L);
        cbrm.setTaskId(this.taskId);
        cbrm.setOriginatorId(this.getOriginatorId());


        // FIXME: get rid of THAT
        CbowTrainer cbt = (CbowTrainer) trainer;
        cbt.pickTraining(cbrm);


        // we calculate dot for all involved rows, and first of all we get mean word
        INDArray words = Nd4j.pullRows(storage.getArray(WordVectorStorage.SYN_0), 1, rowsA, 'c');
        INDArray mean = words.mean(0);

        int resultLength = codes.length + (negSamples > 0 ? (negSamples + 1) : 0);

        INDArray result = Nd4j.createUninitialized(resultLength, 1);
        int e = 0;
        for (; e < codes.length; e++) {
            double dot = Nd4j.getBlasWrapper().dot(mean, storage.getArray(WordVectorStorage.SYN_1).getRow(rowsB[e]));
            result.putScalar(e, dot);
        }

        // negSampling round
        for (; e < resultLength; e++) {
            double dot = Nd4j.getBlasWrapper().dot(mean,
                            storage.getArray(WordVectorStorage.SYN_1_NEGATIVE).getRow(rowsB[e]));
            result.putScalar(e, dot);
        }

        if (voidConfiguration.getExecutionMode() == ExecutionMode.AVERAGING) {
            DotAggregation dot = new DotAggregation(taskId, (short) 1, shardIndex, result);
            dot.setTargetId((short) -1);
            dot.setOriginatorId(getOriginatorId());
            transport.putMessage(dot);
        } else if (voidConfiguration.getExecutionMode() == ExecutionMode.SHARDED) {
            // send this message to everyone
            DotAggregation dot = new DotAggregation(taskId, (short) voidConfiguration.getNumberOfShards(), shardIndex,
                            result);
            dot.setTargetId((short) -1);
            dot.setOriginatorId(getOriginatorId());
            transport.sendMessage(dot);
        }
    }
1065821
private QYBaseRespMsg processMessageHandle(QYBaseReqMsg msg){
        if(CollectionUtil.isEmpty(messageHandles)){
            synchronized (LOCK){
                messageHandles = this.initMessageHandles();
            }
        }
        if(CollectionUtil.isNotEmpty(messageHandles)){
            for(QYMessageHandle messageHandle : messageHandles){
                QYBaseRespMsg resultMsg = null;
                boolean result;
                try{
                    result = messageHandle.beforeHandle(msg);
                }catch (Exception e){
                    result = false;
                }
                if(result){
                    resultMsg = messageHandle.handle(msg);
                }
                if(BeanUtil.nonNull(resultMsg)){
                    return resultMsg;
                }
            }
        }
        return null;
    }
1152388
public boolean invokeEndpoint(final MessageEndpoint endpoint,
            final SIBusMessage message, final AbstractConsumerSession session,
            final SITransaction transaction, String debugMEName)
            throws ResourceAdapterInternalException {

        final String methodName = "invokeEndpoint";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, new Object[] { endpoint,
                    message, session, transaction });
        }

        // Check that endpoint is a MessageListener
        if (!(endpoint instanceof MessageListener)) {

            throw new ResourceAdapterInternalException(NLS.getFormattedMessage(
                    ("UNEXPECTED_ENDPOINT_CWSJR1482"), new Object[] { endpoint,
                            MessageListener.class }, null));

        }

        final MessageListener listener = (MessageListener) endpoint;

        boolean success;
        try {

            // Convert to JMS message - no session to pass in, but do pass in 'pass thru' props
            final Message jmsMessage = _jmsUtils.inboundMessagePath(message,
                    null, passThruProps);
            
            // This is a debug property and only set if the value is not null (it will be null unless a
            // runtime system property is set.
            if ((debugMEName != null) && (!debugMEName.equals ("")))
            {
            	if (message instanceof JsJmsMessage)
            	{
            		((JsJmsMessage) message).setObjectProperty ("MEName", debugMEName);
            	}
            	else 
            	{
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) 
                    {
                    	SibTr.debug(TRACE, "Can not set MDB location in message as the message is not a JsJmsMessage - its a " + jmsMessage.getClass().getName());
                    }
            	}
            }
            
            // Deliver message
            listener.onMessage(jmsMessage);
            success = true;

        } catch (final Throwable exc) {

            // Failed to deliver message
            FFDCFilter.processException(exc, CLASS_NAME + "." + methodName,
                    FFDC_PROBE_1, this);
            if (TRACE.isEventEnabled()) {
                SibTr.exception(this, TRACE, exc);
            }
            success = false;

        }

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

    }
883501
public void setEndpoints(java.util.Collection<Endpoint> endpoints) {
        if (endpoints == null) {
            this.endpoints = null;
            return;
        }

        this.endpoints = new java.util.ArrayList<Endpoint>(endpoints);
    }
1294915
@Override
    public SIBusMessage[] processMsgSet(SIMessageHandle[] msgHandles,
                                        TransactionCommon transaction,
                                        BifurcatedConsumerSessionImpl owner,
                                        boolean unlock,
                                        boolean delete,
                                        boolean read,
                                        boolean incrementLockCount)

                    throws SISessionUnavailableException, SIMPMessageNotLockedException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "processMsgSet",
                        new Object[] { this,
                                      SIMPUtils.messageHandleArrayToString(msgHandles),
                                      transaction,
                                      owner,
                                      Boolean.valueOf(unlock),
                                      Boolean.valueOf(delete),
                                      Boolean.valueOf(read) });

        // Do a dirty read of the (volatile) closed/closing states to avoid the synch block if poss
        if (_closed || _closing)
        {
            this.lock();
            try
            {
                checkNotClosed();
            } finally
            {
                this.unlock();
            }
        }

        int numMsgs = 0;
        SIBusMessage messages[] = null;

        if (msgHandles != null && msgHandles.length > 0)
            numMsgs = msgHandles.length;

        if (numMsgs > 0)
        {
            // Actually process the message Ids
            messages = _allLockedMessages.processMsgSet(msgHandles, transaction, owner, unlock, delete, read, incrementLockCount);
        }

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

        return messages;
    }
624829
public void sendMessage(Message message)
    {
        try   {
            if (((RemoteMessageQueue)this.getMessageQueue()).isSendRemoteMessage((BaseMessage)message) == false)
                return;
            if (((BaseMessage)message).isProcessedByServer())
                return;     // Don't send back down (the server already processed it).
            if (((BaseMessage)message).isConsumed())
                return;     // Don't send if already handled.
            if (MessageConstants.LOCAL_QUEUE.equalsIgnoreCase(((BaseMessage)message).getMessageHeader().getQueueType()))
                return;     // Local queue only
            synchronized (m_sendQueue)
            {   // In case this is called from another task
                m_sendQueue.sendMessage(message);
            }
        } catch (RemoteException ex)    {
            ex.printStackTrace();
        }
    }
953409
private void sendOrPublishMessage(Message message) {
        if (endpointConfiguration.isPubSubDomain()) {
            if (log.isDebugEnabled()) {
                log.debug("Publish Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'");
            }
            vertx.eventBus().publish(endpointConfiguration.getAddress(), message.getPayload());
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Sending Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'");
            }
            vertx.eventBus().send(endpointConfiguration.getAddress(), message.getPayload());
        }
    }
1044405
private void handleIncomingRequestMessage(SerialMessage incomingMessage) {
		logger.debug("Message type = REQUEST");
		switch (incomingMessage.getMessageClass()) {
			case ApplicationCommandHandler:
				handleApplicationCommandRequest(incomingMessage);
				break;
			case SendData:
				handleSendDataRequest(incomingMessage);
				break;
			case ApplicationUpdate:
				handleApplicationUpdateRequest(incomingMessage);
				break;
		default:
			logger.warn(String.format("TODO: Implement processing of Request Message = %s (0x%02X)",
					incomingMessage.getMessageClass().getLabel(),
					incomingMessage.getMessageClass().getKey()));
			break;	
		}
	}
499292
protected void configureMessageEndpoint(ApplicationContext context) {
        if (context.containsBean(MESSAGE_ENDPOINT_BEAN_NAME)) {
            WebServiceEndpoint messageEndpoint = context.getBean(MESSAGE_ENDPOINT_BEAN_NAME, WebServiceEndpoint.class);

            EndpointAdapter endpointAdapter = webServiceServer.getEndpointAdapter();
            if (endpointAdapter != null) {
                messageEndpoint.setEndpointAdapter(endpointAdapter);
            }

            WebServiceEndpointConfiguration endpointConfiguration = new WebServiceEndpointConfiguration();
            endpointConfiguration.setHandleMimeHeaders(webServiceServer.isHandleMimeHeaders());
            endpointConfiguration.setHandleAttributeHeaders(webServiceServer.isHandleAttributeHeaders());
            endpointConfiguration.setKeepSoapEnvelope(webServiceServer.isKeepSoapEnvelope());
            endpointConfiguration.setMessageConverter(webServiceServer.getMessageConverter());
            messageEndpoint.setEndpointConfiguration(endpointConfiguration);

            if (StringUtils.hasText(webServiceServer.getSoapHeaderNamespace())) {
                messageEndpoint.setDefaultNamespaceUri(webServiceServer.getSoapHeaderNamespace());
            }

            if (StringUtils.hasText(webServiceServer.getSoapHeaderPrefix())) {
                messageEndpoint.setDefaultPrefix(webServiceServer.getSoapHeaderPrefix());
            }
        }
    }
1341443
@SuppressWarnings("unchecked")
    public int handleOtherMessage(BaseMessage message)
    {
        // Special case - This class can also be used to start an application
        if (m_properties != null)
            if (m_properties.get(DBParams.PROCESS) == null)
                if (m_properties.get("standalone") == null)
        {
            if ((message.getMessageHeader().get(REMOVE_LISTENER) != null)
                || (message.get(REMOVE_LISTENER) != null))
            {   // Special message to get rid of this listener (typically send by server app when it is created)
                this.free();
                message.consume();
            }
            else if (m_properties.get(DBParams.APPLICATION) != null)
            {
                String strApplicationClass = (String)m_properties.get(DBParams.APPLICATION);
                Application app  = (Application)ClassServiceUtility.getClassService().makeObjectFromClassName(strApplicationClass);
                if (app != null)
                {
                    Environment env = ((BaseApplication)m_application).getEnvironment();
                    MessageApp messageApp = env.getMessageApplication(false, null);
                    if (messageApp != null)
                    {   // Move the correct application properties (such as database table type)
                        Map<String, Object> properties = messageApp.getProperties();
                        m_properties = Utility.copyAppProperties(m_properties, properties);
                    }
                    if (m_properties.get(MessageConstants.QUEUE_NAME) == null)
                        m_properties.put(MessageConstants.QUEUE_NAME, message.getMessageHeader().getQueueName());
                    if (m_properties.get(MessageConstants.QUEUE_TYPE) == null)
                        m_properties.put(MessageConstants.QUEUE_TYPE, message.getMessageHeader().getQueueType());
                    m_properties.remove(DBParams.APPLICATION);
                    m_properties.remove(MessageApplication.AUTOSTART);
                    app.init(env, m_properties, null);
                    
                    // Don't listen any more (Since application will be listening)!
                    this.free();
                    boolean bMessageSent = false;
                    for (int i = 1; ; i++)
                    {
                        String strProcessClass = (String)((MapMessage)message).get(DBParams.PROCESS + Integer.toString(i));
                        if (strProcessClass == null)
                            break;  // End of initial processes
                        bMessageSent = true;
                        Map<String,Object> properties = new HashMap<String,Object>();
                        if (message instanceof MapMessage)  // Always
                        {
                            Map<String,Object> propMessage = (Map<String,Object>)message.getData();
                            if (propMessage != null)
                                properties.putAll(propMessage);
                        }
                        properties.remove(DBParams.APPLICATION);
                        properties.remove(MessageApplication.AUTOSTART);
                        properties.put(DBParams.PROCESS, strProcessClass);
                        BaseMessage messageInitial = new MapMessage(new BaseMessageHeader(message.getMessageHeader().getQueueName(), message.getMessageHeader().getQueueType(), this, null), properties);
                        env.getMessageManager(m_application, true).sendMessage(messageInitial);   // Resend it! (Don't consume it!)
                    }
                    if (!bMessageSent)
                        env.getMessageManager(m_application, true).sendMessage(message);   // Resend it! (Don't consume it!)
                }
            }
        }
        return DBConstants.NORMAL_RETURN;
    }
565843
public void enqueue(SerialMessage serialMessage) {
		this.sendQueue.add(serialMessage);
		logger.debug("Enqueueing message. Queue length = {}", this.sendQueue.size());
	}