Package org.jgroups

Examples of org.jgroups.JChannel.connect()


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

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


        this.map1.start(5000);

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

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

            ch1.down(new Event(Event.CONFIG, m));
            ch2=createChannel(ch1); // same props as ch1 above
            ch2.down(new Event(Event.CONFIG, m));
            MyReceiver receiver=new MyReceiver();
            ch2.setReceiver(receiver);
            ch1.connect(cluster_name);
            ch2.connect(cluster_name);

            if(mcast)
                ch1.send(new Message(null, null, buf));
            else {
View Full Code Here

        
         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());
View Full Code Here

        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());
View Full Code Here

            coordinator = new JChannel(props);
            channel = new JChannel(props);
            coordinator.connect(GROUP);
            channel.connect(GROUP);
            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());
View Full Code Here

            gossipRouter.stop();
           

            // cannot discover others since GR is down
            third = new JChannel(props);
            third.connect("testConnectThreeChannelsWithGRDown");
          

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

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

            third = new JChannel(props);
            third.connect("testConnectThreeChannelsWithGRAlreadyDown");

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

    try {
      JChannel channel = new JChannel(jgroupsProps);
      channel.setName(name);
      channel.setReceiver(reciever);
      channel.setDiscardOwnMessages(true);
      channel.connect(cluster);
     
      MBeanServer server = Util.getMBeanServer();
          if(server == null){
            throw new Exception("No MBeanServers found;" + "\nTankWar needs to be run with an MBeanServer present");
          }
View Full Code Here

      public void viewAccepted(View view) {
        System.out.println("view: " + view);
      }});
   
    channel.connect("ChatCluster");
   
    System.out.println(channel.getView().getCreator().equals(channel.getView().getMembers().get(0)));
   
    for (;;) {
      String line = Util.readStringFromStdin(": ");
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.