Class ProcessWatcher2

java.lang.Object
net.thevpc.nsh.util.ProcessWatcher
net.thevpc.nsh.util.ProcessWatcher2

public class ProcessWatcher2 extends ProcessWatcher
      Process process = Runtime.getRuntime().exec(new String[]{"/bin/java","-version"}, null, new File("."));
      ProcessWatcher w = new ProcessWatcher(process, new ProcessWatcherHandler() {
          public void started(Process process) {
              System.out.println("Process started");
          }

          public void stdout(Process process, String line) {
              System.out.println(line);
          }

          public void stderr(Process process, String line) {
              System.err.println(line);
          }

          public void ended(Process process, int value) {
              System.out.println("Process Shutdown. Exit Value :" + value);
          }

          public void error(Process process, Throwable th) {
              System.err.println(th);
          }
      });
      w.start();
 
Author:
Taha Ben Salah (taha.bensalah@gmail.com) %creationtime 27 juin 2007 12:08:13
  • Constructor Details

  • Method Details

    • waitForStreams

      public void waitForStreams()
    • logInfo

      protected void logInfo(String s)
    • logError

      protected void logError(String s)
    • logError

      protected void logError(Throwable s)
    • start

      public void start()
    • waitfor

      public int waitfor()