Package org.jgroups.fork

Examples of org.jgroups.fork.ForkChannel


        String stackName = this.protocols.isEmpty() ? this.channel.getClusterName() : id;
        ProtocolStackConfiguration forkStack = new ForkProtocolStackConfiguration(stackName, this.parentStack, this.protocols);
        List<Protocol> protocols = Configurator.createProtocols(JChannelFactory.createProtocols(forkStack, this.channel.getProtocolStack().getTransport().isMulticastCapable()), new ProtocolStack());

        return new ForkChannel(this.channel, stackName, id, protocols.toArray(new Protocol[protocols.size()]));
    }
View Full Code Here


      .build();
    this.manager = new DefaultCacheManager(gcb.build(), c);

    if(!local){
      JGroupsTransport transport = (JGroupsTransport) manager.getCache("first").getAdvancedCache().getRpcManager().getTransport();
      this.cacheChannel = new ForkChannel(transport.getChannel(), "drill-stack", "drill-hijacker", true, ProtocolStack.ABOVE, FRAG2.class, new COUNTER());
      this.counters = new CounterService(this.cacheChannel);
    }else{
      this.cacheChannel = null;
      this.counters = null;
    }
View Full Code Here

                boolean alreadyHasForkProtocol = mainChannel.getProtocolStack().findProtocol(FORK.class) != null;

                // add the fork at the top of the stack to preserve the default configuration
                // and use the name of the cluster as the stack id
                this.channel = new ForkChannel(mainChannel, forkStackId, FORK_CHANNEL_NAME, true, ProtocolStack.ABOVE,
                                               topProtocol.getClass(), new CENTRAL_LOCK());

                // always add central lock to the stack
                this.lockService = new LockService(this.channel);
View Full Code Here

    }



    public void testLifecycle() throws Exception {
        fc1=new ForkChannel(ch, "stack", "fc1");
        assert fc1.isOpen() && !fc1.isConnected() && !fc1.isClosed() : "state=" + fc1.getState();

        fc1.connect("bla");
        assert fc1.isOpen() && !fc1.isConnected() && !fc1.isClosed() : "state=" + fc1.getState();
View Full Code Here

        }
    }

    /** Tests the case where we don't add any fork-stack specific protocols */
    public void testNullForkStack() throws Exception {
        fc1=new ForkChannel(ch, "stack", "fc1");
        fc2=new ForkChannel(ch, "stack", "fc2");
        MyReceiver<Integer> r1=new MyReceiver<Integer>(), r2=new MyReceiver<Integer>();
        fc1.setReceiver(r1); fc2.setReceiver(r2);
        ch.connect(CLUSTER);
        fc1.connect("foo");
        fc2.connect("bar");
View Full Code Here

     * Tests CounterService on 2 different fork-channels, using the *same* fork-stack. This means the 2 counter
     * services will 'see' each other and the counters must have the same value
     * @throws Exception
     */
    public void testCounterService() throws Exception {
        fc1=new ForkChannel(ch, "stack", "fc1", false,ProtocolStack.ABOVE, FORK.class, new COUNTER());
        fc2=new ForkChannel(ch, "stack", "fc2", false,ProtocolStack.ABOVE, FORK.class, new COUNTER());
        ch.connect(CLUSTER);
        fc1.connect("foo");
        fc2.connect("bar");

        CounterService cs1=new CounterService(fc1), cs2=new CounterService(fc2);
View Full Code Here

TOP

Related Classes of org.jgroups.fork.ForkChannel

Copyright © 2018 www.massapicom. 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.