Examples of addMessageListener()


Examples of org.asmatron.messengine.engines.DefaultMessagingDelegate.addMessageListener()

        lock.release();
      }
    };
    final String type = "foo";
    Message<String> message = new TestMessage<String>(type, expectedBody);
    engine.addMessageListener(type, listener);
    final int totalMessages = 1000;
    for (int i = 0; i < totalMessages; i++) {
      engine.send(message);
    }
    lock.tryAcquire(totalMessages, 3, TimeUnit.SECONDS);
View Full Code Here

Examples of org.asmatron.messengine.engines.DefaultMessagingDelegate.addMessageListener()

      }
    };
    final String type = "foo";
    final String expectedBody = "HELLO WORLD!";
    Message<String> message = new TestMessage<String>(type, expectedBody);
    engine.addMessageListener(type, listenerA);
    engine.addMessageListener(type, listenerB);
    final int totalMessages = 1000;
    for (int i = 0; i < totalMessages; i++) {
      engine.send(message);
    }
View Full Code Here

Examples of org.asmatron.messengine.engines.DefaultMessagingDelegate.addMessageListener()

    };
    final String type = "foo";
    final String expectedBody = "HELLO WORLD!";
    Message<String> message = new TestMessage<String>(type, expectedBody);
    engine.addMessageListener(type, listenerA);
    engine.addMessageListener(type, listenerB);
    final int totalMessages = 1000;
    for (int i = 0; i < totalMessages; i++) {
      engine.send(message);
    }
    lock.tryAcquire(totalMessages * 2, 3, TimeUnit.SECONDS);
View Full Code Here

Examples of org.asmatron.messengine.engines.DefaultMessagingDelegate.addMessageListener()

      public void onMessage(Message<String> message) {
        counter.incrementAndGet();
      }
    };
    String type = "foo";
    engine.addMessageListener(type, listener);
    engine.send(new TestMessage<String>(type, "body"));
    Thread.sleep(100);
    engine.removeMessageListener(type, listener);
    engine.send(new TestMessage<String>(type, "body"));
    Thread.sleep(100);
View Full Code Here

Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer.addMessageListener()

    }
    this.container = container;
    IChatRoomContainer chatRoomContainer = (IChatRoomContainer) container
        .getAdapter(IChatRoomContainer.class);
    chatMessageSender = chatRoomContainer.getPrivateMessageSender();
    chatRoomContainer.addMessageListener(new IIMMessageListener() {
      public void handleMessageEvent(IIMMessageEvent e) {
        if (e instanceof IChatMessageEvent) {
          IChatMessageEvent event = (IChatMessageEvent) e;
          String msg = event.getChatMessage().getBody();
          switch (msg.charAt(0)) {
View Full Code Here

Examples of org.eclipse.ecf.presence.im.IChatManager.addMessageListener()

    final IChatManager icm = adapter.getChatManager();
    icms = icm.getChatMessageSender();
    itms = icm.getTypingMessageSender();

    icm.addMessageListener(new IIMMessageListener() {
      public void handleMessageEvent(IIMMessageEvent e) {
        if (e instanceof IChatMessageEvent) {
          displayMessage((IChatMessageEvent) e);
        } else if (e instanceof ITypingMessageEvent) {
          displayTypingNotification((ITypingMessageEvent) e);
View Full Code Here

Examples of org.jivesoftware.smack.Chat.addMessageListener()

        addLoggingListeners("LASTGUY", consumerCon);
        lastguyCon.login("consumer", "consumer");
        final ConsumerMessageListener listener2 = new ConsumerMessageListener();
        lastguyCon.getChatManager().addChatListener(new ChatManagerListener() {
            public void chatCreated(Chat chat, boolean createdLocally) {
                chat.addMessageListener(listener2);
            }
        });

        for (int i = 0; i < 10; i++) {
            System.out.println("Sending message: " + i);
View Full Code Here

Examples of org.jivesoftware.smack.Chat.addMessageListener()

        addLoggingListeners("LASTGUY", consumerCon);
        lastguyCon.login("consumer", "consumer");
        final ConsumerMessageListener listener2 = new ConsumerMessageListener();
        lastguyCon.getChatManager().addChatListener(new ChatManagerListener() {
            public void chatCreated(Chat chat, boolean createdLocally) {
                chat.addMessageListener(listener2);
            }
        });

        for (int i = 0; i < 10; i++) {
            System.out.println("Sending message: " + i);
View Full Code Here

Examples of org.jivesoftware.smack.Chat.addMessageListener()

        addLoggingListeners("LASTGUY", consumerCon);
        lastguyCon.login("consumer", "consumer");
        final ConsumerMessageListener listener2 = new ConsumerMessageListener();
        lastguyCon.getChatManager().addChatListener(new ChatManagerListener() {
            public void chatCreated(Chat chat, boolean createdLocally) {
                chat.addMessageListener(listener2);
            }
        });

        for (int i = 0; i < 10; i++) {
            LOG.info("Sending message: " + i);
View Full Code Here

Examples of org.jivesoftware.smack.Chat.addMessageListener()

            // just add a listener to that chat
            Chat privateChat = connection.getChatManager().getThreadChat(endpoint.getParticipant());

            if (privateChat != null) {
                LOG.debug("Adding listener to existing chat opened to " + privateChat.getParticipant());
                privateChat.addMessageListener(this);
            } else {               
                privateChat = connection.getChatManager().createChat(endpoint.getParticipant(), endpoint.getParticipant(), this);
                LOG.debug("Opening private chat to " + privateChat.getParticipant());
            }
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.