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


Java StepExecutionListener类代码示例

本文整理汇总了Java中org.springframework.batch.core.StepExecutionListener的典型用法代码示例。如果您正苦于以下问题:Java StepExecutionListener类的具体用法?Java StepExecutionListener怎么用?Java StepExecutionListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createTaskletStepWithListener

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
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();
}
 
开发者ID:spring-cloud-task-app-starters,项目名称:composed-task-runner,代码行数:14,代码来源:ComposedRunnerVisitorConfiguration.java

示例2: registerStepExecutionEventListener

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
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);
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:9,代码来源:TaskBatchEventListenerBeanPostProcessor.java

示例3: setupMock

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
@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);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:14,代码来源:TaskBatchEventListenerBeanPostProcessorTests.java

示例4: composedTaskStepExecutionListener

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
@Bean
public StepExecutionListener composedTaskStepExecutionListener(
		TaskConfigurer taskConfigurer) {
	return new ComposedTaskStepExecutionListener(taskConfigurer.getTaskExplorer());
}
 
开发者ID:spring-cloud-task-app-starters,项目名称:composed-task-runner,代码行数:6,代码来源:ComposedTaskRunnerConfiguration.java

示例5: stepExecutionEventsListener

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
@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());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-task,代码行数:6,代码来源:BatchEventAutoConfiguration.java

示例6: stepExecutionListeners

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
@Override
public Set<StepExecutionListener> stepExecutionListeners() {
	Set<StepExecutionListener> listeners = new HashSet<StepExecutionListener>();
	listeners.add(metricsListener());
	return listeners;
}
 
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:7,代码来源:MetricsConfiguration.java

示例7: stepExecutionListeners

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
@Override
public Set<StepExecutionListener> stepExecutionListeners() {
	return new HashSet<StepExecutionListener>();
}
 
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:5,代码来源:TestListenerConfiguration.java

示例8: stepExecutionListeners

import org.springframework.batch.core.StepExecutionListener; //导入依赖的package包/类
/**
 * 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();
 
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:7,代码来源:ListenerProvider.java


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