Examples of IVMRunner


Examples of org.eclipse.jdt.launching.IVMRunner

  }

  private void launch(ILaunchConfiguration launchConfig) throws CoreException {
   
    IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
    IVMRunner vmRunner = vmInstall.getVMRunner(ILaunchManager.RUN_MODE);
   
    List classpath = Helper.getClasspath(javaProject);
    IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots();
    for (int i = 0; i < packageFragmentRoots.length; i++) {

      IPackageFragmentRoot aRoot = packageFragmentRoots[i];
      if(aRoot.getKind() == IPackageFragmentRoot.K_SOURCE) {
        IResource resource = aRoot.getResource();
        IPath location = resource.getLocation();
        classpath.add(location.toOSString());
      }
    }
     
    VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(Constants.GWT_COMPILER_CLASS, (String[]) classpath.toArray(new String[classpath.size()]));
    vmConfig.setWorkingDirectory(project.getLocation().toOSString());
    List compilerArgs = Helper.getCompilerArgs(launchConfig);
    vmConfig.setProgramArguments((String[]) compilerArgs.toArray(new String[compilerArgs.size()]));
    final ILaunch compiler = new Launch(null, ILaunchManager.RUN_MODE, null);
   
    DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener() {

      public void handleDebugEvents(DebugEvent[] events) {

        for(int i = 0;i<events.length;i++) {

          DebugEvent event = events[i];
         
                Object source = event.getSource();
                if (source instanceof IProcess && event.getKind() == DebugEvent.TERMINATE) {

                ILaunch launch = ((IProcess) source).getLaunch();
                if (compiler.equals(launch)) {
                  DebugPlugin.getDefault().removeDebugEventListener(this);

              // wakeup the publisher
              synchronized (GwtProject.this) {
                GwtProject.this.notify();
              }
                    }
          }
       
        }
      }
    });

    vmRunner.run(vmConfig, compiler, null);
   
         
    try {
      synchronized (this) {
        int i = 0;
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

        throws CoreException {

        // Verify the configuration
        String mainTypeName = verifyMainTypeName(configuration);
        IVMInstall vm = verifyVMInstall(configuration);
        IVMRunner runner = vm.getVMRunner(mode);

        ExecutionArguments execArgs =
            new ExecutionArguments(getVMArguments(configuration), getProgramArguments(configuration));
        Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
        String[] classpath = getClasspath(configuration);

        File workingDir = verifyWorkingDirectory(configuration);
        String workingDirName = null;
        if (workingDir != null)
            workingDirName = workingDir.getAbsolutePath();

        // Create a VM runner configuration
        VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
        runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
        runConfig.setVMArguments(execArgs.getVMArgumentsArray());
        runConfig.setVMSpecificAttributesMap(vmAttributesMap);
        runConfig.setWorkingDirectory(workingDirName);
        runConfig.setBootClassPath(getBootpath(configuration));

        // Run!!
        runner.run(runConfig, launch, monitor);
    }
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

        return;
      }

      String mainTypeName = "org.apache.openejb.cli.Bootstrap";
      IVMInstall vm = verifyVMInstall(configuration);
      IVMRunner runner = vm.getVMRunner(mode);
     
      if(runner == null && ILaunchManager.PROFILE_MODE.equals(mode)){
        runner = vm.getVMRunner(ILaunchManager.RUN_MODE);
      }
      if(runner == null){
        throw new RuntimeException();
      }
     
      File workingDir = verifyWorkingDirectory(configuration);
      String workingDirName = null;
      if (workingDir != null)
        workingDirName = workingDir.getAbsolutePath();

      // Program & VM args
      String pgmArgs = getProgramArguments(configuration);
      String vmArgs = getVMArguments(configuration);
      String[] envp = getEnvironment(configuration);
     
      ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);

      // VM-specific attributes
      Map vmAttributesMap = getVMSpecificAttributesMap(configuration);

      // Classpath
      String[] classpath = getClasspath(configuration);

      // Create VM config
      VMRunnerConfiguration runConfig = new VMRunnerConfiguration(
          mainTypeName, classpath);
      runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
      runConfig.setVMArguments(execArgs.getVMArgumentsArray());
      runConfig.setWorkingDirectory(workingDirName);
      runConfig.setEnvironment(envp);
      runConfig.setVMSpecificAttributesMap(vmAttributesMap);
     
      // Bootpath
      String[] bootpath = getBootpath(configuration);
      if (bootpath != null && bootpath.length > 0)
        runConfig.setBootClassPath(bootpath);
     
      setDefaultSourceLocator(launch, configuration);
     
      if (ILaunchManager.PROFILE_MODE.equals(mode)) {
        try {
          ServerProfilerDelegate.configureProfiling(launch, vm, runConfig, monitor);
        } catch (CoreException ce) {
//          genericServer.stopImpl();
          throw ce;
        }
      }
     
      // Launch the configuration
//      genericServer.startPingThread();
      genericServer.setState(IServer.STATE_STARTING);
      genericServer.start(launch);
      runner.run(runConfig, launch, monitor);
//      genericServer.setProcess(launch.getProcesses()[0]);
    } catch (CoreException e) {
//      genericServer.terminate();
      throw e;
    }
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

    public void launch(final ILaunchConfiguration config, String mode,
            ILaunch launch, IProgressMonitor monitor) throws CoreException {
        if (!validateConfig(config)) return;
       
         IVMInstall install= getVMInstall(config);
        IVMRunner runner = install.getVMRunner(mode);
       
        if (runner == null) {
            abort("Cannot initiate VM",
                    new RuntimeException("Cannot initiate VM"));
        }
        VMRunnerConfiguration mutantsConfig = createConfig(
                config, mode);
       
        setDefaultSourceLocator(launch, config);
        runner.run(mutantsConfig, launch, null);
       
        refreshOutput(config, launch);
       
       
    }
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

    public void launch(final ILaunchConfiguration config, String mode,
            ILaunch launch, IProgressMonitor monitor) throws CoreException {
        if (!validateConfig(config)) return;
       
        IVMInstall install= getVMInstall(config);
        IVMRunner runner = install.getVMRunner(mode);
       
        if (runner == null) {
            abort("Cannot initiate VM",
                    new RuntimeException("Cannot initiate VM"));
        }
        VMRunnerConfiguration muJavaConfig = createMuJavaConfig(
                config, mode);
       
        setDefaultSourceLocator(launch, config);
        runner.run(muJavaConfig, launch, null);
       
    }
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

        throws CoreException {

        // Verify the configuration
        String mainTypeName = verifyMainTypeName(configuration);
        IVMInstall vm = verifyVMInstall(configuration);
        IVMRunner runner = vm.getVMRunner(mode);

        ExecutionArguments execArgs =
            new ExecutionArguments(getVMArguments(configuration), getProgramArguments(configuration));
        Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
        String[] classpath = getClasspath(configuration);

        File workingDir = verifyWorkingDirectory(configuration);
        String workingDirName = null;
        if (workingDir != null)
            workingDirName = workingDir.getAbsolutePath();

        // Create a VM runner configuration
        VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
        runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
        runConfig.setVMArguments(execArgs.getVMArgumentsArray());
        runConfig.setVMSpecificAttributesMap(vmAttributesMap);
        runConfig.setWorkingDirectory(workingDirName);
        runConfig.setBootClassPath(getBootpath(configuration));

        // Run!!
        runner.run(runConfig, launch, monitor);
    }
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

    }
    try {
      monitor.subTask("verifying installation");

      String mainTypeName = Plugin.BOOTSTRAP_CLASS_NAME;
      IVMRunner runner = getVMRunner(configuration, mode);

      File workingDir = verifyWorkingDirectory(configuration);
      String workingDirName = null;
      if (workingDir != null) {
        workingDirName = workingDir.getAbsolutePath();
      }

      // Environment variables
      String[] envp = getEnvironment(configuration);

      // Program & VM arguments
      String pgmArgs = getProgramArguments(configuration);
      String vmArgs = getVMArguments(configuration);
      ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);

      // VM-specific attributes
      Map vmAttributesMap = getVMSpecificAttributesMap(configuration);

      // Class paths
      String[] classpath = getClasspath(configuration);
      String[] webAppClasspathArray = getProjectClasspath(configuration);
      String webAppClasspath = null;
      {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < webAppClasspathArray.length; i++) {
          String path = webAppClasspathArray[i];
          if (sb.length() > 0)
            sb.append(File.pathSeparator);
          sb.append(path);
        }
        webAppClasspath = sb.toString();
      }

      // Create VM configuration
      VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName,
          classpath);
      runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
      runConfig.setEnvironment(envp);

      List<String> runtimeVmArgs = getJettyArgs(configuration);
      runtimeVmArgs.add("-Drjrclasspath=" + webAppClasspath);
      runtimeVmArgs.addAll(Arrays.asList(execArgs.getVMArgumentsArray()));

      runConfig.setVMArguments(runtimeVmArgs.toArray(new String[runtimeVmArgs
          .size()]));
      runConfig.setWorkingDirectory(workingDirName);
      runConfig.setVMSpecificAttributesMap(vmAttributesMap);

      // Boot path
      runConfig.setBootClassPath(getBootpath(configuration));

      // check for cancellation
      if (monitor.isCanceled()) {
        return;
      }

      // stop in main
      prepareStopInMain(configuration);

      // done the verification phase
      monitor.worked(1);

      monitor.subTask("Creating source locator");
      // set the default source locator if required
      setDefaultSourceLocator(launch, configuration);
      monitor.worked(1);

      // Launch the configuration - 1 unit of work
      runner.run(runConfig, launch, monitor);

      // check for cancellation
      if (monitor.isCanceled()) {
        return;
      }
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

    }
    try {
      monitor.subTask("verifying installation");

      String mainTypeName = Plugin.BOOTSTRAP_CLASS_NAME;
      IVMRunner runner = getVMRunner(configuration, mode);

      File workingDir = verifyWorkingDirectory(configuration);
      String workingDirName = null;
      if (workingDir != null) {
        workingDirName = workingDir.getAbsolutePath();
      }

      // Environment variables
      String[] envp = getEnvironment(configuration);

      // Program & VM arguments
      String pgmArgs = getProgramArguments(configuration);
      String vmArgs = getVMArguments(configuration);
      ExecutionArguments execArgs = new ExecutionArguments(vmArgs,
          pgmArgs);

      // VM-specific attributes
      Map vmAttributesMap = getVMSpecificAttributesMap(configuration);

      // Class paths
     
      //here the classpath means for the Jetty Server , not for the application! by TonyQ 2011/3/7
      String[] classpath = getClasspath(configuration);
     
     
      //here the classpath is really for web app.
      String[] webAppClasspathArray = getProjectClasspath(configuration);
      String webAppClasspath = null;
      {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < webAppClasspathArray.length; i++) {
          String path = webAppClasspathArray[i];
          if (sb.length() > 0)
            sb.append(File.pathSeparator);
          sb.append(path);
        }
        webAppClasspath = sb.toString();
      }

      // Create VM configuration
      VMRunnerConfiguration runConfig = new VMRunnerConfiguration(
          mainTypeName, classpath);
      runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
      runConfig.setEnvironment(envp);

      List<String> runtimeVmArgs = getJettyArgs(configuration);
      runtimeVmArgs.add("-Drjrclasspath=" + webAppClasspath);
      runtimeVmArgs.addAll(Arrays.asList(execArgs.getVMArgumentsArray()));

      runConfig.setVMArguments(runtimeVmArgs
          .toArray(new String[runtimeVmArgs.size()]));
      runConfig.setWorkingDirectory(workingDirName);
      runConfig.setVMSpecificAttributesMap(vmAttributesMap);

      // Boot path
      runConfig.setBootClassPath(getBootpath(configuration));

      // check for cancellation
      if (monitor.isCanceled()) {
        return;
      }

      // stop in main
      prepareStopInMain(configuration);

      // done the verification phase
      monitor.worked(1);

      monitor.subTask("Creating source locator");
      // set the default source locator if required
      setDefaultSourceLocator(launch, configuration);
      monitor.worked(1);

      checkOldLauncher(configuration, launch);
      // Launch the configuration - 1 unit of work
      runner.run(runConfig, launch, monitor);


      // check for cancellation
      if (monitor.isCanceled()) {
        return;
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

        throws CoreException {

        // Verify the configuration
        String mainTypeName = verifyMainTypeName(configuration);
        IVMInstall vm = verifyVMInstall(configuration);
        IVMRunner runner = vm.getVMRunner(mode);

        ExecutionArguments execArgs =
            new ExecutionArguments(getVMArguments(configuration), getProgramArguments(configuration));
        Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
        String[] classpath = getClasspath(configuration);

        File workingDir = verifyWorkingDirectory(configuration);
        String workingDirName = null;
        if (workingDir != null)
            workingDirName = workingDir.getAbsolutePath();

        // Create a VM runner configuration
        VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
        runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
        runConfig.setVMArguments(execArgs.getVMArgumentsArray());
        runConfig.setVMSpecificAttributesMap(vmAttributesMap);
        runConfig.setWorkingDirectory(workingDirName);
        runConfig.setBootClassPath(getBootpath(configuration));

        // Run!!
        runner.run(runConfig, launch, monitor);
    }
View Full Code Here

Examples of org.eclipse.jdt.launching.IVMRunner

      return;
    }

    String mainTypeName = geronimoServer.getRuntimeClass();
    IVMInstall vm = verifyVMInstall(configuration);
    IVMRunner runner = vm.getVMRunner(mode);
   
    if(runner == null && ILaunchManager.PROFILE_MODE.equals(mode)){
      runner = vm.getVMRunner(ILaunchManager.RUN_MODE);
    }

    File workingDir = verifyWorkingDirectory(configuration);
    String workingDirName = null;
    if (workingDir != null)
      workingDirName = workingDir.getAbsolutePath();

    String pgmArgs = getProgramArguments(configuration);
    String vmArgs = getVMArguments(configuration);
    String[] envp = getEnvironment(configuration);

    ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
    Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
    String[] classpath = getClasspath(configuration);

    // Create VM config
    VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
    runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
    runConfig.setVMArguments(execArgs.getVMArgumentsArray());
    runConfig.setWorkingDirectory(workingDirName);
    runConfig.setEnvironment(envp);
    runConfig.setVMSpecificAttributesMap(vmAttributesMap);

    // Bootpath
    String[] bootpath = getBootpath(configuration);
    if (bootpath != null && bootpath.length > 0)
      runConfig.setBootClassPath(bootpath);

    setDefaultSourceLocator(launch, configuration);
   
    if (ILaunchManager.PROFILE_MODE.equals(mode)) {
      try {
        ServerProfilerDelegate.configureProfiling(launch, vm, runConfig, monitor);
      } catch (CoreException ce) {
        geronimoServer.stopImpl();
        throw ce;
      }
    }

    geronimoServer.startPingThread();
    runner.run(runConfig, launch, monitor);
    geronimoServer.setProcess(launch.getProcesses()[0]);
  }
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.