Search in sources :

Example 1 with LockProperties

use of org.ovirt.engine.core.common.action.LockProperties in project ovirt-engine by oVirt.

the class CommandBase method getLockProperties.

/**
 * gets the lock properties for the command, sets the properties in the
 * command parameters
 */
protected LockProperties getLockProperties() {
    LockProperties lockProperties = parameters.getLockProperties();
    if (lockProperties == null) {
        lockProperties = applyLockProperties(getLockingPropertiesSettings());
        parameters.setLockProperties(lockProperties);
    }
    return lockProperties;
}
Also used : LockProperties(org.ovirt.engine.core.common.action.LockProperties)

Example 2 with LockProperties

use of org.ovirt.engine.core.common.action.LockProperties in project ovirt-engine by oVirt.

the class CommandBase method acquireLockAsyncTask.

/**
 * The following method should be called after restart of engine during initialization of asynchronous task
 */
public final boolean acquireLockAsyncTask() {
    LockProperties lockProperties = getLockProperties();
    boolean returnValue = true;
    if (!Scope.None.equals(lockProperties.getScope())) {
        releaseLocksAtEndOfExecute = Scope.Execution.equals(lockProperties.getScope());
        if (!releaseLocksAtEndOfExecute) {
            returnValue = acquireLockInternal();
        }
    }
    return returnValue;
}
Also used : LockProperties(org.ovirt.engine.core.common.action.LockProperties)

Example 3 with LockProperties

use of org.ovirt.engine.core.common.action.LockProperties in project ovirt-engine by oVirt.

the class CommandBase method acquireLock.

protected boolean acquireLock() {
    LockProperties lockProperties = getLockProperties();
    boolean returnValue = true;
    if (!Scope.None.equals(lockProperties.getScope())) {
        releaseLocksAtEndOfExecute = Scope.Execution.equals(lockProperties.getScope());
        if (!lockProperties.isWait()) {
            returnValue = acquireLockInternal();
        } else {
            acquireLockAndWait();
        }
    }
    return returnValue;
}
Also used : LockProperties(org.ovirt.engine.core.common.action.LockProperties)

Aggregations

LockProperties (org.ovirt.engine.core.common.action.LockProperties)3