Examples of Message


Examples of programming5.net.Message

    /**
     *@return the message string the represents the serialization of the primitive fields of the given object
     */
    public String serialize(T obj) throws NotSerializableException {
        String ret = null;
        Message aux = new Message();
        aux.setHeader(classRef.getName());
        Field[] myFields = classRef.getDeclaredFields();
        try {
            for (Field field : myFields) {
                if (!field.getType().isArray()) {
                    Object value = field.get(this);
                    if (value != null) {
                        aux.addMessageItem(field.getName());
                        aux.addMessageItem(value.toString());
                    }
                }
                else {
                    Object[] array = (Object[]) field.get(this);
                    for (Object item : array) {
                        aux.addMessageItem(field.getName());
                        aux.addMessageItem(item.toString());
                    }
                }
            }
        }
        catch (IllegalAccessException iae) {
            throw new NotSerializableException("SimpleSerializer: Some fields were not accessible: " + iae.getMessage());
        }
        try {
            ret = aux.getMessage();
        }
        catch (MalformedMessageException mme) {
            mme.printStackTrace();
        }
        return ret;
View Full Code Here

Examples of quickfix.Message

    private static final String CHECKSUM        = "67890";
    private static final String TX_DATE         = new Date().toString();
    private static final String SESSION_ID      = "FIX.4.1:BANZAI->SYNAPSE";

    public void testSimpleFIXMessage() throws Exception {
        Message message = new NewOrderSingle();
        message.getHeader().setField(new BeginString(BEGIN_STRING));
        message.getHeader().setField(new SenderCompID(SENDER_ID));
        message.getHeader().setField(new TargetCompID(TARGET_ID));
        message.getHeader().setField(new MsgSeqNum(SEQ_NUM));

        message.setField(new Symbol(SYMBOL));
        message.setField(new ClOrdID(CLORD_ID));
        message.setField(new TradeOriginationDate(TX_DATE));

        message.getTrailer().setField(new CheckSum(CHECKSUM));

        MessageContext msgCtx = new MessageContext();
        FIXUtils.getInstance().setSOAPEnvelope(message, SEQ_NUM, SESSION_ID, msgCtx);
        String result = msgCtx.getEnvelope().getBody().getFirstElement().toString();
        String expected =
View Full Code Here

Examples of realityshard.container.network.Message

           
            // failcheck
            if (filter == null) { buf.resetReaderIndex(); return; }
           
            // try create the message
            Message message;
            try
            {
                message = messageClazz.newInstance();
            }
            catch (InstantiationException | IllegalAccessException ex)
            {
                LOGGER.error("Could not create an instance of an message.", ex);
               
                buf.resetReaderIndex();
                return;
            }
           
            // dont forget to initialize the message
            message.init(ctx.channel());
           
            // try serialize the message
            if (!filter.deserialize(buf, message))
            {
                buf.resetReaderIndex();
                return;
            }
           
            // finally add the message
            result.add(message);
           
            LOGGER.debug("Got: {}", message.toString());
        }
    }
View Full Code Here

Examples of rinde.sim.core.model.communication.Message

  private void sendMsgs(long currentTime) {
    if (lastCommunication + COMMUNICATION_PERIOD < currentTime) {
      lastCommunication = currentTime;
      if (cm != null) {
        cm.broadcast(new Message(this) {});
      }
    }
  }
View Full Code Here

Examples of rocks.xmpp.core.stanza.model.client.Message

                messageReceived[0] = true;
                receivedId[0] = e.getMessageId();
            }
        });

        Message message = new Message(JULIET);
        message.setId("123");
        xmppSession1.send(message);

        Assert.assertTrue(messageReceived[0]);
        Assert.assertEquals(receivedId[0], "123");
    }
View Full Code Here

Examples of scap.check.Message

  /**
   * @return the action
   */
  public RuleResult getRuleResult() {
    UncheckedRuleResult retval = new UncheckedRuleResult(rule, result);
    retval.appendMessage(new Message(severity, getLocalizedMessage()));
    return retval;
  }
View Full Code Here

Examples of scotlandyard.shared.messaging.Message

          System.out.println("Eu n�o tenho nome!");
        }
        else{
          //System.out.println("O jogador �: "+myName);
        }
          Message msg = myGame.getMessage(me);
         
          try{
            Thread.sleep(1000);
          }catch(Exception e){
         
View Full Code Here

Examples of seph.lang.ast.Message

        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void plus_plus_parses_correctly_combined_with_assignment() {
        Message m = parse("foo x = a++");
        Message expected = msg("foo", msg("=", PersistentList.create(Arrays.asList(msg("x"), msg("++", PersistentList.create(Arrays.asList(msg("a"))))))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

Examples of server.common.Message

     * @param pl_name
     * @param pl_pwd
     * @return the player UUID
     */
    public synchronized Message newAccount(String pl_name, String pl_pwd) {
        Message response = null;
        try {
            // Try to create a new player acount
            response = game.newAccount(pl_name, pl_pwd);
            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
View Full Code Here

Examples of server.protocol.Message

        PlayerList refPlayers = (PlayerList)inObj;
        client.getJoinedList().refreshPlayerList(refPlayers);
        client.getCurrentFrame().updateGUIForeign();
      }
      if(inObj.getClass().getSimpleName().equals("Message")){
        Message inboundMsg = (Message)inObj;
        processMessageInput(inboundMsg);
      }
      //client.getConnection().sendRcvdConfirmation(inObj);    //TEMPORARILY DISABLED
      break;
    case GAME_IN_PROGRESS:
      if(inObj.getClass().getSimpleName().equals("Dice")){
        Dice refreshedDice = (Dice)inObj;
        client.getDice().refershDice(refreshedDice);
        client.getCurrentFrame().updateGUIForeign();
        //System.out.println("Hetket�ringute (" + client.getDice().getDiceValues() + ") omanik: " + client.getDice().getCurOwner());
      }
      if(inObj.getClass().getSimpleName().equals("GameSheet")){
        GameSheet refGameSheet = (GameSheet)inObj;
        client.getGameSheet().refreshGameSheet(refGameSheet);
        client.getCurrentFrame().updateGUIForeign();
      }
      if(inObj.getClass().getSimpleName().equals("Leaderboard")){
        Leaderboard refLeaderboard = (Leaderboard)inObj;
        client.getLeaderboard().refreshLeaderboard(refLeaderboard);
        client.getCurrentFrame().updateGUIForeign();
      }
      if(inObj.getClass().getSimpleName().equals("Message")){
        Message inboundMsg = (Message)inObj;
        processMessageInput(inboundMsg);
      }
      //client.getConnection().sendRcvdConfirmation(inObj);    //TEMPORARILY DISABLED
      break;
    default:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.