Launch a new JVM for the task.

This method launches the new JVM for the task by executing the
the JVM command using the {@link Shell.ShellCommandExecutor}
189104
void launchTaskJVM(TaskController.TaskControllerContext context) 
                                      throws IOException {
    JvmEnv env = context.env;
    List<String> wrappedCommand = 
      TaskLog.captureOutAndError(env.setup, env.vargs, env.stdout, env.stderr,
          env.logSize, true);
    ShellCommandExecutor shexec = 
        new ShellCommandExecutor(wrappedCommand.toArray(new String[0]), 
                                  env.workDir, env.env);
    // set the ShellCommandExecutor for later use.
    context.shExec = shexec;
    shexec.execute();
  }
1020566
@Override
    protected Thread createThread(final Runnable runnable, final String name) {
        return new Thread(runnable, Thread.currentThread().getName() + "-exec");
    }
599658
def execute(self, jvm_options=None, args=None, executor=None,
              workunit_factory=None, workunit_name=None, workunit_labels=None):
    
    # NB(gmalmquist): It should be OK that we can't declare a subsystem_dependency in this file
    # (because it's just a plain old object), because Ivy is only constructed by Bootstrapper, which
    # makes an explicit call to IvySubsystem.global_instance() in its constructor, which in turn has
    # a declared dependency on DistributionLocator.
    executor = executor or SubprocessExecutor(DistributionLocator.cached())
    runner = self.runner(jvm_options=jvm_options, args=args, executor=executor)
    try:
      with self.resolution_lock:
        result = util.execute_runner(runner, workunit_factory, workunit_name, workunit_labels)
      if result != 0:
        raise self.Error('Ivy command failed with exit code {}{}'.format(
                           result, ': ' + ' '.join(args) if args else ''))
    except executor.Error as e:
      raise self.Error('Problem executing ivy: {}'.format(e))
6924
@Override
    public void execute(Runnable task) {
        Executor executor = getScheduledExecutor();
        try {
            executor.execute(errorHandlingTask(task, false));
        } catch (RejectedExecutionException ex) {
            throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
        }
    }
181827
public void launch() throws Exception {
    final Injector injector = Tang.Factory.getTang().newInjector(readConfigurationFromDisk(this.configurationFilePath));
    final EvaluatorShim evaluatorShim = injector.getInstance(EvaluatorShim.class);
    evaluatorShim.run();
  }
774356
protected Runnable wrapTask(Runnable command) {
    final Callable<Object> wrapped = wrapTask(
        Executors.callable(command, null));
    return new Runnable() {
      @Override public void run() {
        try {
          wrapped.call();
        } catch (Exception e) {
          Throwables.propagate(e);
        }
      }
    };
  }
950438
public void runCommandLine() throws IOException {
		final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			System.out.println("Running jmx client interface.  Type '" + HELP_COMMAND + "' for help.");
			doLines(0, new LineReader() {
				@Override
				public String getNextLine(String prompt) throws IOException {
					System.out.print(prompt);
					System.out.flush();
					return reader.readLine();
				}
			}, false);
		} finally {
			reader.close();
		}
	}
354058
public void execute ()
        throws MojoExecutionException
    {
        if (mapFile == null) mapFile = new File(base, "compmap.txt");
        if (actionDef == null) actionDef = new File(base, "actions.xml");

        ComponentBundler bundler = new ComponentBundler(mapFile, actionDef) {
            @Override protected boolean keepRawPngs () { return keepRawPngs; }
            @Override protected boolean uncompressed () { return false; }
            @Override protected void logInfo (String message) { getLog().info(message); }
            @Override protected void logWarn (String message) { getLog().warn(message); }
        };

        if (bundleDirectories == null) {
            bundleDirectories = findBundleDirs();
        }
        for (BundleDirectory bdir : bundleDirectories) {
            getLog().info("Processing " + bdir);
            File root = new File(base, bdir.root);

            // create the scanner
            DirectoryScanner scanner = new DirectoryScanner();
            scanner.setBasedir(new File(root, bdir.path));
            scanner.setIncludes(includes.toArray(new String[0]));
            scanner.setExcludes(excludes.toArray(new String[0]));
            scanner.scan();

            File targetDir = new File(targetBase, bdir.root);
            File target = new File(new File(targetDir, bdir.path), "components.jar");
            List<Tuple<File,List<String>>> sourceDirs = Lists.newArrayList();
            sourceDirs.add(Tuple.newTuple(scanner.getBasedir(),
                                          Arrays.asList(scanner.getIncludedFiles())));
            bundler.execute(root.getPath(), target, sourceDirs);
        }
    }
191434
public void execute(Runnable command) {
        if (!(command instanceof ClusteredFutureTask)) {
            command = new ClusteredFutureTask<Object>(command, null);
        }
        command.run();
    }
564085
public void initialize() {

        if (m_taskFuture != null) {
            // in case initialize has been called before on this object, cancel the existing task
            m_taskFuture.cancel(false);
            m_taskFuture = null;
        }
        m_state = readCompleteConfiguration();
        // In debug mode, use a shorter delay to speed up the test cases
        long delay = DEBUG ? 500 : TASK_DELAY_MILLIS;
        m_taskFuture = OpenCms.getExecutor().scheduleWithFixedDelay(new Runnable() {

            public void run() {

                performUpdate();
            }
        }, delay, delay, TimeUnit.MILLISECONDS);
    }
1182273
protected void launch(String[] args) throws Exception {
		JarFile.registerUrlProtocolHandler();
		ClassLoader classLoader = createClassLoader(getClassPathArchives());
		launch(args, getMainClass(), classLoader);
	}
1193102
public final void run() {
        int partitionCount = partitionService.getPartitionCount();
        latch = new CountDownLatch(partitionCount);

        for (int partitionId = 0; partitionId < partitionCount; partitionId++) {
            operationExecutor.execute(new CollectContainerRunnable(partitionId));
        }

        try {
            latch.await();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }
777388
public static void exec_command(String command) throws IOException {
        launchProcess(command, new HashMap<String, String>(), false);
    }
1370207
@Override
    public void execute(Runnable command)
    {
        super.execute(isTracing() && !(command instanceof TraceSessionWrapper)
                      ? new TraceSessionWrapper<Object>(Executors.callable(command, null))
                      : command);
    }
1129776
public void launch() throws Exception {
        // Sanity-check the loaded BCEL classes
        if (!CheckBcel.check()) {
            System.exit(1);
        }

        int launchProperty = getLaunchProperty();

        if (GraphicsEnvironment.isHeadless() || launchProperty == TEXTUI) {
            FindBugs2.main(args);
        } else if (launchProperty == SHOW_HELP) {
            ShowHelp.main(args);
        } else if (launchProperty == SHOW_VERSION) {
            Version.main(new String[] { "-release" });
        } else {
            Class<?> launchClass = Class.forName("edu.umd.cs.findbugs.gui2.Driver");
            Method mainMethod = launchClass.getMethod("main", args.getClass());
            mainMethod.invoke(null, (Object) args);
        }

    }
921308
@Override
    public void doExecute() throws MojoExecutionException {
        getLog().info(" ");
        getLog().info(LINE_SEPARATOR);
        getLog().info(" S T A R T I N G    J M E T E R    G U I ");
        getLog().info(LINE_SEPARATOR);
        startJMeterGUI(initialiseJMeterArgumentsArray());
    }
1210876
def launch(self, task, **kwargs):
        
        if task.status == task.S_LOCKED:
            raise ValueError("You shall not submit a locked task!")

        # Build the task
        task.build()

        # Pass information on the time limit to Abinit (we always assume ndtset == 1)
        if isinstance(task, AbinitTask):
            args = kwargs.get("exec_args", [])
            if args is None: args = []
            args = args[:]
            args.append("--timelimit %s" % qu.time2slurm(self.qadapter.timelimit))
            kwargs["exec_args"] = args

        # Write the submission script
        script_file = self.write_jobfile(task, **kwargs)

        # Submit the task and save the queue id.
        try:
            qjob, process = self.qadapter.submit_to_queue(script_file)
            task.set_status(task.S_SUB, msg='Submitted to queue')
            task.set_qjob(qjob)
            return process

        except self.qadapter.MaxNumLaunchesError as exc:
            # TODO: Here we should try to switch to another qadapter
            # 1) Find a new parallel configuration in those stored in task.pconfs
            # 2) Change the input file.
            # 3) Regenerate the submission script
            # 4) Relaunch
            task.set_status(task.S_ERROR, msg="max_num_launches reached: %s" % str(exc))
            raise