Examples of PullPushAdapter


Examples of org.jgroups.blocks.PullPushAdapter

    String props = System.getProperty("JGroupsProps", strbuf.toString());

    channel = new JChannel(props);
    channel.connect(channelName);
   
    new PullPushAdapter(channel, this, this);
    myAddr = channel.getLocalAddress();
  }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

        {
            try
            {
                channel = new JChannel(null);
                channel.connect("FKacheOS");
                new PullPushAdapter(channel, this, this);
            }
            catch (ChannelException e)
            {
                throw new IllegalStateException(e.getMessage());
            }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

            channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
            channel.setOpt(Channel.AUTO_GETSTATE, Boolean.TRUE);
            channel.setOpt(Channel.BLOCK, Boolean.TRUE);
            System.out.println("Connecting to " + group_name);
            channel.connect(group_name);
            ad=new PullPushAdapter(channel, this, this);
            channel.getState(null, 5000);
        }
        catch(Exception e) {
            ta.append(e.toString());
        }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

            m.put("additional_data", "bela".getBytes());
            channel.down(new Event(Event.CONFIG, m));
        }

        channel.connect("ViewDemo");
        new PullPushAdapter(channel, this);

        while(true) {
            Util.sleep(10000);
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

                "shun=false;print_local_addr=true)";


        channel=new JChannel(props);
        channel.connect(channel_name);
        new PullPushAdapter(channel, this);
        my_addr=channel.getLocalAddress();
        if(my_addr != null)
            setTitle(my_addr.toString());
        pack();
        show();
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

    public void start() throws Exception {
        try {
            ch=new JChannel(props);
            ch.connect("PerfTest-Group");
            adapter=new PullPushAdapter(ch, this, this);
            mainLoop();
        }
        finally {
            if(ch != null)
                ch.close();
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

     **/
    public void testDisconnectConnectSendTwo() throws Exception {
        final Promise msgPromise=new Promise();
        JChannel coordinator=new JChannel(props);
        coordinator.connect("testgroup");
        PullPushAdapter ppa=
                new PullPushAdapter(coordinator,
                                    new PromisedMessageListener(msgPromise));
        ppa.start();

        channel=new JChannel(props);
        channel.connect("testgroup1");
        channel.disconnect();
        channel.connect("testgroup");
        channel.send(new Message(null, null, "payload"));
        Message msg=(Message)msgPromise.getResult(20000);
        assertTrue(msg != null);
        assertEquals("payload", msg.getObject());
        ppa.stop();
        coordinator.close();
        channel.close();
        System.out.println("Remaining threads are:");
        Util.printThreads();
    }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

        channel1=new JChannel(properties);
        System.out.print("Connecting to channel...");
        channel1.connect(groupName);
        System.out.println("channel1 connected, view is " + channel1.getView());

        adapter1=new PullPushAdapter(channel1);

        if(USE_DEBUGGER) {
            debugger1=new Debugger(channel1, CUMMULATIVE, "channel 1");
            debugger1.start();
        }

        // sleep one second before second member joins
        try {
            Thread.sleep(1000);
        }
        catch(InterruptedException ex) {
        }

            channel2=new JChannel(properties);
            channel2.connect(groupName);
            System.out.println("channel2 connected, view is " + channel2.getView());

            adapter2=new PullPushAdapter(channel2);

            if(USE_DEBUGGER) {
                debugger2=new Debugger(channel2, CUMMULATIVE, "channel 2");
                debugger2.start();
            }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

    public void testDisconnectConnectSendTwo_Default() throws Exception {

        final Promise msgPromise=new Promise();
        JChannel coordinator=new JChannel();
        coordinator.connect("testgroup");
        PullPushAdapter ppa= new PullPushAdapter(coordinator,
                                                 new PromisedMessageListener(msgPromise));
        ppa.start();

        channel=new JChannel();
        channel.connect("testgroup1");
        channel.disconnect();
        channel.connect("testgroup");

        channel.send(new Message(null, null, "payload"));

        Message msg=(Message)msgPromise.getResult(20000);
        assertTrue(msg != null);
        assertEquals("payload", msg.getObject());

        ppa.stop();
        coordinator.close();
    }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

            String props=getTUNNELProps(routerPort, routerPort);

            final Promise msgPromise=new Promise();
            JChannel coordinator=new JChannel(props);
            coordinator.connect("testgroup");
            PullPushAdapter ppa=
                    new PullPushAdapter(coordinator,
                                        new PromisedMessageListener(msgPromise));
            ppa.start();

            channel=new JChannel(props);
            channel.connect("testgroup1");
            channel.disconnect();
            channel.connect("testgroup");

            channel.send(new Message(null, null, "payload"));

            Message msg=(Message)msgPromise.getResult(20000);
            assertTrue(msg != null);
            assertEquals("payload", msg.getObject());

            ppa.stop();
            coordinator.close();
        }
        finally {
            Utilities.stopGossipRouter();
        }
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.