Examples of LockService


Examples of org.jgroups.blocks.locking.LockService

    public void start() throws Exception {
        ch=new JChannel(props);
        if(name != null)
            ch.setName(name);
        lock_service=new LockService(ch);
        lock_service.addLockListener(this);
        ch.connect("lock-cluster");
        JmxConfigurator.registerChannel(ch, Util.getMBeanServer(), "lock-service", ch.getClusterName(), true);

        try {
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

        setNodeProperty(JGROUPS_ADDRESS, getMyAddress());

        initRefIdCounter();

        if (!hasServer())
            this.lockService = new LockService(channel);

        this.dataChannel = new JChannelAdapter(channel) {

            @Override
            public void send(Message msg) throws Exception {
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

        setNodeProperty(JGROUPS_ADDRESS, getMyAddress());

        initRefIdCounter();

        if (!hasServer())
            this.lockService = new LockService(channel);

        this.dataChannel = new JChannelAdapter(channel) {

            @Override
            public void send(Message msg) throws Exception {
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

                    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 ...
                this.channel.addChannelListener(listener);

                // Set the receiver through which we'll receive all of the changes ...
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

                // 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 ...
                this.channel.addChannelListener(listener);

                // Set the receiver through which we'll receive all of the changes ...
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

        setNodeProperty(JGROUPS_ADDRESS, getMyAddress());

        initRefIdCounter();

        if (!hasServer())
            this.lockService = new LockService(channel);

        this.dataChannel = new JChannelAdapter(channel) {

            @Override
            public void send(Message msg) throws Exception {
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

        setNodeProperty(JGROUPS_ADDRESS, getMyAddress());

        initRefIdCounter();

        if (!hasServer())
            this.lockService = new LockService(channel);

        this.dataChannel = new JChannelAdapter(channel) {

            @Override
            public void send(Message msg) throws Exception {
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

    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

Examples of org.jgroups.blocks.locking.LockService


    @BeforeClass
    protected void init() throws Exception {
        c1=createChannel("A");
        s1=new LockService(c1);
        c1.connect("LockServiceTest");

        c2=createChannel("B");
        s2=new LockService(c2);
        c2.connect("LockServiceTest");

        c3=createChannel("C");
        s3=new LockService(c3);
        c3.connect("LockServiceTest");

        Util.waitUntilAllChannelsHaveSameSize(10000, 1000, c1,c2,c3);
        lock=s1.getLock(LOCK);
    }
View Full Code Here

Examples of org.jgroups.blocks.locking.LockService

  void setUp() throws Exception {
    System.out.print("Connecting channels: ");
        a=createChannel("A");
        disp_a=new MessageDispatcher(a, null, null);
        a.connect(RpcLockingTest.class.getSimpleName());
        lock_a=new LockService(a).getLock("lock");

        b=createChannel("B");
        disp_b=new MessageDispatcher(b, null, null);
        b.connect(RpcLockingTest.class.getSimpleName());
        lock_b=new LockService(b).getLock("lock");

    Util.waitUntilAllChannelsHaveSameSize(30000, 1000, a, b);
    System.out.println("");

        disp_a.setRequestHandler(new RequestHandler() {
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.