Java 类org.springframework.batch.core.StepExecutionListener 实例源码

项目:composed-task-runner    文件:ComposedRunnerVisitorConfiguration.java   
private Step createTaskletStepWithListener(final String taskName,
        StepExecutionListener stepExecutionListener) {
    return this.steps.get(taskName)
            .tasklet(new Tasklet() {
                @Override
                public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
                    return RepeatStatus.FINISHED;
                }
            })
            .transactionAttribute(getTransactionAttribute())
            .listener(stepExecutionListener)
            .build();
}
项目:spring-cloud-task    文件:TaskBatchEventListenerBeanPostProcessor.java   
private void registerStepExecutionEventListener(Object bean) {
    if (this.applicationContext.containsBean(BatchEventAutoConfiguration.STEP_EXECUTION_EVENTS_LISTENER)) {
        StepExecutionListener stepExecutionListener =
                (StepExecutionListener) this.applicationContext.getBean(BatchEventAutoConfiguration.STEP_EXECUTION_EVENTS_LISTENER);
        AbstractStep step = (AbstractStep) bean;
        step.registerStepExecutionListener(stepExecutionListener);
    }
}
项目:spring-cloud-task    文件:TaskBatchEventListenerBeanPostProcessorTests.java   
@Before
public void setupMock() {
    when(taskletStep.getTasklet()).thenReturn(
            new ChunkOrientedTasklet(chunkProvider, chunkProcessor));
    when(taskletStep.getName()).thenReturn("FOOOBAR");

    registerAlias(ItemProcessListener.class, BatchEventAutoConfiguration.ITEM_PROCESS_EVENTS_LISTENER);
    registerAlias(StepExecutionListener.class, BatchEventAutoConfiguration.STEP_EXECUTION_EVENTS_LISTENER);
    registerAlias(ChunkListener.class, BatchEventAutoConfiguration.CHUNK_EVENTS_LISTENER);
    registerAlias(ItemReadListener.class, BatchEventAutoConfiguration.ITEM_READ_EVENTS_LISTENER);
    registerAlias(ItemWriteListener.class, BatchEventAutoConfiguration.ITEM_WRITE_EVENTS_LISTENER);
    registerAlias(SkipListener.class, BatchEventAutoConfiguration.SKIP_EVENTS_LISTENER);
}
项目:composed-task-runner    文件:ComposedTaskRunnerConfiguration.java   
@Bean
public StepExecutionListener composedTaskStepExecutionListener(
        TaskConfigurer taskConfigurer) {
    return new ComposedTaskStepExecutionListener(taskConfigurer.getTaskExplorer());
}
项目:spring-cloud-task    文件:BatchEventAutoConfiguration.java   
@Bean
@ConditionalOnProperty(prefix = "spring.cloud.task.batch.events.step-execution", name = "enabled", havingValue = "true", matchIfMissing = true)
public StepExecutionListener stepExecutionEventsListener() {
    return new EventEmittingStepExecutionListener(listenerChannels.stepExecutionEvents(),taskEventProperties.getStepExecutionOrder());
}
项目:spring-boot-starter-batch-web    文件:MetricsConfiguration.java   
@Override
public Set<StepExecutionListener> stepExecutionListeners() {
    Set<StepExecutionListener> listeners = new HashSet<StepExecutionListener>();
    listeners.add(metricsListener());
    return listeners;
}
项目:spring-boot-starter-batch-web    文件:TestListenerConfiguration.java   
@Override
public Set<StepExecutionListener> stepExecutionListeners() {
    return new HashSet<StepExecutionListener>();
}
项目:spring-boot-starter-batch-web    文件:ListenerProvider.java   
/**
 * Returns a set of StepExecutionListeners that will be added to each Job.
 * May not return null.
 * @return Returns a set of StepExecutionListeners that will be added to each Job. May not return null.
 */
public Set<StepExecutionListener> stepExecutionListeners();