Package org.jgroups

Examples of org.jgroups.Channel.connect()


            Channel c=createChannel(true);
            try {
                Map<String,Object> m=new HashMap<String,Object>();
                m.put("additional_data", new byte[] { 'b', 'e', 'l', 'a' });
                c.down(new Event(Event.CONFIG, m));
                c.connect("AddDataTest.testadditionalData()");
                UUID addr=(UUID)c.getAddress();
                System.out.println("address is " + addr);
                assert addr.getAdditionalData() != null;
                assert addr.getAdditionalData()[0] == 'b';
            }
View Full Code Here


   
    if(name != null) {
      channel.setName(name);
    }
   
    channel.connect("LargeStateChannel");
   
    while(true){
     
      Msg msg = new Msg(10000);
      channel.send(null, msg);
View Full Code Here

        factory.setMultiplexerConfig(props);

        final Channel ch1, ch2;
        ch1=factory.createMultiplexerChannel(stack_name, "id-1");
        Draw draw1=new Draw(ch1);
        ch1.connect("bela");

        ch2=factory.createMultiplexerChannel(stack_name, "id-2");
        Draw draw2=new Draw(ch2);
        ch2.connect("ban");
View Full Code Here

   public void testBasicStateSync() throws Exception {

      Channel channel = new JChannel(CHANNEL_PROPS);
      channel.setOpt(Channel.LOCAL, Boolean.FALSE);

      channel.connect(GROUP_NAME);

      Thread.sleep(1000);

      boolean join = false;
      join = channel.getState(null, 100000l);
View Full Code Here

    Channel channel = this.dispatcher.getChannel();
   
    channel.setDiscardOwnMessages(true);
   
    // Connect and fetch state
    channel.connect(this.id, null, 0);
  }

  /**
   * {@inheritDoc}
   * @see net.sf.hajdbc.Lifecycle#stop()
View Full Code Here

    public void testCreationAndClose() throws Exception {
        System.out.println("-- creating channel1 --");
        Channel c = null;
        c = createChannel();
        c.connect("CloseTest1");
        assertTrue("channel open", c.isOpen());
        assertTrue("channel connected", c.isConnected());       
        c.close();       
        assertFalse("channel not connected", c.isConnected());
        c.close();
View Full Code Here

        super.setUp();
        System.out.println("#### Setup Test " + testCount);

        Channel c1=createChannel("A");
        this.map1=new DistributedHashtable(c1, false, 5000);
        c1.connect("demo");
        this.map1.start(5000);

        Channel c2=createChannel("A");
        this.map2=new DistributedHashtable(c2, false, 5000);
        c2.connect("demo");
View Full Code Here

        c1.connect("demo");
        this.map1.start(5000);

        Channel c2=createChannel("A");
        this.map2=new DistributedHashtable(c2, false, 5000);
        c2.connect("demo");
        this.map2.start(5000);
    }

    protected void tearDown() throws Exception {
        this.map1.stop();
View Full Code Here

     * Tests connect-disconnect-connect sequence for a group with two members
     **/
    public void testDisconnectConnectTwo() throws Exception {
        View     view;
        Channel coordinator=createChannel("A");
        coordinator.connect("testgroup");
        view=coordinator.getView();
        System.out.println("-- view for coordinator: " + view);

        channel=createChannel("A");
        channel.connect("testgroup1");
View Full Code Here

   public void testBasicStateSync() throws Exception {

      Channel channel = new JChannel(CHANNEL_PROPS);
      channel.setOpt(Channel.LOCAL, Boolean.FALSE);

      channel.connect(GROUP_NAME);

      Thread.sleep(1000);

      boolean join = false;
      join = channel.getState(null, 100000l);
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.