Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.ExecutionLockProvider.newInstance()


        conf.put(BasicLockProvider.KEY_DIRECTORY, lockDir.getAbsolutePath());

        ServiceProfile<ExecutionLockProvider> profile = new ServiceProfile<ExecutionLockProvider>(
                "testing", BasicLockProvider.class, conf, ProfileContext.system(getClass().getClassLoader()));
        ExecutionLockProvider instance = profile.newInstance();
        ExecutionLock lock = instance.newInstance("batch");
        try {
            lock.beginFlow("flow", "exec");
            assertThat(lockDir.list().length, is(greaterThan(start)));
        } finally {
            lock.close();
View Full Code Here


        conf.put(BasicLockProvider.KEY_DIRECTORY, "${LOCATION}");

        ServiceProfile<ExecutionLockProvider> profile = new ServiceProfile<ExecutionLockProvider>(
                "testing", BasicLockProvider.class, conf, new ProfileContext(getClass().getClassLoader(), var));
        ExecutionLockProvider instance = profile.newInstance();
        ExecutionLock lock = instance.newInstance("batch");
        try {
            lock.beginFlow("flow", "exec");
            assertThat(lockDir.list().length, is(greaterThan(start)));
        } finally {
            lock.close();
View Full Code Here

        ExecutionLockProvider instance2 = profile.newInstance();

        ExecutionLock lock = instance1.newInstance("batch1");
        try {
            try {
                instance2.newInstance("batch1");
                fail("cannot run same batch");
            } catch (IOException e) {
                // ok.
            }
            try {
View Full Code Here

                fail("cannot run same batch");
            } catch (IOException e) {
                // ok.
            }
            try {
                instance2.newInstance("batch2");
                fail("cannot run any batch");
            } catch (IOException e) {
                // ok.
            }
            // can acquire any flow/exec lock in same
View Full Code Here

        ExecutionLock lock = instance1.newInstance("batch1");
        try {
            lock.beginFlow("flow1", "exec1");
            try {
                instance2.newInstance("batch1");
                fail("cannot run same batch");
            } catch (IOException e) {
                // ok.
            }
            ExecutionLock other = instance2.newInstance("batch2");
View Full Code Here

                instance2.newInstance("batch1");
                fail("cannot run same batch");
            } catch (IOException e) {
                // ok.
            }
            ExecutionLock other = instance2.newInstance("batch2");
            try {
                // can acquire any flow/exec lock
                other.beginFlow("flow2", "exec1");
                other.endFlow("flow2", "exec1");
                other.beginFlow("flow1", "exec2");
View Full Code Here

        ExecutionLockProvider instance2 = profile.newInstance();

        ExecutionLock lock = instance1.newInstance("batch1");
        try {
            lock.beginFlow("flow1", "exec1");
            ExecutionLock other = instance2.newInstance("batch1");
            try {
                // can acquire other flow lock
                other.beginFlow("flow2", "exec1");
                other.endFlow("flow2", "exec1");
                other.beginFlow("flow2", "exec2");
View Full Code Here

                }
            } finally {
                other.close();
            }

            other = instance2.newInstance("batch2");
            try {
                // can acquire any flow lock if batch is different
                other.beginFlow("flow1", "exec1");
            } finally {
                other.close();
View Full Code Here

        ExecutionLockProvider instance2 = profile.newInstance();

        ExecutionLock lock = instance1.newInstance("batch1");
        try {
            lock.beginFlow("flow1", "exec1");
            ExecutionLock other = instance2.newInstance("batch1");
            try {
                // can acquire other flow lock
                other.beginFlow("flow2", "exec1");
                other.endFlow("flow2", "exec1");
                other.beginFlow("flow2", "exec2");
View Full Code Here

                }
            } finally {
                other.close();
            }

            other = instance2.newInstance("batch2");
            try {
                // can acquire any flow lock if batch is different
                other.beginFlow("flow1", "exec1");
            } finally {
                other.close();
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.