Package jetbrains.communicator.core.dispatcher

Examples of jetbrains.communicator.core.dispatcher.Message


    assertEquals(1, myDispatcher.getPendingMessages(myUser).length);
  }

  public void testPersistency() throws Exception {
    Message failedMessage = new P2PNetworkMessage("foo", "foo2", new String[]{"test"});
    myDispatcher.performDispatch(myUser, failedMessage);
    myDispatcher.save();

    AbstractMessageDispatcher dispatcher = createDispatcher();
    assertEquals("queue should persist", 1, dispatcher.getPendingMessages(myUser).length);

    Message message = dispatcher.getPendingMessages(myUser)[0];
    assertTrue("queue should persist", message instanceof P2PNetworkMessage);
    assertEquals("test", ((P2PNetworkMessage) message).getParameters()[0]);

    dispatcher.dispose();
  }
View Full Code Here


    return getAddress(user).getHostAddress() + ':' + getPort(user);
  }

  @Override
  public void sendXmlMessage(User user, XmlMessage message) {
    Message msg = SendXmlMessageP2PCommand.createNetworkMessage(message);
    if (message.needsResponse()) {
      myAsyncMessageDispatcher.sendNow(user, msg);
    }
    else {
      myAsyncMessageDispatcher.sendLater(user, msg);
View Full Code Here

TOP

Related Classes of jetbrains.communicator.core.dispatcher.Message

Copyright © 2018 www.massapicom. 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.