本文整理汇总了Java中org.springframework.batch.item.ExecutionContext.get方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionContext.get方法的具体用法?Java ExecutionContext.get怎么用?Java ExecutionContext.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.batch.item.ExecutionContext
的用法示例。
在下文中一共展示了ExecutionContext.get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.springframework.batch.item.ExecutionContext; //导入方法依赖的package包/类
/**
* Executes the task as specified by the taskName with the associated
* properties and arguments.
* @param contribution mutable state to be passed back to update the current step execution
* @param chunkContext contains the task-execution-id used by the listener.
* @return Repeat status of FINISHED.
*/
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
String tmpTaskName = this.taskName.substring(0,
this.taskName.lastIndexOf('_'));
List<String> args = this.arguments;
ExecutionContext stepExecutionContext = chunkContext.getStepContext().getStepExecution().
getExecutionContext();
if(stepExecutionContext.containsKey("task-arguments")) {
args = (List<String>) stepExecutionContext.get("task-arguments");
}
long executionId = this.taskOperations.launch(tmpTaskName,
this.properties, args);
stepExecutionContext.put("task-execution-id", executionId);
stepExecutionContext.put("task-arguments", args);
waitForTaskToComplete(executionId);
return RepeatStatus.FINISHED;
}
开发者ID:spring-cloud-task-app-starters,项目名称:composed-task-runner,代码行数:32,代码来源:TaskLauncherTasklet.java