An AMP-formatted message was received.  Dispatch to the appropriate
        command responder, i.e. a method on this object exposed with
        L{commandMethod.expose}.

        @see IMessageReceiver.messageReceived
357776
def messageReceived(self, value, sender, target):
        
        if value.type != AMP_MESSAGE_TYPE:
            raise UnknownMessageType()
        inputBox = self._boxFromData(value.data)
        thunk = commandMethod.responderForName(self, inputBox[COMMAND])
        placeholder = _ProtocolPlaceholder(sender, target)
        arguments = thunk.command.parseArguments(inputBox, placeholder)
        try:
            result = thunk(**arguments)
        except tuple(thunk.command.errors.keys()), knownError:
            errorCode = thunk.command.errors[knownError.__class__]
            raise RevertAndRespond(
                Value(AMP_ANSWER_TYPE,
                         Box(_error_code=errorCode,
                             _error_description=str(knownError)).serialize()))
        else:
            response = thunk.command.makeResponse(result, None)
            return Value(AMP_ANSWER_TYPE, response.serialize())
493298
@Override
    public void onReceive(Object message) throws Exception {
        try {
            if (message instanceof OperationWorkerMsgType) {
                switch ((OperationWorkerMsgType) message) {

                case PROCESS_REQUEST:
                    processMainRequest();
                    break;
                case POLL_PROGRESS:
                    pollProgress();
                    break;
                case OPERATION_TIMEOUT:
                    operationTimeout();
                    break;
                case CANCEL:
                    // use the same function
                    cancel();
                    break;
                }// end switch
            } else if (message instanceof ResponseOnSingeRequest) {
                final ResponseOnSingeRequest myResponse = (ResponseOnSingeRequest) message;
                handleHttpWorkerResponse(myResponse);
            } else {
                unhandled(message);
                throw new ActorMessageTypeInvalidException(
                        "invalid message type to OperationWorker");
            }
        } catch (Exception e) {
            replyErrors(e.toString(), PcStringUtils.printStackTrace(e),
                    PcConstants.NA, PcConstants.NA_INT);
        }
    }
275330
@Override
    public void messageReceived(NextFilter nextFilter, S session,
            AmqpSecureMessage message) throws Exception {
        nextFilter.messageReceived(session, message); 
    }
392838
public void onMessageReceived(RemoteMessage remoteMessage) {

		if (LoggerUtils.isEnabled()) {
			StringBuilder builder = new StringBuilder();
			builder.append("Message received. ");
			builder.append("from: ");
			builder.append(remoteMessage.getFrom());

			if (remoteMessage.getMessageType() != null) {
				builder.append(", ");
				builder.append("message type: ");
				builder.append(remoteMessage.getMessageType());
			}

			if (remoteMessage.getData() != null & !remoteMessage.getData().isEmpty()) {
				builder.append(", ");
				builder.append("data: ");
				builder.append(remoteMessage.getData());
			}
			LOGGER.info(builder.toString());
		}

		FcmMessageResolver fcmResolver = AbstractFcmAppModule.get().getFcmMessageResolver();
		if (fcmResolver != null) {
			FcmMessage fcmMessage = null;
			try {
				fcmMessage = fcmResolver.resolve(remoteMessage);
			} catch (Exception e) {
				AbstractApplication.get().getExceptionHandler().logHandledException("Error when resolving FCM message", e);
				return;
			}

			if (fcmMessage != null) {
				try {
					fcmMessage.handle(remoteMessage);
				} catch (Exception e) {
					AbstractApplication.get().getExceptionHandler().logHandledException("Error when handling FCM message", e);
				}
			} else {
				LOGGER.warn("The FCM message was not resolved");
			}
		} else {
			LOGGER.warn("A FCM message was received, but not resolved is configured");
		}

		for (FcmEventsListener fcmEventsListener : FcmContext.getFcmEventsListeners()) {
			try {
				fcmEventsListener.onMessageReceived(remoteMessage);
			} catch (Exception e) {
				AbstractApplication.get().getExceptionHandler().logHandledException(e);
			}
		}
	}
1043866
def message_received(self, message):
        """"""
        # If the message identifer is outstanding, then someone is
        # waiting for the respone so we save it here
        identifier = message.identifier or 'type_' + str(message.type)
        if identifier in self._outstanding:
            outstanding = OutstandingMessage(
                self._outstanding[identifier].semaphore, message)
            self._outstanding[identifier] = outstanding
            self._outstanding[identifier].semaphore.release()
        else:
            asyncio.ensure_future(self._dispatch(message), loop=self.loop)
833538
@Override
	public final void messageReceived(final IoSession session, final Object message)
			throws Exception {
		final String str = message.toString();
		
		// Parse the command
		String cmd = null;
		final String[] args = str.trim().split("[\t ]");
		if (args.length>0) {
			cmd = args[0];
		}
		
		
		List<String> lstArg = new ArrayList<String>();
		if (args.length>0) {
			boolean isArg=false;
			int index=0;
			for (String val : args) {
				if (val.equals("-a")) {
					lstArg.add(val);
					index++;
					isArg=true;
				} else {
					if (val.length()>0) {
						if (isArg && val.charAt(0)!='-' && val.indexOf('=')==-1) {
							lstArg.set(index-1, lstArg.get(index-1)+" "+val);
						} else {
							lstArg.add(val);
							index++;
						}
					} else {
						lstArg.set(index-1, lstArg.get(index-1)+" ");
					}
				}
			}
		}
		
		// Try to launch the command
		final TcpCommand command = TcpIpCommands.getCommands().get(cmd);
		String result = null;
		
		// launch the command and get the result
		if (command != null) {
			if (args.length>1) {
				try {
				String[] finalArgs = new String[lstArg.size()];
				for (int i=0; i< finalArgs.length; i++) {
					String[] argSplit=lstArg.get(i).split("=");
					if (argSplit.length==2 && argSplit[1].charAt(0)=='"' && argSplit[1].charAt(argSplit[1].length()-1)=='"' ) {
						finalArgs[i]=argSplit[0]+"="+argSplit[1].substring(1, argSplit[1].length()-1);
					} else {
						finalArgs[i]=lstArg.get(i);
					}
				}
				result = command.process(session, Arrays.copyOfRange(finalArgs, 1, finalArgs.length));
				} catch (Exception e) {
					result = LaunchingMessageKind.ELAUNCH0007.format(cmd, e);
				}
			} else {
				result = command.process(session, new String[]{});
			}
		} else {
			session.write("command unknown :"+cmd);
		}
		// If the command returned a result, write it for the user
		if (result != null) {
			session.write(result);
		} else {
			session.write("");
		}
		session.write(ENDLINE);
		session.write(ENDLINE);
		session.write("> ");
	}
598280
public void processGcmMessage(String channel, String action, String message) {
    if (channel == null || !containsDefaultPushCallback(channel)) {
      channel = AVOSCloud.getApplicationId();
      if (action != null) {
        sendBroadcast(channel, message, action);
      } else {
        sendNotification(channel, message);
      }
    }
  }
298179
public void messageReceived (MessageEvent event)
    {
        if (_msghandlers != null) {
            MessageHandler handler = _msghandlers.get(event.getName());
            if (handler != null) {
                handler.handleEvent(event, this);
            }
        }

        // If the message is directed at us, see if it's a request for a method invocation
        if (event.isPrivate()) { // aka if (event instanceof ServerMessageEvent)
            // the first argument should be the client object of the caller or null if it is
            // a server-originated event
            int srcoid = event.getSourceOid();
            DObject source = (srcoid <= 0) ? null : _omgr.getObject(srcoid);
            String method = event.getName();
            Object[] args = event.getArgs(), nargs;

            // validate that this call is allowed
            if (!allowManagerCall(method)) {
                log.warning("Client tried to invoke forbidden manager call!",
                    "source", source, "method", method, "args", args);
                return;
            }

            if (args == null) {
                nargs = new Object[] { source };
            } else {
                nargs = new Object[args.length+1];
                nargs[0] = source;
                System.arraycopy(args, 0, nargs, 1, args.length);
            }

            // Lazily create our dispatcher now that it's actually getting a message
            if (_dispatcher == null) {
                Class<?> clazz = getClass();
                MethodFinder finder = _dispatcherFinders.get(clazz);
                if (finder == null) {
                    finder = new MethodFinder(clazz);
                    _dispatcherFinders.put(clazz, finder);
                }
                _dispatcher = new DynamicListener<DSet.Entry>(this, finder);
            }
            _dispatcher.dispatchMethod(method, nargs);
        }
    }
692278
def receive_message(self, msg):
        
        if isinstance(msg, Resolution):
            return
        paxos = self.paxos_instance
        while msg:
            if isinstance(msg, Resolution):
                self.print_if_verbose("{} resolved value {}".format(self.network_uid, msg.value))
                break
            else:
                self.print_if_verbose("{} <- {} <- {}".format(self.network_uid, msg.__class__.__name__, msg.from_uid))
                msg = paxos.receive(msg)
                # Todo: Make it optional not to announce resolution (without which it's hard to see final value).
                do_announce_resolution = True
                if msg and (do_announce_resolution or not isinstance(msg, Resolution)):
                    self.announce(msg)

        self.setattrs_from_paxos(paxos)
701129
void onReceive(int register, byte[] message) {
        I2CEvent evt = new I2CEvent(this, register, message);
        I2CListener listener = callbacks.remove(register);
        if (listener == null) {
            for (I2CListener subscriber : subscribers) {
                subscriber.onReceive(evt);
            }
        } else {
            listener.onReceive(evt);
        }
    }
1218324
def on_receive(self, message=None, wire=None, event_origin=None):

        

        self.trigger("before_call", message)

        fn_name = message.data
        pmsg = self.prepare_message

        try:
            for handler in self.handlers:
                handler.incoming(message, self)

            fn = self.get_function(fn_name, message.path)
        except Exception as inst:
            wire.respond(message, ErrorMessage(str(inst)))
            return

        if callable(fn) and getattr(fn, "exposed", False):
            try:
                r = fn(*message.args, **message.kwargs)
                if isinstance(r,Message):
                    wire.respond(message, pmsg(r))
                else:
                    wire.respond(message, pmsg(Message(r)))
            except Exception as inst:
                if self.debug:
                    wire.respond(message, pmsg(ErrorMessage(str(traceback.format_exc()))))
                else:
                    wire.respond(message, pmsg(ErrorMessage(str(inst))))
        else:
            wire.respond(
                message,
                pmsg(
                    ErrorMessage("action '%s' not exposed on API (%s)" % (fn_name, self.__class__.__name__)))
                )

        self.trigger("after_call", message)
1159336
@Override
  public final void onMessageReceived(final Session session, final Object msg) {
    Command command = (Command) msg;
    if (this.statisticsHandler.isStatistics()) {
      if (command.getCopiedMergeCount() > 0 && command instanceof MapReturnValueAware) {
        Map<String, CachedData> returnValues = ((MapReturnValueAware) command).getReturnValues();
        int size = returnValues.size();
        this.statisticsHandler.statistics(CommandType.GET_HIT, size);
        this.statisticsHandler.statistics(CommandType.GET_MISS,
            command.getCopiedMergeCount() - size);
      } else if (command instanceof TextGetOneCommand || command instanceof BinaryGetCommand) {
        if (command.getResult() != null) {
          this.statisticsHandler.statistics(CommandType.GET_HIT);
        } else {
          this.statisticsHandler.statistics(CommandType.GET_MISS);
        }
      } else {
        if (command.getCopiedMergeCount() > 0) {
          this.statisticsHandler.statistics(command.getCommandType(),
              command.getCopiedMergeCount());
        } else
          this.statisticsHandler.statistics(command.getCommandType());
      }
    }
  }
1284867
@Override
    public void messageReceived(IoSession session, Object message)
            throws Exception {
        chain.execute(null, session, message);
    }
977992
def hear(message, params={})
      raise ArgumentError, "`message` must respond to :channel" unless message.respond_to?(:channel)
      raise ArgumentError, "`message` must respond to :sender" unless message.respond_to?(:sender)

      listeners.hear(message).each do |match|
        event = Houston::Conversations::Event.new(match)

        if block_given?
          yield event, match.listener
        else
          match.listener.call_async event
        end

        # Invoke only one listener per message
        return true
      end

      false
    end
946692
private void handleApplicationCommandRequest(SerialMessage incomingMessage) {
		logger.trace("Handle Message Application Command Request");
		int nodeId = incomingMessage.getMessagePayloadByte(1);
		logger.debug("Application Command Request from Node " + nodeId);
		ZWaveNode node = getNode(nodeId);
		
		if (node == null) {
			logger.warn("Node {} not initialized yet, ignoring message.", nodeId);
			return;
		}
		
		node.resetResendCount();
		
		int commandClassCode = incomingMessage.getMessagePayloadByte(3);
		ZWaveCommandClass.CommandClass commandClass = ZWaveCommandClass.CommandClass.getCommandClass(commandClassCode);

		if (commandClass == null) {
			logger.error(String.format("Unsupported command class 0x%02x", commandClassCode));
			return;
		}
		
		logger.debug(String.format("Incoming command class %s (0x%02x)", commandClass.getLabel(), commandClass.getKey()));
		ZWaveCommandClass zwaveCommandClass =  node.getCommandClass(commandClass);
		
		// We got an unsupported command class, return.
		if (zwaveCommandClass == null) {
			logger.error(String.format("Unsupported command class %s (0x%02x)", commandClass.getLabel(), commandClassCode));
			return;
		}
		
		logger.trace("Found Command Class {}, passing to handleApplicationCommandRequest", zwaveCommandClass.getCommandClass().getLabel());
		zwaveCommandClass.handleApplicationCommandRequest(incomingMessage, 4, 1);

		if (incomingMessage.getMessageClass() == this.lastSentMessage.getExpectedReply() && nodeId == this.lastSentMessage.getMessageNode() && !incomingMessage.isTransActionCanceled()) {
				notifyEventListeners(new ZWaveEvent(ZWaveEventType.TRANSACTION_COMPLETED_EVENT, this.lastSentMessage.getMessageNode(), 1, this.lastSentMessage));
				transactionCompleted.release();
				logger.trace("Released. Transaction completed permit count -> {}", transactionCompleted.availablePermits());
		}
	}
535998
protected void handshakeReceived(IoSession session,
			HandshakeMessage handshakeMessage) {
		log.debug("Received {}", handshakeMessage);
		this.receivedHandshake = handshakeMessage;
		Boolean handshakeCheck = this.checkHandshake();
		if (handshakeCheck == null) {
			return;
		}

		if (Boolean.FALSE.equals(handshakeCheck)) {
			log.warn("Handshakes did not match.");
			this._disconnect();
		}
		if (Boolean.TRUE.equals(handshakeCheck)) {
			SubscriptionMessage msg = this.generateGenericSubscriptionMessage();
			this.session.write(msg);
			this.connected = true;
		}
	}
31201
public WebSocketContext messageReceived(String receivedMessage) {
        this.stringMessage = S.string(receivedMessage).trim();
        isJson = stringMessage.startsWith("{") || stringMessage.startsWith("]");
        tryParseQueryParams();
        return this;
    }