org.apache.commons.exec.Executor.setExitValues()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(125)

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

Executor.setExitValues介绍

[英]Define a list of exitValue of the process to be considered successful. The caller can pass one of the following values

  • an array of exit values to be considered successful
  • an empty array for auto-detect of successful exit codes relying on org.apache.commons.exec.Executor#isFailure(int)
  • null to indicate to skip checking of exit codes
    If an undefined exit value is returned by the process then org.apache.commons.exec.Executor#execute(CommandLine) will throw an org.apache.commons.exec.ExecuteException.
    [中]定义要被视为成功的流程的exitValue列表。调用方可以传递以下值之一
    *要被视为成功的退出值数组
    *用于根据组织自动检测成功退出代码的空数组。阿帕奇。平民执行官。执行器#isFailure(int)
    *null表示跳过对退出代码的检查
    如果流程返回未定义的退出值,则返回org。阿帕奇。平民执行官。Executor#execute(命令行)将抛出一个组织。阿帕奇。平民执行官。执行异常。

代码示例

代码示例来源:origin: org.codehaus.mojo/exec-maven-plugin

private void fillSuccessCodes( Executor exec )
{
  if ( successCodes != null && successCodes.length > 0 )
  {
    exec.setExitValues( successCodes );
  }
}

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

private void fillSuccessCodes( Executor exec )
{
  if ( successCodes != null && successCodes.length > 0 )
  {
    exec.setExitValues( successCodes );
  }
}

代码示例来源:origin: org.eclipse.smarthome.io/org.eclipse.smarthome.io.net

PumpStreamHandler streamHandler = new PumpStreamHandler(stdout);
executor.setExitValues(null);
executor.setStreamHandler(streamHandler);
executor.setWatchdog(watchdog);

代码示例来源:origin: openhab/openhab-core

PumpStreamHandler streamHandler = new PumpStreamHandler(stdout);
executor.setExitValues(null);
executor.setStreamHandler(streamHandler);
executor.setWatchdog(watchdog);

相关文章