Package org.virtualbox_4_0

Examples of org.virtualbox_4_0.IProgress.waitForCompletion()


      checkNotNull(currentSnapshot);

      // clone
      IProgress progress = currentSnapshot.getMachine().cloneTo(clonedMachine, CloneMode.MachineState, options);
      progress.waitForCompletion(-1);

      logger.debug(String.format("<< master(%s) is cloned correctly to vm(%s)", source.getName(), clonedMachine.getName()));

      // registering
      manager.get().getVBox().registerMachine(clonedMachine);
View Full Code Here


      }
   }

   private void launchVMProcess(IMachine machine, ISession session) {
      IProgress prog = machine.launchVMProcess(session, "gui", "");
      prog.waitForCompletion(-1);
      session.unlockMachine();
   }

   private void powerDownMachine(IMachine machine) {
      try {
View Full Code Here

   public ISession apply(IMachine machine) {
      ISession session = manager.getSessionObject();
      try {
         final IProgress progress = machine
                 .launchVMProcess(session, type.stringValue(), environment);
         progress.waitForCompletion(-1);
      } catch (VBoxException e) {
         ErrorCode errorCode = ErrorCode.valueOf(e);
         switch (errorCode) {
            case VBOX_E_INVALID_OBJECT_STATE:
               logger.warn(e, "Could not start machine. Got error code %s from launchMachine(). "
View Full Code Here

      }
   }

   void deleteMediumAndBlockUntilComplete(IMedium medium) {
      final IProgress progress = medium.deleteStorage();
      progress.waitForCompletion(-1);
   }

   private IMedium createNewMedium(IVirtualBox vBox, HardDisk hardDisk) {
      IMedium medium = vBox.createHardDisk(hardDisk.getDiskFormat(), hardDisk.getDiskPath());
      createBaseStorage(medium);
View Full Code Here

   private void createBaseStorage(IMedium hardDisk) {
      try {
         long size = 4L * 1024L * 1024L * 1024L - 4L;
         IProgress storageCreation = hardDisk.createBaseStorage(size,
                  (long) org.virtualbox_4_2.jaxws.MediumVariant.STANDARD.ordinal());
         storageCreation.waitForCompletion(-1);
      } catch (VBoxException e) {
         if (fileNotFoundException(e)) {
            // File for medium could not be found. Something wrong with
            // creation.
            hardDisk.deleteStorage();
View Full Code Here

      IMachine machine = createMock(IMachine.class);
      IProgress progress = createMock(IProgress.class);

      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);
View Full Code Here

      assertTrue(mediumDeleted);
   }

   void deleteMediumAndBlockUntilComplete(IMedium medium) {
      final IProgress progress = medium.deleteStorage();
      progress.waitForCompletion(-1);
   }

}
View Full Code Here

      checkNotNull(currentSnapshot);

      // clone
      IProgress progress = currentSnapshot.getMachine().cloneTo(clonedMachine, CloneMode.MachineState, options);
      progress.waitForCompletion(-1);

      logger.debug(String.format("<< master(%s) is cloned correctly to vm(%s)", source.getName(), clonedMachine.getName()));

      // registering
      manager.get().getVBox().registerMachine(clonedMachine);
View Full Code Here

      }
   }

   void deleteMediumAndBlockUntilComplete(IMedium medium) {
      final IProgress progress = medium.deleteStorage();
      progress.waitForCompletion(-1);
   }

   private IMedium createNewMedium(IVirtualBox vBox, HardDisk hardDisk) {
      IMedium medium = vBox.createHardDisk(hardDisk.getDiskFormat(), hardDisk.getDiskPath());
      createBaseStorage(medium);
View Full Code Here

   private void createBaseStorage(IMedium hardDisk) {
      try {
         long size = 4L * 1024L * 1024L * 1024L - 4L;
         IProgress storageCreation = hardDisk.createBaseStorage(size,
                  (long) org.virtualbox_4_2.jaxws.MediumVariant.STANDARD.ordinal());
         storageCreation.waitForCompletion(-1);
      } catch (VBoxException e) {
         if (fileNotFoundException(e)) {
            // File for medium could not be found. Something wrong with
            // creation.
            hardDisk.deleteStorage();
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.