@EnableBatchProcessing public static class BatchConfigurationWithDataSourceAndNoTransactionManager { @Bean public DataSource dataSource() { return createDataSource(); } @Bean public BatchConfigurer batchConfigurer(DataSource dataSource) { return new DefaultBatchConfigurer(dataSource); } }
@EnableBatchProcessing public static class BatchConfigurationWithNoDataSourceAndTransactionManager { @Bean public PlatformTransactionManager transactionManager() { return transactionManager; } }
@EnableBatchProcessing public static class BatchConfigurationWithDataSourceAndNoTransactionManager { @Bean public DataSource dataSource() { return createDataSource(); } }
@EnableBatchProcessing public static class BatchConfigurationWithNoDataSourceAndNoTransactionManager { @Bean public BatchConfigurer batchConfigurer() { return new DefaultBatchConfigurer(); } }
@EnableBatchProcessing public static class BatchConfigurationWithDataSourceAndOneTransactionManager { @Bean public DataSource dataSource() { return createDataSource(); } @Bean public PlatformTransactionManager transactionManager() { return transactionManager; } }
@Configuration @EnableBatchProcessing public static class BatchConfiguration { } }
@Configuration @EnableBatchProcessing public static class JobScopeConfigurationForcingInterfaceProxy { @Bean @Scope(value="job", proxyMode = ScopedProxyMode.INTERFACES) protected SimpleHolder value(@Value("#{jobName}") final String value) { return new SimpleHolder(value); } }
/** * * @author Gunnar Hillert * @since 1.3 * */ @Configuration @EnableBatchProcessing public class JobLauncherParserTestsConfiguration { }
@Configuration @EnableBatchProcessing public static class JobScopeConfigurationRequiringProxyTargetClass { @Bean @Scope(value="job", proxyMode = ScopedProxyMode.TARGET_CLASS) protected SimpleHolder value(@Value("#{jobName}") final String value) { return new SimpleHolder(value); } }
@Configuration @EnableBatchProcessing(modular=true) public static class LoaderFactoryConfiguration { @Bean public ApplicationContextFactory jobContextFactory() { return new GenericApplicationContextFactory(TestConfiguration.class); } @Bean public ApplicationContextFactory vanillaContextFactory() { return new GenericApplicationContextFactory(VanillaConfiguration.class); } }
@Configuration @EnableBatchProcessing public static class BatchConfiguration { } }
/** * @author Dave Syer * */ @Configuration @EnableBatchProcessing public class JobRunnerConfiguration { @Bean public JobLauncherTestUtils utils() throws Exception { return new JobLauncherTestUtils(); } }
@Configuration @EnableBatchProcessing public static class StepScopeConfigurationRequiringProxyTargetClass { @Bean @Scope(value="step", proxyMode = ScopedProxyMode.TARGET_CLASS) protected SimpleHolder value(@Value("#{stepExecution.stepName}") final String value) { return new SimpleHolder(value); } }
@Configuration @EnableBatchProcessing public static class StepScopeConfigurationWithDefaults { @Bean @StepScope protected Callable<String> value(@Value("#{stepExecution.stepName}") final String value) { return new SimpleCallable(value); } }
@Configuration @EnableBatchProcessing public static class StepScopeConfigurationForcingInterfaceProxy { @Bean @Scope(value="step", proxyMode = ScopedProxyMode.INTERFACES) protected SimpleHolder value(@Value("#{stepExecution.stepName}") final String value) { return new SimpleHolder(value); } }
@Configuration @EnableBatchProcessing public static class JobScopeConfigurationWithDefaults { @Bean @JobScope protected Callable<String> value(@Value("#{jobName}") final String value) { return new SimpleCallable(value); } }
@Configuration @EnableBatchProcessing(modular=true) public static class LoaderRegistrarConfiguration { @Autowired private AutomaticJobRegistrar registrar; @PostConstruct public void initialize() { registrar.addApplicationContextFactory(new GenericApplicationContextFactory(TestConfiguration.class)); registrar.addApplicationContextFactory(new GenericApplicationContextFactory(VanillaConfiguration.class)); } }
@Configuration @ImportResource("org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTestsXmlImportUsingNamespace-context.xml") @EnableBatchProcessing public static class StepScopeConfigurationXmlImportUsingNamespace { @Bean @StepScope protected SimpleHolder javaValue(@Value("#{stepExecution.stepName}") final String value) { return new SimpleHolder(value); } }
@Configuration @ImportResource("org/springframework/batch/core/configuration/annotation/JobScopeConfigurationTestsXmlImportUsingNamespace-context.xml") @EnableBatchProcessing public static class JobScopeConfigurationXmlImportUsingNamespace { @Bean @JobScope protected SimpleHolder javaValue(@Value("#{jobName}") final String value) { return new SimpleHolder(value); } }
@Configuration @Import(DataSourceConfiguration.class) @EnableBatchProcessing public static class BatchConfgiuration { @Bean public JsrJobOperator jobOperator(JobExplorer jobExplorer, JobRepository jobrepository, DataSource dataSource, PlatformTransactionManager transactionManager) throws Exception{ JsrJobParametersConverter jobParametersConverter = new JsrJobParametersConverter(dataSource); jobParametersConverter.afterPropertiesSet(); return new JsrJobOperator(jobExplorer, jobrepository, jobParametersConverter, transactionManager); } } }