Package com.adito.agent.client.util

Examples of com.adito.agent.client.util.ProcessMonitor


      // // Can we change the working directory of the process?
      try {
        Method m = Runtime.class.getMethod("exec", new Class[] { //$NON-NLS-1$
          String[].class, String[].class, File.class });
        Process prc = (Process) m.invoke(Runtime.getRuntime(), new Object[] { cmdargs, envp, workingDir });
        process = new ProcessMonitor(launcher.getName(), prc);
      } catch (Throwable t) {
        if (workingDir != null) {
          throw new IOException(Messages.getString("JavaApplicationType.failedToChangeWorkingDirectory") //$NON-NLS-1$
            + "changed, but this Java Virtual Machine does not support that."); //$NON-NLS-1$
        }
        process = new ProcessMonitor(launcher.getName(), Runtime.getRuntime().exec(cmdargs));
      }
    } catch (IOException ex) {
      if (events != null)
        events.debug(MessageFormat.format(Messages.getString("JavaApplicationType.processExecutionFailed"), new Object[] { ex.getMessage() })); //$NON-NLS-1$
    }
View Full Code Here


                events.executingApplication(launcher.getName(), cmdline.trim());

            // Can we change the working directory of the process?
            try {
                Method m = Runtime.class.getMethod("exec", new Class[] { String[].class, String[].class, File.class }); //$NON-NLS-1$
                process = new ProcessMonitor(launcher.getName(), (Process) m.invoke(Runtime.getRuntime(), new Object[] { cmdargs,
                    null,
                    workingDir }));
            } catch (Throwable t) {
                if (workingDir != null) {
                    t.printStackTrace();

                    // Try cmd.exe on windows

                    throw new IOException(Messages.getString("ExecutableApplicationType.applicationRequestsThatTheWorkingDirectoryIsChange") + ""); //$NON-NLS-1$ //$NON-NLS-2$
                }
                process = new ProcessMonitor(launcher.getName(), Runtime.getRuntime().exec(cmdargs));
            }
        } catch (IOException ex) {
            if (events != null)
                events.debug(MessageFormat.format(Messages.getString("ExecutableApplicationType.processExecutionFailed"), new Object[] { ex.getMessage() } ) ); //$NON-NLS-1$
        }
View Full Code Here

          events.finishedLaunch();
         
          if(!hasErrored) {
              try {
          out = new FileOutputStream(FileCleaner.deleteOnExit(new File(launcher.getInstallDir(), launcher.getName() + ".out"))); //$NON-NLS-1$
          ProcessMonitor monitor = launcher.getApplicationType().getProcessMonitor();
          if (monitor != null) {
              monitor.watch(out, out);
          }
        } catch (Throwable e) {
        } finally {
                if (out != null) {
                    try {
View Full Code Here

                } else {
                    // Show an error message and kill the process
                    System.out.println(Messages.getString("VPNLauncher.sysout.failedSync")); //$NON-NLS-1$
                    System.out.println(result.getContent());
                    ProcessMonitor monitor = launcher.getApplicationType().getProcessMonitor();
                    if (monitor != null) {
                        // We cant kill the process as there may be error
                        // dialogs
                        // monitor.kill();
                        setMessage(Messages.getString("VPNLauncher.failedSync")); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of com.adito.agent.client.util.ProcessMonitor

Copyright © 2018 www.massapicom. 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.