hudson.Proc.isAlive()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中hudson.Proc.isAlive()方法的一些代码示例,展示了Proc.isAlive()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Proc.isAlive()方法的具体详情如下:
包路径:hudson.Proc
类名称:Proc
方法名:isAlive

Proc.isAlive介绍

[英]Checks if the process is still alive.
[中]检查进程是否仍处于活动状态。

代码示例

代码示例来源:origin: jenkinsci/jenkins

public boolean isAlive() throws IOException, InterruptedException {
  return p.isAlive();
}

代码示例来源:origin: jenkinsci/jenkins

if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis
  LOGGER.log(Level.WARNING, "Process {0} has not finished after the join() method completion", procHolderForJoin);

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public boolean isAlive() throws IOException, InterruptedException {
  return p.isAlive();
}

代码示例来源:origin: jenkinsci/fitnesse-plugin

private void killProc(Proc proc) {
  if (proc != null) {
    try {
      proc.kill();
      for (int i = 0; i < 4; ++i) {
        if (proc.isAlive())
          Thread.sleep(SLEEP_MILLIS);
      }
    } catch (Exception e) {
      e.printStackTrace(logger);
    }
  }
}

代码示例来源:origin: org.jvnet.hudson.main/maven-plugin

/**
   * Calls a {@link Callable} on the channel, with additional error diagnostics.
   */
  public <V,T extends Throwable> V call(Callable<V,T> callable) throws T, IOException, InterruptedException {
    try {
      return channel.call(callable);
    } catch (RequestAbortedException e) {
      // this is normally triggered by the unexpected Maven JVM termination.
      // check if the process is still alive, after giving it a bit of time to die
      Thread.sleep(1000);
      if(proc.isAlive())
        throw e; // it's still alive. treat this as a bug in the code
      else {
        String msg = "Maven JVM terminated unexpectedly with exit code " + proc.join();
        LOGGER.log(Level.FINE,msg,e);
        throw new hudson.AbortException(msg);
      }
    }
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis
  LOGGER.log(Level.WARNING, "Process {0} has not finished after the join() method completion", procHolderForJoin);

代码示例来源:origin: jenkinsci/maven-plugin

/**
   * Calls a {@link Callable} on the channel, with additional error diagnostics.
   */
  public <V,T extends Throwable> V call(Callable<V,T> callable) throws T, IOException, InterruptedException {
    try {
      return channel.call(callable);
    } catch (RequestAbortedException e) {
      // this is normally triggered by the unexpected Maven JVM termination.
      // check if the process is still alive, after giving it a bit of time to die
      Thread.sleep(1000);
      if(proc.isAlive())
        throw e; // it's still alive. treat this as a bug in the code
      else {
        String msg = "Maven JVM terminated unexpectedly with exit code " + proc.join();
        LOGGER.log(Level.FINE,msg,e);
        throw new hudson.AbortException(msg);
      }
    }
  }
}

代码示例来源:origin: openshift/jenkins-client-plugin

long reCheckSleep = 250;
int outputSize = 0;
while (proc.isAlive()) {
  Thread.sleep(reCheckSleep);
if (proc != null && proc.isAlive()) {
  proc.kill();

代码示例来源:origin: openshift/jenkins-client-plugin

Thread.sleep(reCheckSleep);
  } while (proc.isAlive());
  exitStatus = ps.join();
  bos.flush();
if (proc != null && proc.isAlive()) {
  proc.kill();

代码示例来源:origin: jenkinsci/android-emulator-plugin

try {
  String line;
  while (proc.isAlive() && (line = r.readLine()) != null) {
    logger.println(line);
    if (line.toLowerCase(Locale.ENGLISH).startsWith("license id: ") ||

代码示例来源:origin: jenkinsci/android-emulator-plugin

while (System.currentTimeMillis() < start + timeout && (ignoreProcess || emu.process().isAlive())) {
  ByteArrayOutputStream stream = new ByteArrayOutputStream(16);

代码示例来源:origin: jenkinsci/fitnesse-plugin

if (builder.getFitnesseStart()) {
  fitnesseProc = startFitnesse(workspace, launcher);
  if (!fitnesseProc.isAlive() || !isFitnesseStarted(getFitnessePage(build, false))) {
    return false;

代码示例来源:origin: org.jvnet.hudson.main/maven-plugin

if(!proc.isAlive())
  throw new AbortException("Failed to launch Maven. Exit code = "+proc.join());
throw e;

代码示例来源:origin: jenkinsci/maven-plugin

if(!proc.isAlive())
  throw new AbortException("Failed to launch Maven. Exit code = "+proc.join());
throw e;

代码示例来源:origin: org.jvnet.hudson.main/maven3-plugin

if (!process.isAlive()) {
  String message = "Process did not initiate connection and appears to have died; exit code: " + process.join();
  muxlog.error(message);

代码示例来源:origin: jenkinsci/android-emulator-plugin

if (!killed && emu.process().isAlive()) {
  if (logcatProcess.isAlive()) {
    if (logcatProcess.isAlive()) {
      Utils.killProcess(logcatProcess, KILL_PROCESS_TIMEOUT_MS);

相关文章