Examples of unlockMachine()


Examples of org.virtualbox_4_2.ISession.unlockMachine()

      expect(session.getConsole()).andReturn(console);
      expect(console.takeSnapshot(snapshotName, snapshotDesc)).andReturn(
            progress);
      expect(progress.getCompleted()).andReturn(true);

      session.unlockMachine();
      replay(manager, machine, vBox, session, console, progress);

      new TakeSnapshotIfNotAlreadyAttached(Suppliers.ofInstance(manager), snapshotName, snapshotDesc, Logger.CONSOLE)
            .apply(machine);
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

      expect(machine.getName()).andReturn("machine").anyTimes();
      expect(session.getConsole()).andReturn(console);
      expect(console.takeSnapshot(snapshotName, snapshotDesc)).andReturn(
            progress);

      session.unlockMachine();
      replay(manager, machine, vBox, session, console, progress);

      new TakeSnapshotIfNotAlreadyAttached(Suppliers.ofInstance(manager), snapshotName, snapshotDesc, Logger.CONSOLE)
            .apply(machine);
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

         // this is a workaround for shared lock type, where session state is not updated immediately
         if(type == LockType.Shared) {
            Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
         }
         if (session.getState().equals(SessionState.Locked)) {
            session.unlockMachine();
         }
         if(!session.getState().equals(SessionState.Unlocked)) {
            checkSessionIsUnlocked(session, 5, 3L, TimeUnit.SECONDS);
         }
      }
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

      expect(manager.getSessionObject()).andReturn(session);
      expect(session.getMachine()).andReturn(createdMachine);
      createdMachine.lockMachine(session, LockType.Write);
      createdMachine.setMemorySize(1024l);
      createdMachine.saveSettings();
      session.unlockMachine();

      // TODO: this mock test is not finished.
      replay(manager, createdMachine, vBox, session);

      new CreateAndRegisterMachineFromIsoIfNotAlreadyExists(Suppliers.ofInstance(manager), machineUtils,
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

         try {
            session = manager.get().getSessionObject();
            master.getMachine().lockMachine(session, LockType.Write);
            IProgress progress = session.getConsole().deleteSnapshot(master.getMachine().getCurrentSnapshot().getId());
            progress.waitForCompletion(-1);
            session.unlockMachine();
         } catch (Exception e) {
            throw new RuntimeException("error opening vbox machine session: " + e.getMessage(), e);
         }
         logger.debug("<< deleted an existing snapshot of vm(%s)", master.getMachine().getName());
      }
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

      IMachine machine = manager.get().getVBox().findMachine(vmName);
      ISession machineSession;
      try {
         machineSession = manager.get().openMachineSession(machine);
         machineSession.getConsole().resume();
         machineSession.unlockMachine();
      } catch (Exception e) {
         throw Throwables.propagate(e);
      }
   }
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

      IMachine machine = manager.get().getVBox().findMachine(vmName);
      ISession machineSession;
      try {
         machineSession = manager.get().openMachineSession(machine);
         machineSession.getConsole().pause();
         machineSession.unlockMachine();
      } catch (Exception e) {
         throw Throwables.propagate(e);
      }
   }
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

               propagate(e);
         }
      } finally {
         if (session.getState() == SessionState.Locked) {
            // Remove session lock taken by launchVmProcess()
            session.unlockMachine();
            // TODO this unlock is not IMMEDIATELY visible outside (vbox doc)
         }
      }
      return session;
   }
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

      expect(manager.getSessionObject()).andReturn(session).anyTimes();
      expect(machine.launchVMProcess(session, type, environment)).andReturn(progress);
      progress.waitForCompletion(-1);
      expect(session.getState()).andReturn(SessionState.Locked);
      session.unlockMachine();

      replay(manager, machine, session, progress);

      new LaunchMachineIfNotAlreadyRunning(manager, ExecutionType.GUI, "").apply(machine);
View Full Code Here

Examples of org.virtualbox_4_2.ISession.unlockMachine()

      expect(manager.getSessionObject()).andReturn(session);
      expect(session.getMachine()).andReturn(createdMachine);
      createdMachine.lockMachine(session, LockType.Write);
      createdMachine.setMemorySize(1024l);
      createdMachine.saveSettings();
      session.unlockMachine();

      // TODO: this mock test is not finished.
      replay(manager, createdMachine, vBox, session);

      new CreateAndRegisterMachineFromIsoIfNotAlreadyExists(Suppliers.ofInstance(manager), machineUtils,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.