Examples of JChannel


Examples of org.jgroups.JChannel



    @BeforeMethod
    void setUp() throws Exception {
        JChannel mock_channel=new JChannel() {};
        stack=new ProtocolStack(mock_channel);
    }
View Full Code Here

Examples of org.jgroups.JChannel

        final Lock lock=new ReentrantLock();
        final Condition cond=lock.newCondition();
        AtomicBoolean done=new AtomicBoolean(false);

        System.out.println("-- starting first channel");
        c1=new JChannel(PROPS);
        changeMergeInterval(c1);
        c1.setReceiver(new MyReceiver("c1", done, lock, cond));
        c1.connect("demo");

        System.out.println("-- starting second channel");
        c2=new JChannel(PROPS);
        changeMergeInterval(c2);
        c2.setReceiver(new MyReceiver("c2", done, lock, cond));
        c2.connect("demo");

        System.out.println("-- starting GossipRouter");
View Full Code Here

Examples of org.jgroups.JChannel

            hash_function=hash_function_factory.create();
        }
        if(hash_function == null)
            hash_function=new ConsistentHashFunction<K>();

        ch=new JChannel(props);
        disp=new RpcDispatcher(ch, null, this, this);
        RpcDispatcher.Marshaller marshaller=new CustomMarshaller();
        disp.setRequestMarshaller(marshaller);
        disp.setResponseMarshaller(marshaller);
        disp.setMethodLookup(new MethodLookup() {
View Full Code Here

Examples of org.jgroups.JChannel

                  "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" +
                  "shun=false;print_local_addr=true)");
     
    String props = System.getProperty("JGroupsProps", strbuf.toString());

    channel = new JChannel(props);
    channel.connect(channelName);
   
    new PullPushAdapter(channel, this, this);
    myAddr = channel.getLocalAddress();
  }
View Full Code Here

Examples of org.jgroups.JChannel

    /**
     * Tests if the channel has a null local address after disconnect (using TUNNEL).
     **/
    public void testNullLocalAddress_TUNNEL() throws Exception {
        channel = new JChannel(props);
        setProps(channel);
        channel.connect(GROUP);
        assert channel.getAddress() != null;
        channel.disconnect();
        assert channel.getAddress() == null;
View Full Code Here

Examples of org.jgroups.JChannel

    /**
     * Tests connect-disconnect-connect sequence for a group with one member
     * (using default configuration).
     **/
    public void testDisconnectConnectOne_Default() throws Exception {
        channel=new JChannel(props);
        setProps(channel);
        channel.connect("DisconnectTest.testgroup-1");
        channel.disconnect();
        channel.connect("DisconnectTest.testgroup-2");
        View view=channel.getView();
View Full Code Here

Examples of org.jgroups.JChannel

    /**
     * Tests connect-disconnect-connect sequence for a group with two members
     * (using default configuration).
     **/
    public void testDisconnectConnectTwo_Default() throws Exception {
        coordinator=new JChannel(props);
        setProps(coordinator);

        channel=new JChannel(props);
        setProps(channel);
       
        coordinator.connect(GROUP);
        channel.connect("DisconnectTest.testgroup-1");
        channel.disconnect();
View Full Code Here

Examples of org.jgroups.JChannel

     * after DISCONNECT. Because of this problem, the channel couldn't be used
     * to multicast messages.
     **/
    public void testDisconnectConnectSendTwo_Default() 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

    /**
      * Tests connect-disconnect-connect sequence for a group with one member
      * (using TUNNEL).
      **/
     public void testDisconnectConnectOne_TUNNEL() throws Exception {
        channel=new JChannel(props);
        setProps(channel);
        channel.connect("DisconnectTest.testgroup-1");
        channel.disconnect();
        channel.connect("DisconnectTest.testgroup-2");
        View view=channel.getView();
View Full Code Here

Examples of org.jgroups.JChannel

        assert view.size() == 1;
        assert view.containsMember(channel.getAddress());
    }
    
     public void testFailureDetection() throws Exception {
         coordinator=new JChannel(props);
         coordinator.setName("coord");
         setProps(coordinator);
         coordinator.connect(GROUP);
        
         channel=new JChannel(props);
         channel.setName("participant");
         setProps(channel);      
         channel.connect(GROUP);

         System.out.println("shutting down the participant channel");
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.