CLOUDSTACK-8964 side effect isolation

extract side effect away to emphasize the main commandDelegation
objective
This commit is contained in:
Daan Hoogland 2015-10-30 09:00:47 +01:00
parent c4afb76d8c
commit fc18d1e8b1
1 changed files with 9 additions and 1 deletions

View File

@ -87,6 +87,15 @@ public class Ovm3HypervisorGuru extends HypervisorGuruBase implements Hypervisor
*/
public Pair<Boolean, Long> getCommandHostDelegation(long hostId, Command cmd) {
LOGGER.debug("getCommandHostDelegation: " + cmd.getClass());
performSideEffectsForDelegationOnCommand(hostId, cmd);
return new Pair<Boolean, Long>(Boolean.FALSE, Long.valueOf(hostId));
}
/**
* @param hostId
* @param cmd
*/
void performSideEffectsForDelegationOnCommand(long hostId, Command cmd) {
if (cmd instanceof StorageSubSystemCommand) {
StorageSubSystemCommand c = (StorageSubSystemCommand)cmd;
c.setExecuteInSequence(true);
@ -108,6 +117,5 @@ public class Ovm3HypervisorGuru extends HypervisorGuruBase implements Hypervisor
}
}
}
return new Pair<Boolean, Long>(Boolean.FALSE, Long.valueOf(hostId));
}
}