diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java index a1765cdd0..f4d692919 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,20 +47,20 @@ import org.springframework.context.annotation.Import; * @Import(DataSourceConfiguration.class) * public class AppConfig { * - * @Bean - * public Job job(JobRepository jobRepository) { - * return new JobBuilder("myJob").repository(jobRepository).start(step1()).next(step2()).build(); - * } + * @Bean + * public Job job(JobRepository jobRepository) { + * return new JobBuilder("myJob").repository(jobRepository).start(step1()).next(step2()).build(); + * } * - * @Bean - * protected Step step1() { - * ... - * } + * @Bean + * protected Step step1() { + * ... + * } * - * @Bean - * protected Step step2() { - * ... - * } + * @Bean + * protected Step step2() { + * ... + * } * } * * @@ -106,17 +106,17 @@ import org.springframework.context.annotation.Import; * @EnableBatchProcessing(modular=true) * public class AppConfig { * - * @Bean - * public ApplicationContextFactory someJobs() { - * return new GenericApplicationContextFactory(SomeJobConfiguration.class); - * } + * @Bean + * public ApplicationContextFactory someJobs() { + * return new GenericApplicationContextFactory(SomeJobConfiguration.class); + * } * - * @Bean - * public ApplicationContextFactory moreJobs() { - * return new GenericApplicationContextFactory(MoreJobConfiguration.class); - * } + * @Bean + * public ApplicationContextFactory moreJobs() { + * return new GenericApplicationContextFactory(MoreJobConfiguration.class); + * } * - * ... + * ... * * } * @@ -134,14 +134,13 @@ import org.springframework.context.annotation.Import; * * * - * - * + * + * * * * - * - * + * + * * * * } @@ -149,6 +148,7 @@ import org.springframework.context.annotation.Import; * * @author Dave Syer * @author Mahmoud Ben Hassine + * @author Taeik Lim * */ @Target(ElementType.TYPE) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java index e9af1f120..8434ddbf6 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import java.lang.annotation.RetentionPolicy; * @JobScope * protected Callable<String> value(@Value("#{jobExecution.jobInstance.jobName}") * final String value) { - * return new SimpleCallable(value); + * return new SimpleCallable(value); * } * * @@ -46,6 +46,7 @@ import java.lang.annotation.RetentionPolicy; *

* * @author Michael Minella + * @author Taeik Lim * * @since 3.0.1 * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java index 489ec1d70..6424bd1ad 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import java.lang.annotation.RetentionPolicy; * @StepScope * protected Callable<String> value(@Value("#{stepExecution.stepName}") * final String value) { - * return new SimpleCallable(value); + * return new SimpleCallable(value); * } * * @@ -46,6 +46,7 @@ import java.lang.annotation.RetentionPolicy; *

* * @author Dave Syer + * @author Taeik Lim * * @since 2.2 * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java index e470bc829..28b538b48 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,12 +88,12 @@ import org.springframework.transaction.annotation.Isolation; * @Configuration * public class MyJobConfiguration extends DefaultBatchConfiguration { * - * @Bean - * public Job job(JobRepository jobRepository) { - * return new JobBuilder("myJob", jobRepository) - * // define job flow as needed - * .build(); - * } + * @Bean + * public Job job(JobRepository jobRepository) { + * return new JobBuilder("myJob", jobRepository) + * // define job flow as needed + * .build(); + * } * * } * @@ -101,6 +101,7 @@ import org.springframework.transaction.annotation.Isolation; * @author Dave Syer * @author Michael Minella * @author Mahmoud Ben Hassine + * @author Taeik Lim * @since 2.2 */ @Configuration(proxyBeanMethods = false) diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/config/annotation/EnableBatchIntegration.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/config/annotation/EnableBatchIntegration.java index 68534d86a..66088d169 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/config/annotation/EnableBatchIntegration.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/config/annotation/EnableBatchIntegration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2019 the original author or authors. + * Copyright 2018-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,34 +58,34 @@ import org.springframework.integration.config.EnableIntegration; * @EnableBatchProcessing * public class RemoteChunkingAppConfig { * - * @Autowired - * private RemoteChunkingManagerStepBuilderFactory managerStepBuilderFactory; + * @Autowired + * private RemoteChunkingManagerStepBuilderFactory managerStepBuilderFactory; * - * @Autowired - * private RemoteChunkingWorkerBuilder workerBuilder; + * @Autowired + * private RemoteChunkingWorkerBuilder workerBuilder; * - * @Bean - * public TaskletStep managerStep() { - * return this.managerStepBuilderFactory - * .get("managerStep") - * .chunk(100) - * .reader(itemReader()) - * .outputChannel(outgoingRequestsToWorkers()) - * .inputChannel(incomingRepliesFromWorkers()) - * .build(); - * } + * @Bean + * public TaskletStep managerStep() { + * return this.managerStepBuilderFactory + * .get("managerStep") + * .chunk(100) + * .reader(itemReader()) + * .outputChannel(outgoingRequestsToWorkers()) + * .inputChannel(incomingRepliesFromWorkers()) + * .build(); + * } * - * @Bean - * public IntegrationFlow worker() { - * return this.workerBuilder - * .itemProcessor(itemProcessor()) - * .itemWriter(itemWriter()) - * .inputChannel(incomingRequestsFromManager()) - * .outputChannel(outgoingRepliesToManager()) - * .build(); - * } + * @Bean + * public IntegrationFlow worker() { + * return this.workerBuilder + * .itemProcessor(itemProcessor()) + * .itemWriter(itemWriter()) + * .inputChannel(incomingRequestsFromManager()) + * .outputChannel(outgoingRepliesToManager()) + * .build(); + * } * - * // Middleware beans omitted + * // Middleware beans omitted * * } * @@ -98,42 +98,43 @@ import org.springframework.integration.config.EnableIntegration; * @EnableBatchProcessing * public class RemotePartitioningAppConfig { * - * @Autowired - * private RemotePartitioningManagerStepBuilderFactory managerStepBuilderFactory; + * @Autowired + * private RemotePartitioningManagerStepBuilderFactory managerStepBuilderFactory; * - * @Autowired - * private RemotePartitioningWorkerStepBuilderFactory workerStepBuilderFactory; + * @Autowired + * private RemotePartitioningWorkerStepBuilderFactory workerStepBuilderFactory; * - * @Bean - * public Step managerStep() { - * return this.managerStepBuilderFactory - * .get("managerStep") - * .partitioner("workerStep", partitioner()) - * .gridSize(10) - * .outputChannel(outgoingRequestsToWorkers()) - * .inputChannel(incomingRepliesFromWorkers()) - * .build(); - * } + * @Bean + * public Step managerStep() { + * return this.managerStepBuilderFactory + * .get("managerStep") + * .partitioner("workerStep", partitioner()) + * .gridSize(10) + * .outputChannel(outgoingRequestsToWorkers()) + * .inputChannel(incomingRepliesFromWorkers()) + * .build(); + * } * - * @Bean - * public Step workerStep() { - * return this.workerStepBuilderFactory - * .get("workerStep") - * .inputChannel(incomingRequestsFromManager()) - * .outputChannel(outgoingRepliesToManager()) - * .chunk(100) - * .reader(itemReader()) - * .processor(itemProcessor()) - * .writer(itemWriter()) - * .build(); - * } + * @Bean + * public Step workerStep() { + * return this.workerStepBuilderFactory + * .get("workerStep") + * .inputChannel(incomingRequestsFromManager()) + * .outputChannel(outgoingRepliesToManager()) + * .chunk(100) + * .reader(itemReader()) + * .processor(itemProcessor()) + * .writer(itemWriter()) + * .build(); + * } * - * // Middleware beans omitted + * // Middleware beans omitted * * } * * @since 4.1 * @author Mahmoud Ben Hassine + * @author Taeik Lim */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java b/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java index 570884db1..a597f95b9 100644 --- a/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java +++ b/spring-batch-test/src/main/java/org/springframework/batch/test/context/SpringBatchTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2022 the original author or authors. + * Copyright 2018-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,32 +52,32 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * @ContextConfiguration(classes = MyBatchJobConfiguration.class) * public class MyBatchJobTests { * - * @Autowired - * private JobLauncherTestUtils jobLauncherTestUtils; + * @Autowired + * private JobLauncherTestUtils jobLauncherTestUtils; * - * @Autowired - * private JobRepositoryTestUtils jobRepositoryTestUtils; + * @Autowired + * private JobRepositoryTestUtils jobRepositoryTestUtils; * - * @Autowired - * private Job jobUnderTest; + * @Autowired + * private Job jobUnderTest; * - * @Before - * public void setup() { - * this.jobRepositoryTestUtils.removeJobExecutions(); - * this.jobLauncherTestUtils.setJob(this.jobUnderTest); // this is optional if the job is unique - * } + * @Before + * public void setup() { + * this.jobRepositoryTestUtils.removeJobExecutions(); + * this.jobLauncherTestUtils.setJob(this.jobUnderTest); // this is optional if the job is unique + * } * - * @Test - * public void testMyJob() throws Exception { - * // given - * JobParameters jobParameters = this.jobLauncherTestUtils.getUniqueJobParameters(); + * @Test + * public void testMyJob() throws Exception { + * // given + * JobParameters jobParameters = this.jobLauncherTestUtils.getUniqueJobParameters(); * - * // when - * JobExecution jobExecution = this.jobLauncherTestUtils.launchJob(jobParameters); + * // when + * JobExecution jobExecution = this.jobLauncherTestUtils.launchJob(jobParameters); * - * // then - * Assert.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); - * } + * // then + * Assert.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); + * } * * } * @@ -91,29 +91,29 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * @SpringJUnitConfig(MyBatchJobConfiguration.class) * public class MyBatchJobTests { * - * @Autowired - * private JobLauncherTestUtils jobLauncherTestUtils; + * @Autowired + * private JobLauncherTestUtils jobLauncherTestUtils; * - * @Autowired - * private JobRepositoryTestUtils jobRepositoryTestUtils; + * @Autowired + * private JobRepositoryTestUtils jobRepositoryTestUtils; * - * @BeforeEach - * public void setup(@Autowired Job jobUnderTest) { - * this.jobLauncherTestUtils.setJob(jobUnderTest); // this is optional if the job is unique - * this.jobRepositoryTestUtils.removeJobExecutions(); - * } + * @BeforeEach + * public void setup(@Autowired Job jobUnderTest) { + * this.jobLauncherTestUtils.setJob(jobUnderTest); // this is optional if the job is unique + * this.jobRepositoryTestUtils.removeJobExecutions(); + * } * - * @Test - * public void testMyJob() throws Exception { - * // given - * JobParameters jobParameters = this.jobLauncherTestUtils.getUniqueJobParameters(); + * @Test + * public void testMyJob() throws Exception { + * // given + * JobParameters jobParameters = this.jobLauncherTestUtils.getUniqueJobParameters(); * - * // when - * JobExecution jobExecution = this.jobLauncherTestUtils.launchJob(jobParameters); + * // when + * JobExecution jobExecution = this.jobLauncherTestUtils.launchJob(jobParameters); * - * // then - * Assertions.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); - * } + * // then + * Assertions.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); + * } * * } * @@ -129,6 +129,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * imported from another configuration class). * * @author Mahmoud Ben Hassine + * @author Taeik Lim * @since 4.1 * @see JobLauncherTestUtils * @see JobRepositoryTestUtils