当前位置: 首页>>代码示例>>Java>>正文


Java JobOperator.restart方法代码示例

本文整理汇总了Java中javax.batch.operations.JobOperator.restart方法的典型用法代码示例。如果您正苦于以下问题:Java JobOperator.restart方法的具体用法?Java JobOperator.restart怎么用?Java JobOperator.restart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.batch.operations.JobOperator的用法示例。


在下文中一共展示了JobOperator.restart方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testDeciderRestart

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
@Test
public void testDeciderRestart() {

    JobOperator jobOperator = BatchRuntime.getJobOperator();
    long executionId = jobOperator.start("decider-test", new Properties());

    BatchStatus batchStatus = Batches.waitFor(jobOperator, executionId);
    assertEquals(batchStatus, BatchStatus.STOPPED);
    assertEquals(jobOperator.getJobExecution(executionId).getExitStatus(), "decider-stop");

    List<StepExecution> stepExecutions = jobOperator.getStepExecutions(executionId);
    assertEquals(stepExecutions.size(), 1);

    long restartExecutionId = jobOperator.restart(executionId, new Properties());

    BatchStatus restartStatus = Batches.waitFor(jobOperator, restartExecutionId);
    assertEquals(restartStatus, BatchStatus.COMPLETED);

    String exitStatus = jobOperator.getJobExecution(restartExecutionId).getExitStatus();
    assertEquals("COMPLETED", exitStatus);

    List<StepExecution> restartExecutions = jobOperator.getStepExecutions(restartExecutionId);
    assertEquals(restartExecutions.size(), 1);
    assertEquals(restartExecutions.get(0).getStepName(), "executeOnRestart");
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:26,代码来源:DeciderTest.java

示例2: testRestartBadExecutionId

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
@Test
public void testRestartBadExecutionId() throws Exception {
	boolean seen1 = false;
	JobOperator jo = BatchRuntime.getJobOperator();
	long exec1Id = jo.start("alwaysFails1", null);
	try {
		jo.restart(Long.MAX_VALUE, null);
	} catch (NoSuchJobExecutionException e) {
		seen1 = true;
	}
	if (!seen1) throw new IllegalStateException("FAIL");
}
 
开发者ID:WASdev,项目名称:standards.jsr352.jbatch,代码行数:13,代码来源:ImplSpecificJobOperatorTest.java

示例3: testBatchExecutionWithCheckpoints

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
@Test
public void testBatchExecutionWithCheckpoints() {
    final JobOperator op = BatchRuntime.getJobOperator();
    final long id = op.start("checkpoint-storage-test", null);
    Batches.waitForEnd(op, id);

    final List<StepExecution> steps = op.getStepExecutions(id);
    assertEquals(1, steps.size());
    final StepExecution exec = steps.iterator().next();
    Assert.assertEquals(BatchStatus.FAILED, exec.getBatchStatus());

    // now try to restart the batch again
    long restartId = op.restart(id, null);
    Batches.waitForEnd(op, restartId);
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:16,代码来源:DefaultDataRepresentationServiceTest.java

示例4: doStart

import javax.batch.operations.JobOperator; //导入方法依赖的package包/类
@Override
protected long doStart(final JobOperator operator) {
    final long nid = operator.restart(id, toProperties(properties));
    info("Batch " + nid + " restarted with id #" + nid);
    return nid;
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:7,代码来源:Restart.java


注:本文中的javax.batch.operations.JobOperator.restart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。