Examples of JChannel


Examples of com.dotcms.repackage.org.jgroups.JChannel

      if(channel!=null) {
          channel.disconnect();
      }
     
      channel = new JChannel(classLoader.getResource(cacheFile));
      channel.setReceiver(this);
     
      channel.connect(Config.getStringProperty("CACHE_JGROUPS_GROUP_NAME","dotCMSCluster"));
      channel.setOpt(JChannel.LOCAL, false);
      useJgroups = true;
View Full Code Here

Examples of org.javagroups.JChannel

        {
            // make configurable
            String props="UDP(mcast_addr=" + lca.getUdpMulticastAddr() + ";mcast_port=" + lca.getUdpMulticastPort()+ "):PING:MERGE2(min_interval=5000;max_interval=10000):FD:STABLE:NAKACK:UNICAST:" +
             "FRAG:FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE";

            javagroups = new JChannel(props);
            javagroups.setOpt(javagroups.LOCAL, Boolean.FALSE);
            // could have a channel per region
            //javagroups.connect(IJGConstants.DEFAULT_JG_GROUP_NAME);
            javagroups.connect(groupName);
View Full Code Here

Examples of org.jgroups.JChannel

    private ReplicatedHashMap<String,String> map2;
    private ConcurrentHashMap<String,String> wrap=new ConcurrentHashMap<String,String>();

    @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);
        c2.connect("ReplicatedHashMapTest");
        this.map2.start(5000);
    }
View Full Code Here

Examples of org.jgroups.JChannel

     * be controlled with mainTimeout. If this time passes and the test
     * doesn't see all the messages, it declares itself failed.
     */
    @Test
    public void testStress() throws Exception {
        channel=new JChannel("tunnel.xml");
        channel.connect("agroup");
        channel.setReceiver(new ReceiverAdapter() {

            @Override
            public void receive(Message msg) {
View Full Code Here

Examples of org.jgroups.JChannel

            t.init();
        }       
    }

    public void testSimpleConnect() throws Exception {
        channel = new JChannel(props);
        modifyChannel(channel);
        channel.connect("testSimpleConnect");
        assert channel.getLocalAddress() != null;
        assert channel.getView().size() == 1;
        channel.disconnect();
View Full Code Here

Examples of org.jgroups.JChannel

    /**
     * Tests connect with two members
     *
     **/
    public void testConnectTwoChannels() throws Exception {
        coordinator = new JChannel(props);
        channel = new JChannel(props);
        modifyChannel(channel,coordinator);
        coordinator.connect("testConnectTwoChannels");
        channel.connect("testConnectTwoChannels");
        View view = channel.getView();
        assert view.size() == 2;
View Full Code Here

Examples of org.jgroups.JChannel

        }
       
    }
   
    public void start() throws Exception {
        ch=new JChannel(props);
        if(name != null)
            ch.setName(name);
        execution_service=new ExecutionService(ch);
        runner=new ExecutionRunner(ch);
        ch.connect("executing-cluster");
View Full Code Here

Examples of org.jgroups.JChannel



    private void setUp(String props) {
        try {
            channel=new JChannel(props);
            channel.connect("test1");
        }
        catch(Throwable t) {
            t.printStackTrace(System.err);
            assert false : "channel could not be created";
View Full Code Here

Examples of org.jgroups.JChannel

    private void _testWithProps(boolean mcast, String cluster_name) throws Exception {
        Map<String,Object> m=new HashMap<String,Object>();
        m.put("additional_data", new byte[] { 'b', 'e', 'l', 'a' });
        byte[] buf=new byte[1000];
        JChannel ch1=null, ch2=null;

        try {
            ch1=createChannel(true, 2);
            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 {
                Address dest=ch2.getAddress();
                ch1.send(new Message(dest, null, buf));
            }

            Util.sleep(500); // msgs are sent asynchronously, give ch2 some time to receive them
            List<Message> list=receiver.getMsgs();
            assert !list.isEmpty();
            Message msg=list.get(0);
            UUID src=(UUID)msg.getSrc();
            assert src != null;
            assert src.getAdditionalData() != null;
            assert src.getAdditionalData().length == 4;
        }
        finally {
            if(ch2 != null) ch2.close();
            if(ch1 != null) ch1.close();
        }
    }
View Full Code Here

Examples of org.jgroups.JChannel

    @ManagedOperation
    public void start() throws Exception {
        hash_function=new ConsistentHashFunction<K>();
        addMembershipListener((MembershipListener)hash_function);
        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
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.