Examples of Message


Examples of net.schmizz.sshj.common.Message

        writeLock.lock();
        try {

            if (kexer.isKexOngoing()) {
                // Only transport layer packets (1 to 49) allowed except SERVICE_REQUEST
                final Message m = Message.fromByte(payload.array()[payload.rpos()]);
                if (!m.in(1, 49) || m == Message.SERVICE_REQUEST) {
                    assert m != Message.KEXINIT;
                    kexer.waitForDone();
                }
            } else if (encoder.getSequenceNumber() == 0) // We get here every 2**32th packet
                kexer.startKex(true);
View Full Code Here

Examples of net.sf.gilead.sample.domain.Message

      user.setPassword("secret");
      user.setFirstName("Test");
      user.setLastName("user");
       
      // create welcome messages
      Message message1 = new Message();
      message1.setMessage("First message");
      message1.setDate(new Date());
      user.addMessage(message1);
     
      // create welcome messages
      Message message2 = new Message();
      message2.setMessage("Another message");
      message2.setDate(new Date());
      user.addMessage(message2);
       
      // save user (message are cascaded)
      saveUser(user);
    }
View Full Code Here

Examples of net.sf.pmr.messageBoards.domain.Message

        super.tearDown();
    }

    public final void testFindByIdWithMessageFound() throws Exception {

        Message message = (Message) messageMapper.findById(1);

        // to test Date
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy hh:mm");
        Date date = dateFormat.parse("01/01/2001 13:24");

        assertEquals("id", 1, message.getId());
        assertEquals(
                "content",
                "les cl�s de bagnole est vraiement un excellent film malgr�s une ou deux longueurs. Il est unique !",
                message.getContent());
        assertEquals("topic title", "les cl�s de bagnole", message.getTopic()
                .getTitle());
        assertTrue("postedBy", message.getPostedBy() instanceof User);
        assertEquals("postedDate", date, message.getPostedDate());
        assertEquals("version", 1, message.getPersistanceVersion());

    }
View Full Code Here

Examples of net.sf.saxon.instruct.Message

        select = typeCheck("select", select);
        terminate = typeCheck("terminate", terminate);
    }

    public Expression compile(Executable exec) throws TransformerConfigurationException {
        Message inst = new Message(select, terminate);
        compileChildren(exec, inst, true);
        ExpressionTool.makeParentReferences(inst);
        return inst;
    }
View Full Code Here

Examples of net.sf.xbus.protocol.Message

    DeletedMessageStore dms = DeletedMessageStore.getInstance();
    dms.setMessage(request);
    dms.setSystem(source);

    mReturncode = Constants.RC_NOK;
    Message call = null;
    try
    {
      try
      {
        // Zero: check handling of empty messages
        if (!checkRequest(source, request))
        {
          /*
           * Request shall not be processed but ignored
           */
          call = new SimpleTextMessage(source);
          try
          {
            ((TextMessage) call).setRequestText(request.toString(),
                source);
          }
          catch (XException e)
          {
            // This problem has already been traced
          }
          call.setReturncode(Constants.RC_OK);
        }
        else
        {
          /*
           * Request shall be processed
           */

          // First: create the message obejct
          call = MessageFactory.createApplicationMessage(source);

          // Second: initialise the message object by pasting in the
          // request
          // as content,
          // then perfom the call the appropriate application object
          // and record the response
          if (Constants.TYPE_TEXT.equals(messageType))
          {
            ((TextMessage) call).setRequestText((String) request,
                source);
            ApplicationFactory.callApplication(call);
            // Get the response.
            // The message is already transformed and structure
            // information
            // for serialising is attached to the source system.
            mResponse = ((TextMessage) call).getResponseText();
          }
          else if (Constants.TYPE_OBJECT.equals(messageType))
          {
            ((ObjectMessage) call)
                .setRequestObject(request, source);
            ApplicationFactory.callApplication(call);
            // Get the response.
            // The message is already transformed and structure
            // information
            // for serialising is attached to the source system.
            mResponse = ((ObjectMessage) call).getResponseObject();
          }
        }
      }
      catch (Exception t)
      {
        /*
         * Inner try-catch block catches all exceptions and converts
         * them to XExceptions if necessary
         */
        if (t instanceof XException)
        {
          throw (XException) t;
        }
        else
        {
          throw new XException(Constants.LOCATION_INTERN,
              Constants.LAYER_APPLICATION,
              Constants.PACKAGE_APPLICATION_ADAPTER, "0", t);
        }
      }
    }
    catch (XException e)
    {
      /*
       * Outer try-catch block handles the XException
       */
      if (call == null)
      {
        if (request == null)
        {
          request = "<null>";
        }
        call = new SimpleTextMessage(source);
        try
        {
          ((TextMessage) call).setRequestText(request.toString(),
              source);
        }
        catch (XException e1)
        {
          // This problem has already been traced
        }
      }
      call.setReturncode(Constants.RC_NOK);
      if ((call.getErrortext() == null)
          || (call.getErrortext().length() == 0))
      {
        call.setErrortext(e.getMessage());
      }
    }
    finally
    {
      mReturncode = call.getReturncode();
      mErrormessage = call.getErrortext();

      try
      {
        // Logging of the receiving-activity into the journal and
        // closing the
        // connection to the database.
        call.setResponseTimestamp(new Date());
        Journal journal = new Journal();
        journal.log('R', source, call);
        journal.commit();
      } // try
      catch (Exception t)
View Full Code Here

Examples of net.solosky.maplefetion.bean.Message

     
      //查找消息是哪个好友发送的
        FetionStore store = this.context.getFetionStore();
      Buddy from   = store.getBuddyByUri(notify.getFrom());
      String body  = notify.getBody()!=null?notify.getBody().toSendString():""//防止产生NULL错误
      Message msg  = this.parseMessage(notify);
     
      //如果好友没有找到,可能是陌生人发送的信息,
      if(from==null) {
        //这里新建一个好友对象,并设置关系为陌生人
        from = UriHelper.createBuddy(notify.getFrom());
View Full Code Here

Examples of net.tomp2p.message.Message

            fr = smmSender.get(recv1.peerAddress(), getBuilder, cc);
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            System.err.println(fr.failedReason());
            Message m = fr.responseMessage();
            Map<Number640, Data> stored = m.dataMap(0).dataMap();
            compare(dataMap.convertToMap640(), stored);
            System.err.println("done!");
        } finally {
            if (cc != null) {
                cc.shutdown().awaitListenersUninterruptibly();
View Full Code Here

Examples of net.windwards.dnsfrontend.dialog.Message

    @Override
    public Record decode(byte[] data, Configuration configuration)
            throws ProtocolCodingException {
        String str = new String(data);

        Message message;
        Update update;
        Name qualified;
        InetAddress address;
        try {
            message = this.mapper.readValue(str, Message.class);
View Full Code Here

Examples of net.yura.lobby.model.Message

       if (writeThread==null) {
            writeThread = new Thread() {
                public void run() {
                    try {
                        while ( !Thread.interrupted() ) {
                            Message message;
                            synchronized (sendQueue) {
                                while (sendQueue.isEmpty()) {
                                    sendQueue.wait();
                                }
                                message = (Message)sendQueue.remove(0);
                            }

                            try {
//                                int size = access.computeAnonymousObjectSize(message);
//                                ByteArrayOutputStream bytes = new ByteArrayOutputStream(size);
//                                access.save(bytes, message);
//                                client.sendToNetwork(bytes.toByteArray());

                                TcpClient cl = client;
                                if (cl!=null) {
                                    int size = access.computeAnonymousObjectSize(message);
                                    ByteArrayOutputStream bytes = new ByteArrayOutputStream(size+4);
                                    new DataOutputStream(bytes).writeInt(size);
                                    access.save(bytes, message);
                                    cl.send( ByteBuffer.wrap( bytes.toByteArray() ) );
                                }
                            }
                            catch (InterruptedException in) {
                                throw in; // do not want to catch this
                            }
                            catch (Exception ex) {
                                Level level = (ex instanceof IOException && "not connected".equals(ex.getMessage())) ||
                                          (ex instanceof SocketException && "Broken pipe".equals(ex.getMessage())) ||
                                          (ex instanceof SocketException && "sendto failed: EPIPE (Broken pipe)".equals(ex.getMessage()))
                                        ?Level.INFO:Level.WARNING;
                                logger.log(level,"could not send "+message,ex);
                            }
                        }
                    }
                    catch (InterruptedException ex) { }
                }
            };
            writeThread.start();
       }
      
       System.out.println("sending message "+command+" "+param);
      
       Message message = new Message();
       message.setCommand(command);
       message.setParam(param);

       if (wait!=0) {
            message.setWait(new Integer(wait));
       }
      
       synchronized (sendQueue) {
            sendQueue.add(message);
            sendQueue.notify();
View Full Code Here

Examples of network.Message

            if (args[0].equalsIgnoreCase("bye")) {
              appConsole.log("Thread:Main - Terminating session");
              loopFlag=false;
            } else if (args[0].equalsIgnoreCase("add")) {
 
              Message theMessage = new Message();
              theMessage.setCommand("add");
              theMessage.setFileId(args[1]);
              theMessage.setFileContents(new File(args[1]));
              theMessage.setSenderHostName(myAddress);
              ourPeers.transmitEventToPeers(theMessage, appConsole);
              System.out.println("Add Request Sent to other nodes");
            }
            else if (args[0].equalsIgnoreCase("get")) {
             
              Message theMessage = new Message();
              theMessage.setCommand("get");
              theMessage.setFileId(args[1]);
              theMessage.setSenderHostName(myAddress);
              ourPeers.transmitEventToPeers(theMessage, appConsole);
              System.out.println("Get Request Sent to other nodes");
            }
       
       
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.