Package org.jgroups

Examples of org.jgroups.JChannel.connect()


      Properties p = newGC.getTransportProperties();
      String jgroupsCfg = p.getProperty(JGroupsTransport.CONFIGURATION_STRING);
      try {
         JChannel channel = new JChannel(jgroupsCfg);
         channel.setName(newGC.getTransportNodeName());
         channel.connect(newGC.getClusterName());
         return channel;
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here


    @BeforeClass
    protected void setUp() throws Exception {
        JChannel c1=createChannel(true, 2);
        this.map1=new ReplicatedHashMap<String,String>(c1);
        map1.setBlockingUpdates(true);
        c1.connect("ReplicatedHashMapTest");
        this.map1.start(5000);

        JChannel c2=createChannel(c1);
        this.map2=new ReplicatedHashMap<String,String>(wrap, c2);
        map2.setBlockingUpdates(true);
View Full Code Here

        this.map1.start(5000);

        JChannel c2=createChannel(c1);
        this.map2=new ReplicatedHashMap<String,String>(wrap, c2);
        map2.setBlockingUpdates(true);
        c2.connect("ReplicatedHashMapTest");
        this.map2.start(5000);
    }

    @AfterMethod
    protected void clean() {
View Full Code Here

            public void receive(Message msg) {
                System.out.println("<< " + msg.getObject() + " [" + msg.getSrc() + "]");
            }
        });

        ch.connect("ChatCluster");


        for(;;) {
            String line=Util.readStringFromStdin(": ");
            ch.send(null, line);
View Full Code Here

            coordinator=createTcpgossipChannel("A");
            channel=createTcpgossipChannel("B");
            coordinator.connect(GROUP);
            channel.connect(GROUP);
            third=createTcpgossipChannel("C");
            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());
View Full Code Here

            gossipRouter.stop();
           

            // cannot discover others since GR is down
            third=createTcpgossipChannel("C");
            third.connect("testConnectThreeChannelsWithGRDown");

            // restart and....
            gossipRouter.start();
            Util.waitUntilAllChannelsHaveSameSize(60000, 1000, coordinator, channel, third);
View Full Code Here

            // cannot discover others since GR is down
            coordinator.connect("testConnectThreeChannelsWithGRAlreadyDown");         
            channel.connect("testConnectThreeChannelsWithGRAlreadyDown");

            third=createTcpgossipChannel("C");
            third.connect("testConnectThreeChannelsWithGRAlreadyDown");

            // restart and....
            gossipRouter.start();
            Util.waitUntilAllChannelsHaveSameSize(60000, 1000, coordinator, channel, third);
View Full Code Here

        // channel2.getProtocolStack().addProtocol(new CENTRAL_EXECUTOR());
        channels.add(channel1);
        channels.add(channel2);

        channel1.connect("test-cluster");
        channel2.connect("test-cluster");
        Util.waitUntilAllChannelsHaveSameSize(20000, 1000, channel1, channel2);

        final ExecutionService executionService=new ExecutionService(channel1);
        ExecutionRunner executionRunner1=new ExecutionRunner(channel1);
        ExecutionRunner executionRunner2=new ExecutionRunner(channel2);
View Full Code Here

            d2.setChannel(e);
            d1.setServerObject(new ServerObject(1));
            d2.setServerObject(new ServerObject(2));
            d1.start();
            d2.start();
            d.connect("RpcDispatcherTest-DifferentGroup");
            e.connect("RpcDispatcherTest-DifferentGroup");

            Util.sleep(500);

            View view=e.getView();
View Full Code Here

            JChannel c=first_channel == null? createChannel(true,NUM) : createChannel(first_channel);
            if(first_channel == null){
                first_channel=c;
            }
            targets[i]=new RpcDispatcherAnycastServerObject(c);
            c.connect(GROUP);
        }
    }

    @AfterMethod
    protected void tearDown() throws Exception {
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.