Examples of PullPushAdapter


Examples of org.jgroups.blocks.PullPushAdapter

    public void start() throws Exception {

        channel=new JChannel();
        channel.connect("PullPushTest");
        adapter=new PullPushAdapter(channel);
        adapter.setListener(this);

        for(int i=0; i < 10; i++) {
            System.out.println("Sending msg #" + i);
            adapter.send(new Message(null, null, "Hello world".getBytes()));
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

      channel = new JChannel(props);
      channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
      channel.setOpt(Channel.AUTO_GETSTATE, 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) {
      e.printStackTrace();
      post(e.toString());
    }
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 start() throws Exception {
        int c;

        channel=new JChannel();
        channel.connect("PullPushTestMux");
        adapter=new PullPushAdapter(channel);
        adapter.setListener(this);

        listeners=new MyListener[10];
        for(int i=0; i < listeners.length; i++) {
            listeners[i]=new MyListener(i, adapter);
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

   

    void start() throws Throwable {
        ch=new JChannel(props);
        ch.connect("GroupRequestPull-Group");
        adapter=new PullPushAdapter(ch, this, this);
        loop();
        adapter.stop();
        ch.close();
    }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

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

        channel=createChannel("A");
        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

        String props="udp.xml";


        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

        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);

        // 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);

            // sleep one second before processing continues
            try {
                Thread.sleep(1000);
            }
View Full Code Here

Examples of org.jgroups.blocks.PullPushAdapter

        String props="udp.xml";

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

Examples of org.jgroups.blocks.PullPushAdapter

        // Important - discard messages from self
        channel.setOpt(Channel.LOCAL, Boolean.FALSE);
        channel.connect(externalSubject);

        if (receivesExternalEvents()) {
            adapter = new PullPushAdapter(channel, this);
        }
    }
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.