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;
}
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;
}
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;
}
Aggregations