Examples of acquireLock()


Examples of ariba.util.core.GlobalLockingService.acquireLock()

        }
        // get Global lock and check if safeToRecycle
        GlobalLockingService service = GlobalLocking.getService();
        GlobalLock lock = null;
        try {
            lock = service.acquireLock(globalLockName);
            if (lock == null) {
                // do nothing. We will try to recycle later.
                Log.shutdown.debug("Could not acquire global lock");
                return;
            }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveControlface.acquireLock()

            boolean lockButtonState = lockButton.isSelected();
            try {
                LocomotiveControlface locomotiveControl = AdHocRailway
                        .getInstance().getLocomotiveControl();
                if (lockButtonState) {
                    boolean succeeded = locomotiveControl
                            .acquireLock(myLocomotive);
                    lockButton.setSelected(succeeded);
                } else {
                    if (locomotiveControl.isLockedByMe(myLocomotive)) {
                        boolean succeeded = !locomotiveControl
View Full Code Here

Examples of net.greghaines.jesque.client.Client.acquireLock()

    @Test
    public void acquireLockSuccess() {
        LOG.info("Running acquireLockSuccess()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
    }

    @Test
View Full Code Here

Examples of net.greghaines.jesque.client.Client.acquireLock()

    @Test
    public void acquireLockSuccess() {
        LOG.info("Running acquireLockSuccess()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
    }

    @Test
    public void acquireLockFail() {
View Full Code Here

Examples of net.greghaines.jesque.client.Client.acquireLock()

    public void acquireLockSuccess() {
        LOG.info("Running acquireLockSuccess()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
    }

    @Test
    public void acquireLockFail() {
        LOG.info("Running acquireLockFail()...");
View Full Code Here

Examples of net.greghaines.jesque.client.Client.acquireLock()

    @Test
    public void acquireLockFail() {
        LOG.info("Running acquireLockFail()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "pete", 10000));
        Assert.assertFalse("Acquired lock that should have been in use.",
                client.acquireLock("systemLockA", "george", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "pete", 10000));
    }
View Full Code Here

Examples of net.greghaines.jesque.client.Client.acquireLock()

    public void acquireLockFail() {
        LOG.info("Running acquireLockFail()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "pete", 10000));
        Assert.assertFalse("Acquired lock that should have been in use.",
                client.acquireLock("systemLockA", "george", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "pete", 10000));
    }

    @Test
    public void unpermittedJob() {
View Full Code Here

Examples of net.greghaines.jesque.client.Client.acquireLock()

        LOG.info("Running acquireLockFail()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "pete", 10000));
        Assert.assertFalse("Acquired lock that should have been in use.",
                client.acquireLock("systemLockA", "george", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "pete", 10000));
    }

    @Test
    public void unpermittedJob() {
        final Job job = new Job("TestAction", new Object[] { 1, 2.3, true, "test", Arrays.asList("inner", 4.5) });
View Full Code Here

Examples of net.greghaines.jesque.client.ClientImpl.acquireLock()

    @Test
    public void acquireLockSuccess() {
        LOG.info("Running acquireLockSuccess()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
    }

    @Test
View Full Code Here

Examples of net.greghaines.jesque.client.ClientImpl.acquireLock()

    @Test
    public void acquireLockSuccess() {
        LOG.info("Running acquireLockSuccess()...");
        final Client client = new ClientImpl(CONFIG);
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
        Assert.assertTrue("Failed to acquire the expected lock.", client.acquireLock("systemLockA", "me", 10));
    }

    @Test
    public void acquireLockFail() {
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.