예제 #1
0
 @Override
 public void acquireControllerLock() {
   if (lockStep == null) {
     try {
       controller.acquireLock(operationId, true);
       lockStep = activeStep;
     } catch (InterruptedException e) {
       cancelled = true;
       Thread.currentThread().interrupt();
       throw ControllerLogger.ROOT_LOGGER.operationCancelledAsynchronously();
     }
   }
 }
예제 #2
0
 private void takeWriteLock() {
   if (lockStep == null) {
     if (currentStage == Stage.DONE) {
       throw MESSAGES.invalidModificationAfterCompletedStep();
     }
     try {
       modelController.acquireLock(respectInterruption);
       lockStep = activeStep;
     } catch (InterruptedException e) {
       Thread.currentThread().interrupt();
       throw MESSAGES.operationCancelledAsynchronously();
     }
   }
 }