Package org.jgroups.protocols

Examples of org.jgroups.protocols.CENTRAL_LOCK


        System.out.println("[" + Thread.currentThread().getId() + "] signalled " + name);
    }

    protected void addLockingProtocol(JChannel ch) {
        ProtocolStack stack=ch.getProtocolStack();
        Protocol lockprot = new CENTRAL_LOCK();
        lockprot.setLevel("trace");
        stack.insertProtocolAtTop(lockprot);
    }
View Full Code Here


                ProtocolStack protocolStack = channel.getProtocolStack();
                Protocol centralLock = protocolStack.findProtocol(CENTRAL_LOCK.class);
                if (centralLock == null) {
                    // add the locking protocol
                    CENTRAL_LOCK lockingProtocol = new CENTRAL_LOCK();
                    // we have to call init because the channel has already been created
                    lockingProtocol.init();
                    protocolStack.addProtocol(lockingProtocol);
                }
                this.lockService = new LockService(this.channel);

                // Add a listener through which we'll know what's going on within the cluster ...
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);

                // Add a listener through which we'll know what's going on within the cluster ...
View Full Code Here

public class LockServiceConcurrencyTest extends BMNGRunner {
    protected JChannel    ch;
    protected LockService lock_service;

    @BeforeMethod protected void init() throws Exception {
        ch=new JChannel(Util.getTestStack(new CENTRAL_LOCK())).name("A");
        lock_service=new LockService(ch);
        ch.connect("LockServiceConcurrencyTest");
    }
View Full Code Here

    }



    protected JChannel createChannel(String name) throws Exception {
        Protocol[] stack=Util.getTestStack(new CENTRAL_LOCK().level("trace"));
        return new JChannel(stack).name(name);
    }
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.CENTRAL_LOCK

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.