Examples of JChannel


Examples of org.jgroups.JChannel

         if(coord_gms != null)
             coord_gms.setLevel("warn");
     }
    
     public void testConnectThree() throws Exception {
         coordinator=new JChannel(props);
         setProps(coordinator);

         channel=new JChannel(props);
         setProps(channel);
        
         coordinator.connect(GROUP);
         channel.connect(GROUP);
        
         JChannel third = new JChannel (props);
         third.connect(GROUP);
        
         View view=channel.getView();
         assert channel.getView().size() == 3;
         assert third.getView().size() == 3;
         assert view.containsMember(channel.getAddress());
         assert view.containsMember(coordinator.getAddress());
        
         Util.close(third);
     }
View Full Code Here

Examples of org.jgroups.JChannel

     /**
      * Tests connect-disconnect-connect sequence for a group with two members
      * (using TUNNEL).
      **/
     public void testDisconnectConnectTwo_TUNNEL() throws Exception {
         coordinator=new JChannel(props);
         setProps(coordinator);
         coordinator.connect(GROUP);
         channel=new JChannel(props);
         setProps(channel);
         channel.connect("DisconnectTest.testgroup-1");
         channel.disconnect();
         channel.connect(GROUP);

View Full Code Here

Examples of org.jgroups.JChannel

      * DISCONNECT. Because of this problem, the channel couldn't be used to
      * multicast messages.
      **/
     public void testDisconnectConnectSendTwo_TUNNEL() throws Exception {
        final Promise<Message> msgPromise=new Promise<Message>();
        coordinator=new JChannel(props);
        setProps(coordinator);
        coordinator.connect(GROUP);
        coordinator.setReceiver(new PromisedMessageListener(msgPromise));

        channel=new JChannel(props);
        setProps(channel);
        channel.connect("DisconnectTest.testgroup-1");
        channel.disconnect();
        channel.connect(GROUP);

View Full Code Here

Examples of org.jgroups.JChannel

public class SetPropertyTest {
    JChannel ch;

    @BeforeClass
    void init() throws ChannelException {
        ch=new JChannel();
    }
View Full Code Here

Examples of org.jgroups.JChannel

        System.out.println("-- [" + Thread.currentThread().getName() + "] " + msg);
    }


    public void testConcurrentJoinsAndLeaves() throws Exception {
        JChannel first=null;
        channel_conf="udp.xml";
       
        for(int i=0; i < threads.length; i++) {
            JChannel ch=null;
            if(i == 0) {
                ch=createChannel(true, NUM);
                first=ch;
            }
            else
                ch=createChannel(first);
            ch.setName("C" + i);
            changeProperties(ch);
            threads[i]=new MyThread(ch, i+1, barrier);
            threads[i].start();
        }
View Full Code Here

Examples of org.jgroups.JChannel

    /**
     * Tests connect with two members but when both GR fail and restart
     *
     **/
    public void testConnectTwoChannelsBothGRDownReconnect() throws Exception {
        coordinator = new JChannel(props);
        channel = new JChannel(props);
        modifyChannel(channel,coordinator);
        coordinator.connect("testConnectTwoChannelsBothGRDownReconnect");
        channel.connect("testConnectTwoChannelsBothGRDownReconnect");
        Util.sleep(1000);
        gr1.stop();
View Full Code Here

Examples of org.jgroups.JChannel

        assert view.containsMember(coordinator.getLocalAddress());
        assert view.containsMember(channel.getLocalAddress());
    }

    public void testConnectThreeChannelsWithGRDown() throws Exception {
        JChannel third = null;
        coordinator = new JChannel(props);
        channel = new JChannel(props);
        modifyChannel(channel,coordinator);
        coordinator.connect("testConnectThreeChannelsWithGRDown");
        channel.connect("testConnectThreeChannelsWithGRDown");

        third = new JChannel(props);
        modifyChannel(third);
        third.connect("testConnectThreeChannelsWithGRDown");
        Util.sleep(1000);
        View view = channel.getView();
        assert channel.getView().size() == 3;
        assert third.getView().size() == 3;
        assert view.containsMember(channel.getLocalAddress());
        assert view.containsMember(coordinator.getLocalAddress());

        // kill router and recheck views
        gr2.stop();
        Util.sleep(1000);

        view = channel.getView();
        assert channel.getView().size() == 3;
        assert third.getView().size() == 3;
        assert third.getView().containsMember(channel.getLocalAddress());
        assert third.getView().containsMember(coordinator.getLocalAddress());

    }
View Full Code Here

Examples of org.jgroups.JChannel

    /**
     *
      **/
    public void testConnectSendMessage() throws Exception {
        final Promise<Message> msgPromise = new Promise<Message>();
        coordinator = new JChannel(props);
        modifyChannel(coordinator);
        coordinator.connect("testConnectSendMessage");
        coordinator.setReceiver(new PromisedMessageListener(msgPromise));

        channel = new JChannel(props);
        modifyChannel(channel);
        channel.connect("testConnectSendMessage");

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

View Full Code Here

Examples of org.jgroups.JChannel

    /**
      *
       **/
    public void testConnectSendMessageSecondGRDown() throws Exception {
        final Promise<Message> msgPromise = new Promise<Message>();
        coordinator = new JChannel(props);
        modifyChannel(coordinator);
        coordinator.connect("testConnectSendMessageSecondGRDown");
        coordinator.setReceiver(new PromisedMessageListener(msgPromise));

        channel = new JChannel(props);
        modifyChannel(channel);
        channel.connect("testConnectSendMessageSecondGRDown");

        Util.sleep(1000);
        gr2.stop();
View Full Code Here

Examples of org.jgroups.JChannel

    /**
     *
      **/
    public void testConnectSendMessageBothGRDown() throws Exception {
        final Promise<Message> msgPromise = new Promise<Message>();
        coordinator = new JChannel(props);
        modifyChannel(coordinator);
        coordinator.connect("testConnectSendMessageBothGRDown");
        coordinator.setReceiver(new PromisedMessageListener(msgPromise));

        channel = new JChannel(props);
        modifyChannel(channel);
        channel.connect("testConnectSendMessageBothGRDown");
        Util.sleep(1000);
        gr1.stop();
        gr2.stop();
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.