boolean (DeploymentStatus terminalState, boolean forgetRuntime) { //assumed myLock DeploymentRuntime targetRuntime = forgetRuntime ? null : myDeployment.getRuntime(); return myDeployment.changeState(DeploymentStatus.DEPLOYING, terminalState, null, targetRuntime); }