本文整理汇总了Java中javax.batch.runtime.StepExecution.getExitStatus方法的典型用法代码示例。如果您正苦于以下问题:Java StepExecution.getExitStatus方法的具体用法?Java StepExecution.getExitStatus怎么用?Java StepExecution.getExitStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.batch.runtime.StepExecution
的用法示例。
在下文中一共展示了StepExecution.getExitStatus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decide
import javax.batch.runtime.StepExecution; //导入方法依赖的package包/类
@Override
public String decide(StepExecution[] stepExecutions) throws Exception {
if (stepExecutions.length != 1) {
throw new IllegalStateException("Expecting stepExecutions array of size 1, found one of size = " + stepExecutions.length);
}
StepExecution stepExecution = stepExecutions[0];
for (StepExecution stepExec : stepExecutions) {
if (stepExec == null) {
throw new Exception("Null StepExecution after flow.");
}
if (!stepExec.getBatchStatus().equals(BatchStatus.COMPLETED)) {
throw new Exception("All step executions must be compelete before transitioning to a decider.");
}
}
// for our test
// <end exit-status="ThatsAllFolks" on="DECIDER_EXIT_STATUS*VERY GOOD INVOCATION" />
return DECIDER_EXIT_STATUS + "*" + stepExecution.getExitStatus();
}
示例2: asArray
import javax.batch.runtime.StepExecution; //导入方法依赖的package包/类
private static Object[] asArray(final StepExecution n) {
return new Object[] {
n.getStepExecutionId(),
n.getStepName(),
n.getBatchStatus().name(),
n.getExitStatus(),
n.getStartTime() != null ? n.getStartTime().toString() : "",
n.getEndTime() != null ? n.getEndTime().toString() : "",
metric(n.getMetrics(), Metric.MetricType.READ_COUNT),
metric(n.getMetrics(), Metric.MetricType.WRITE_COUNT),
metric(n.getMetrics(), Metric.MetricType.COMMIT_COUNT),
metric(n.getMetrics(), Metric.MetricType.ROLLBACK_COUNT),
metric(n.getMetrics(), Metric.MetricType.READ_SKIP_COUNT),
metric(n.getMetrics(), Metric.MetricType.PROCESS_SKIP_COUNT),
metric(n.getMetrics(), Metric.MetricType.WRITE_SKIP_COUNT),
metric(n.getMetrics(), Metric.MetricType.FILTER_COUNT)
};
}
示例3: coreExitStatus
import javax.batch.runtime.StepExecution; //导入方法依赖的package包/类
private String coreExitStatus(StepExecution stepExec) {
String action = (String)stepExec.getPersistentUserData();
String currentExitStatus = stepExec.getExitStatus();
// "Normally" we just pass set 'normalExitStatus' as exit status.
if (currentExitStatus.equals(GOOD_STEP_EXIT_STATUS)) {
return action;
// But if it's the magic number then we return our "SpecialExitStatus".
} else {
return specialExitStatus;
}
}
示例4: decide
import javax.batch.runtime.StepExecution; //导入方法依赖的package包/类
@Override
public String decide(StepExecution[] executions) throws Exception {
String stepExitStatus = "";
String stepName = "";
for (StepExecution stepExec : executions) {
String tempExitStatus = stepExec.getExitStatus();
String tempStepName = stepExec.getStepName();
//Always choose the alphabetically later step name and exit status so we can end the test deterministically
if (stepExitStatus.compareTo(tempExitStatus) < 0) {
stepExitStatus = tempExitStatus;
}
//
if (stepName.compareTo(tempStepName) < 0){
stepName = tempStepName;
}
}
Integer deciderCount = jobCtx.getTransientUserData() == null ? 0 : (Integer)jobCtx.getTransientUserData();
//This will provide a count for how many times the decider is called.
deciderCount++;
jobCtx.setTransientUserData(deciderCount);
String deciderExitStatus = null;
//On a restart we always want everything to continue to the end.
if ("true".equals(isRestart)){
deciderExitStatus = deciderCount + ":" + stepName + "_CONTINUE";
} else{
deciderExitStatus = deciderCount + ":" + stepExitStatus;
}
return deciderExitStatus;
}
示例5: stepExecutionToString
import javax.batch.runtime.StepExecution; //导入方法依赖的package包/类
/**
* @return a stringified version of the stepExecution record
*/
public String stepExecutionToString(StepExecution stepExecution) {
return "stepExecutionID="+stepExecution.getStepExecutionId()
+ ", stepName="+stepExecution.getStepName()
+ ", exitStatus="+ stepExecution.getExitStatus()
+ ", batchStatus="+stepExecution.getBatchStatus()
+ ", startTime="+stepExecution.getStartTime()
+ ", endTime=" +stepExecution.getEndTime()
+ ", metrics=" + metricsToString(stepExecution.getMetrics());
}