Package org.apache.commons.exec

Examples of org.apache.commons.exec.ExecuteWatchdog.killedProcess()


        executor.setWatchdog(watchDog);
        executor.setStreamHandler(new PumpStreamHandler());
        int result = executor.execute(cmdLine, env);
        if (executor.isFailure(result))
        {
            if (watchDog.killedProcess())
            {
                throw new RuntimeException("Reached timeout while running: " + cmdLine);
            }
            throw new RuntimeException("Process failed with return code [" + result + "]: " + cmdLine);
        }
View Full Code Here


      watchdog.checkException();
    }
    catch (Exception ex) {
      LOG.error("Command: " + cmd + " failed:", ex);
    }
    if(watchdog.killedProcess()) {
      String msg = " was terminated due to timeout(" + timeout + "ms).  See " + AppConfig
              .EXEC_TIMEOUT_NAME + " property";
      LOG.warn("Command: " + cmd + msg);
      res.stderr += " Command " + msg;
    }
View Full Code Here

      watchdog.checkException();
    }
    catch (Exception ex) {
      LOG.error("Command: " + cmd + " failed. res=" + res, ex);
    }
    if(watchdog.killedProcess()) {
      String msg = " was terminated due to timeout(" + timeout + "ms).  See " + AppConfig
              .EXEC_TIMEOUT_NAME + " property";
      LOG.warn("Command: " + cmd + msg + " res=" + res);
      res.stderr += " Command " + msg;
    }
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.