Package org.cometd.bayeux.client

Examples of org.cometd.bayeux.client.ClientSessionChannel.publish()


        publishLatch.reset(1);
        Map<String, Object> logout = new HashMap<>();
        logout.put("user", "user1");
        ClientSessionChannel logoutChannel1A = client1A.getChannel("/service/logout");
        logoutChannel1A.addListener(publishLatch);
        logoutChannel1A.publish(logout);
        Assert.assertTrue(publishLatch.await(5, TimeUnit.SECONDS));

        // Send again the message from client3, now only client1B and client1C must get it
        counter.set(0);
        messageLatch.reset(2);
View Full Code Here


        Map<String, Object> login1 = new HashMap<>();
        String userId = "user1";
        login1.put("user", userId);
        ClientSessionChannel loginChannel1 = client1.getChannel("/service/login");
        loginChannel1.addListener(publishLatch);
        loginChannel1.publish(login1);
        Assert.assertTrue(publishLatch.await(5, TimeUnit.SECONDS));

        Assert.assertTrue(presenceOnLatch.await(5, TimeUnit.SECONDS));

        Assert.assertTrue(seti1.isAssociated(userId));
View Full Code Here

        publishLatch.reset(1);
        Map<String, Object> logout1 = new HashMap<>();
        logout1.put("user", userId);
        ClientSessionChannel logoutChannel1 = client1.getChannel("/service/logout");
        logoutChannel1.addListener(publishLatch);
        logoutChannel1.publish(logout1);
        Assert.assertTrue(publishLatch.await(5, TimeUnit.SECONDS));

        Assert.assertTrue(presenceOffLatch.await(5, TimeUnit.SECONDS));

        Assert.assertFalse(seti1.isAssociated(userId));
View Full Code Here

        Map<String, Object> login1 = new HashMap<>();
        String userId = "user1";
        login1.put("user", userId);
        ClientSessionChannel loginChannel1 = client1.getChannel("/service/login");
        final CountDownLatch publishLatch = new CountDownLatch(1);
        loginChannel1.publish(login1, new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                publishLatch.countDown();
            }
View Full Code Here

        final CountDownLatch loginLatch1 = new CountDownLatch(1);
        Map<String, Object> login1 = new HashMap<>();
        String userId1 = "user1";
        login1.put("user", userId1);
        ClientSessionChannel loginChannel1 = client1.getChannel("/service/login");
        loginChannel1.publish(login1, new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                loginLatch1.countDown();
            }
View Full Code Here

        final CountDownLatch loginLatch2 = new CountDownLatch(1);
        Map<String, Object> login2 = new HashMap<>();
        String userId2 = "user2";
        login2.put("user", userId2);
        ClientSessionChannel loginChannel2 = client2.getChannel("/service/login");
        loginChannel2.publish(login2, new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                loginLatch2.countDown();
            }
View Full Code Here

        // Logout user2
        final CountDownLatch logoutLatch2 = new CountDownLatch(1);
        Map<String, Object> logout2 = new HashMap<>();
        logout2.put("user", userId2);
        ClientSessionChannel logoutChannel2 = client2.getChannel("/service/logout");
        logoutChannel2.publish(logout2, new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                logoutLatch2.countDown();
            }
View Full Code Here

        // Logout user1
        final CountDownLatch logoutLatch1 = new CountDownLatch(1);
        Map<String, Object> logout1 = new HashMap<>();
        logout1.put("user", userId1);
        ClientSessionChannel logoutChannel1 = client1.getChannel("/service/logout");
        logoutChannel1.publish(logout1, new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                logoutLatch1.countDown();
            }
View Full Code Here

        final CountDownLatch loginLatch1 = new CountDownLatch(1);
        Map<String, Object> login1 = new HashMap<>();
        String userId1 = "user1";
        login1.put("user", userId1);
        ClientSessionChannel loginChannel1 = client1.getChannel("/service/login");
        loginChannel1.publish(login1, new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                loginLatch1.countDown();
            }
View Full Code Here

        final CountDownLatch loginLatch2 = new CountDownLatch(1);
        Map<String, Object> login2 = new HashMap<>();
        String userId2 = "user2";
        login2.put("user", userId2);
        ClientSessionChannel loginChannel2 = client2.getChannel("/service/login");
        loginChannel2.publish(login2, new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
            {
                loginLatch2.countDown();
            }
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.