org.springframework.cloud.task.configuration.TaskConfigurer Java Examples

The following examples show how to use org.springframework.cloud.task.configuration.TaskConfigurer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ComposedTaskRunnerStepFactoryTests.java    From composed-task-runner with Apache License 2.0 6 votes vote down vote up
@Bean
public TaskConfigurer taskConfigurer() {
	return new TaskConfigurer() {
		@Override
		public TaskRepository getTaskRepository() {
			return null;
		}

		@Override
		public PlatformTransactionManager getTransactionManager() {
			return null;
		}

		@Override
		public TaskExplorer getTaskExplorer() {
			return mock(TaskExplorer.class);
		}

		@Override
		public DataSource getTaskDataSource() {
			return mock(DataSource.class);
		}
	};
}
 
Example #2
Source File: ComposedTaskRunnerStepFactoryTests.java    From spring-cloud-dataflow with Apache License 2.0 6 votes vote down vote up
@Bean
public TaskConfigurer taskConfigurer() {
	return new TaskConfigurer() {
		@Override
		public TaskRepository getTaskRepository() {
			return null;
		}

		@Override
		public PlatformTransactionManager getTransactionManager() {
			return null;
		}

		@Override
		public TaskExplorer getTaskExplorer() {
			return mock(TaskExplorer.class);
		}

		@Override
		public DataSource getTaskDataSource() {
			return mock(DataSource.class);
		}
	};
}
 
Example #3
Source File: TaskBatchAutoConfiguration.java    From spring-cloud-task with Apache License 2.0 6 votes vote down vote up
@Bean
public TaskBatchExecutionListenerFactoryBean taskBatchExecutionListener(
		TaskExplorer taskExplorer) {
	TaskConfigurer taskConfigurer = null;
	if (!this.context.getBeansOfType(TaskConfigurer.class).isEmpty()) {
		taskConfigurer = this.context.getBean(TaskConfigurer.class);
	}
	if (taskConfigurer != null && taskConfigurer.getTaskDataSource() != null) {
		return new TaskBatchExecutionListenerFactoryBean(
				taskConfigurer.getTaskDataSource(), taskExplorer,
				this.taskProperties.getTablePrefix());
	}
	else {
		return new TaskBatchExecutionListenerFactoryBean(null, taskExplorer,
				this.taskProperties.getTablePrefix());
	}
}
 
Example #4
Source File: JdbcHdfsConfiguration.java    From spring-cloud-task-app-starters with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskBatchExecutionListenerFactoryBean taskBatchExecutionListener(TaskConfigurer taskConfigurer) {
	return new TaskBatchExecutionListenerFactoryBean(this.taskDataSource, taskConfigurer.getTaskExplorer());
}
 
Example #5
Source File: TaskBatchExecutionListenerTests.java    From spring-cloud-task with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskConfigurer taskConfigurer() {
	return new DefaultTaskConfigurer(myDataSource());
}
 
Example #6
Source File: SimpleTaskAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskConfigurer taskConfigurer1() {
	return new DefaultTaskConfigurer((DataSource) null);
}
 
Example #7
Source File: SimpleTaskAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskConfigurer taskConfigurer2() {
	return new DefaultTaskConfigurer((DataSource) null);
}