diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java index 4f5782e44b..59128e1d15 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java @@ -16,9 +16,9 @@ package org.springframework.batch.core.configuration; /** - * Represents an error has occurred in the configuration of base batch infrastructure - * (creation of a {@link org.springframework.batch.core.repository.JobRepository} for - * example. + * Represents that an error has occurred in the configuration of the base batch + * infrastructure (the creation of a {@link org.springframework.batch.core.repository.JobRepository}, + * for example). * * @author Michael Minella * @author Mahmoud Ben Hassine @@ -29,6 +29,8 @@ public class BatchConfigurationException extends RuntimeException { private static final long serialVersionUID = 1L; /** + * Create an exception with the given {@Link Throwable}. + * * @param t an exception to be wrapped */ public BatchConfigurationException(Throwable t) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java index 52a7c423a6..a039f6f203 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java @@ -36,6 +36,8 @@ public DuplicateJobException(String msg) { } /** + * Create an exception with the given message and the given exception. + * * @param msg error message. * @param e instance of {@link Throwable} that is the cause of the exception. */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java index 1b62b7e09d..dafe2035f7 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java @@ -32,7 +32,7 @@ public interface JobFactory { Job createJob(); /** - * @return The {@link String} containing the {@link Job} name. + * @return The {@link String} that contains the {@link Job} name. */ String getJobName(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java index bd689adeca..c22341189d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java @@ -35,8 +35,9 @@ public interface JobRegistry extends ListableJobLocator { void register(JobFactory jobFactory) throws DuplicateJobException; /** - * Unregisters a previously registered {@link Job}. If it was not previously - * registered there is no error. + * Unregisters a previously registered {@link Job}. If it was not + * previously registered, there is no error. + * * @param jobName the {@link Job} to unregister. */ void unregister(String jobName); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java index fc49b73d50..3eafec973d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java @@ -22,7 +22,7 @@ import java.util.Collection; /** - * Registry keeping track of all the {@link Step} defined in a + * Registry keeping track of all the {@link Step} instances defined in a * {@link org.springframework.batch.core.Job}. * * @author Sebastien Gerard @@ -31,7 +31,7 @@ public interface StepRegistry { /** - * Registers all the step of the given job. If the job is already registered, the + * Registers all the step instances of the given job. If the job is already registered, the * method {@link #unregisterStepsFromJob(String)} is called before registering the * given steps. * @param jobName the give job name @@ -42,7 +42,7 @@ public interface StepRegistry { void register(String jobName, Collection steps) throws DuplicateJobException; /** - * Unregisters all the steps of the given job. If the job is not registered, nothing + * Unregisters all the steps instances of the given job. If the job is not registered, nothing * happens. * @param jobName the given job name */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java index 82c56292b5..f22b0bbe72 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java @@ -37,9 +37,8 @@ import org.springframework.transaction.PlatformTransactionManager; /** - * Base {@code Configuration} class providing common structure for enabling and using - * Spring Batch. Customization is available by implementing the {@link BatchConfigurer} - * interface. + * Base {@code Configuration} class that provides a common structure for enabling and using Spring Batch. + * Customization is available by implementing the {@link BatchConfigurer} interface. * * @author Dave Syer * @author Michael Minella @@ -65,7 +64,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean { /** * Establish the {@link JobBuilderFactory} for the batch execution. * @return The instance of the {@link JobBuilderFactory}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public JobBuilderFactory jobBuilders() throws Exception { @@ -75,7 +74,7 @@ public JobBuilderFactory jobBuilders() throws Exception { /** * Establish the {@link StepBuilderFactory} for the batch execution. * @return The instance of the {@link StepBuilderFactory}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public StepBuilderFactory stepBuilders() throws Exception { @@ -85,7 +84,7 @@ public StepBuilderFactory stepBuilders() throws Exception { /** * Establish the {@link JobRepository} for the batch execution. * @return The instance of the {@link JobRepository}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public abstract JobRepository jobRepository() throws Exception; @@ -93,7 +92,7 @@ public StepBuilderFactory stepBuilders() throws Exception { /** * Establish the {@link JobLauncher} for the batch execution. * @return The instance of the {@link JobLauncher}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public abstract JobLauncher jobLauncher() throws Exception; @@ -101,7 +100,7 @@ public StepBuilderFactory stepBuilders() throws Exception { /** * Establish the {@link JobExplorer} for the batch execution. * @return The instance of the {@link JobExplorer}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public abstract JobExplorer jobExplorer() throws Exception; @@ -109,7 +108,7 @@ public StepBuilderFactory stepBuilders() throws Exception { /** * Establish the {@link JobRegistry} for the batch execution. * @return The instance of the {@link JobRegistry}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ @Bean public JobRegistry jobRegistry() throws Exception { @@ -119,7 +118,7 @@ public JobRegistry jobRegistry() throws Exception { /** * Establish the {@link PlatformTransactionManager} for the batch execution. * @return The instance of the {@link PlatformTransactionManager}. - * @throws Exception The {@link Exception} thrown if error occurs. + * @throws Exception The {@link Exception} thrown if an error occurs. */ public abstract PlatformTransactionManager transactionManager() throws Exception; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java index 5c64e5afef..82b1adf826 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java @@ -21,9 +21,8 @@ import org.springframework.util.Assert; /** - * Base {@code Configuration} class providing common structure for enabling and using - * Spring Batch. Customization is available by implementing the {@link BatchConfigurer} - * interface. + * Base {@code Configuration} class that provides common structure for enabling and using Spring Batch. Customization is + * available by implementing the {@link BatchConfigurer} interface. * * @author Dave Syer * @since 2.2 @@ -50,4 +49,4 @@ public String[] selectImports(AnnotationMetadata importingClassMetadata) { return imports; } -} \ No newline at end of file +} diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java index 90e1f92c96..b37573d5ea 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java @@ -21,8 +21,7 @@ import org.springframework.transaction.PlatformTransactionManager; /** - * Strategy interface for users to provide as a factory for custom components needed by a - * Batch system. + * Strategy interface that users can provide as a factory for custom components needed by a Batch system. * * @author Dave Syer * diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java index 4508d098b8..19689e8f8a 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java @@ -48,8 +48,9 @@ public class DefaultBatchConfigurer implements BatchConfigurer, InitializingBean private JobExplorer jobExplorer; /** - * Create a new {@link DefaultBatchConfigurer} with the passed datasource. This - * constructor will configure a default {@link DataSourceTransactionManager}. + * Create a new {@link DefaultBatchConfigurer} with the passed datasource. This constructor + * configures a default {@link DataSourceTransactionManager}. + * * @param dataSource to use for the job repository and job explorer */ public DefaultBatchConfigurer(DataSource dataSource) { @@ -57,10 +58,9 @@ public DefaultBatchConfigurer(DataSource dataSource) { } /** - * Create a new {@link DefaultBatchConfigurer} with the passed datasource and - * transaction manager. - * @param dataSource to use for the job repository and job explorer - * @param transactionManager to use for the job repository + * Create a new {@link DefaultBatchConfigurer} with the given datasource and transaction manager. + * @param dataSource The data source to use for the job repository and job explorer. + * @param transactionManager The transaction manager to use for the job repository. */ public DefaultBatchConfigurer(DataSource dataSource, PlatformTransactionManager transactionManager) { Assert.notNull(dataSource, "DataSource must not be null"); 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 c23a31383e..a247bc7474 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 @@ -64,8 +64,8 @@ * } * * - * The user should provide a {@link DataSource} as a bean in the context, or else - * implement {@link BatchConfigurer} in the configuration class itself, e.g. + * You should provide a {@link DataSource} as a bean in the context or else implement {@link BatchConfigurer} in + * the configuration class itself -- for example: * *
  * @Configuration
@@ -87,41 +87,30 @@
  * }
  * 
* - * If multiple {@link javax.sql.DataSource}s are defined in the context, the primary - * autowire candidate will be used, otherwise an exception will be thrown. + * If multiple {@link javax.sql.DataSource} instances are defined in the context, the primary autowire candidate + * is used. Otherwise, an exception is thrown. * - * Note that only one of your configuration classes needs to have the - * @EnableBatchProcessing annotation. Once you have an - * @EnableBatchProcessing class in your configuration you will have an - * instance of {@link StepScope} and {@link org.springframework.batch.core.scope.JobScope} - * so your beans inside steps can have @Scope("step") and - * @Scope("job") respectively. You will also be able to - * @Autowired some useful stuff into your context: + * Note that only one of your configuration classes needs to have the @EnableBatchProcessing + * annotation. Once you have an @EnableBatchProcessing class in your configuration, you have an + * instance of {@link StepScope} and {@link org.springframework.batch.core.scope.JobScope}, so your beans inside steps + * can have @Scope("step") and @Scope("job") respectively. You can also + * use @Autowired to insert some useful beans into your context: * * * - * The transaction manager provided by this annotation will be of type - * {@link org.springframework.jdbc.datasource.DataSourceTransactionManager} configured - * with the {@link javax.sql.DataSource} provided within the context. + * The transaction manager provided by this annotation is of type {@link org.springframework.jdbc.datasource.DataSourceTransactionManager} + * and is configured with the {@link javax.sql.DataSource} provided within the context. * - * In order to use a custom transaction manager, a custom {@link BatchConfigurer} should - * be provided. For example: + * To use a custom transaction manager, you should provide a custom {@link BatchConfigurer} -- for example: * *
  * @Configuration
@@ -143,13 +132,11 @@
  * }
  * 
* - * If the configuration is specified as modular=true then the context will - * also contain an {@link AutomaticJobRegistrar}. The job registrar is useful for - * modularizing your configuration if there are multiple jobs. It works by creating - * separate child application contexts containing job configurations and registering those - * jobs. The jobs can then create steps and other dependent components without needing to - * worry about bean definition name clashes. Beans of type - * {@link ApplicationContextFactory} will be registered automatically with the job + * If the configuration is specified as modular=true, the context also contains an + * {@link AutomaticJobRegistrar}. The job registrar is useful for modularizing your configuration if there are multiple + * jobs. It works by creating separate child application contexts to contain job configurations and register those + * jobs. The jobs can then create steps and other dependent components without needing to worry about bean definition + * name clashes. Beans of type {@link ApplicationContextFactory} are automatically registered with the job * registrar. Example: * *
@@ -172,13 +159,12 @@
  * }
  * 
* - * Note that a modular parent context in general should not itself contain - * @Bean definitions for job, especially if a {@link BatchConfigurer} is provided, - * because cyclic configuration dependencies are otherwise likely to develop. + * Note that a modular parent context, in general, should not itself contain @Bean definitions for job, + * especially if a {@link BatchConfigurer} is provided, because cyclic configuration dependencies are likely + * to develop. * *

- * For reference, the first example above can be compared to the following Spring XML - * configuration: + * For reference, compare the first example shown earlier to the following Spring XML configuration: * *

  * {@code
@@ -208,12 +194,12 @@
 public @interface EnableBatchProcessing {
 
 	/**
-	 * Indicate whether the configuration is going to be modularized into multiple
-	 * application contexts. If true then you should not create any @Bean Job
-	 * definitions in this context, but rather supply them in separate (child) contexts
-	 * through an {@link ApplicationContextFactory}.
-	 * @return boolean indicating whether the configuration is going to be modularized
-	 * into multiple application contexts. Defaults to false.
+	 * Indicate whether the configuration is going to be modularized into multiple application contexts. If true,
+	 * you should not create any @Bean Job definitions in this context but, rather, supply them in separate (child)
+	 * contexts through an {@link ApplicationContextFactory}.
+	 *
+	 * @return boolean indicating whether the configuration is going to be
+	 * modularized into multiple application contexts. Defaults to {@code false}.
 	 */
 	boolean modular() default false;
 
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java
index 09653e6268..351d0f774f 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java
@@ -20,8 +20,7 @@
 import org.springframework.util.Assert;
 
 /**
- * Convenient factory for a {@link JobBuilder} which sets the {@link JobRepository}
- * automatically.
+ * Convenient factory for a {@link JobBuilder} that sets the {@link JobRepository} automatically.
  *
  * @author Dave Syer
  * @author Mahmoud Ben Hassine
@@ -41,9 +40,9 @@ public JobBuilderFactory(JobRepository jobRepository) {
 	}
 
 	/**
-	 * Creates a job builder and initializes its job repository. Note that if the builder
-	 * is used to create a @Bean definition then the name of the job and the bean name
-	 * might be different.
+	 * Creates a job builder and initializes its job repository. Note that, if the builder is used to create a @Bean
+	 * definition, the name of the job and the bean name might be different.
+	 *
 	 * @param name the name of the job
 	 * @return a job builder
 	 */
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 a36662185d..0dc3698cae 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
@@ -24,10 +24,10 @@
 
 /**
  * 

- * Convenient annotation for job scoped beans that defaults the proxy mode, so that it - * doesn't have to be specified explicitly on every bean definition. Use this on any - * @Bean that needs to inject @Values from the job context, and any bean that - * needs to share a lifecycle with a job execution (e.g. an JobExecutionListener). E.g. + * Convenient annotation for job-scoped beans that defaults the proxy mode, so that it does not have to be specified + * explicitly on every bean definition. Use this on any @Bean that needs to inject @Values from the job + * context, and any bean that needs to share a lifecycle with a job execution (such as an JobExecutionListener). + * The following listing shows an example: *

* *
@@ -54,4 +54,4 @@
 @Documented
 public @interface JobScope {
 
-}
\ No newline at end of file
+}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
index 5eeb9fdd20..ac25e0c6d4 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
@@ -46,8 +46,9 @@ public class ModularBatchConfiguration extends SimpleBatchConfiguration {
 
 	/**
 	 * Creates a {@link AutomaticJobRegistrar} bean.
-	 * @return New instance of {@link AutomaticJobRegistrar}.
-	 * @throws Exception The {@link Exception} thrown if an error occurs.
+	 *
+	 * @return a new instance of {@link AutomaticJobRegistrar}.
+	 * @throws an {@link Exception} if an error occurs.
 	 */
 	@Bean
 	public AutomaticJobRegistrar jobRegistrar() throws Exception {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
index d45f8f8c96..4c4ae96162 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
@@ -26,9 +26,8 @@
 import org.springframework.transaction.PlatformTransactionManager;
 
 /**
- * Base {@code Configuration} class providing common structure for enabling and using
- * Spring Batch. Customization is available by implementing the {@link BatchConfigurer}
- * interface.
+ * Base {@code Configuration} class to provide a common structure for enabling and using Spring Batch.
+ * Customization is available by implementing the {@link BatchConfigurer} interface.
  *
  * @author Dave Syer
  * @author Mahmoud Ben Hassine
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java
index 05312927ed..6cace7b5ef 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/StepBuilderFactory.java
@@ -49,9 +49,9 @@ public StepBuilderFactory(JobRepository jobRepository, PlatformTransactionManage
 	}
 
 	/**
-	 * Creates a step builder and initializes its job repository and transaction manager.
-	 * Note that if the builder is used to create a @Bean definition then the name of
-	 * the step and the bean name might be different.
+	 * Creates a step builder and initializes its job repository and transaction manager. Note that, if the builder is
+	 * used to create a @Bean definition, the name of the step and the bean name might be different.
+	 *
 	 * @param name the name of the step
 	 * @return a step builder
 	 */
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 b6c1f5a886..5b50e5c12e 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
@@ -24,10 +24,10 @@
 
 /**
  * 

- * Convenient annotation for step scoped beans that defaults the proxy mode, so that it - * doesn't have to be specified explicitly on every bean definition. Use this on any - * @Bean that needs to inject @Values from the step context, and any bean that - * needs to share a lifecycle with a step execution (e.g. an ItemStream). E.g. + * Convenient annotation for step-scoped beans. It defaults the proxy mode so that it need not be specified + * explicitly on every bean definition. Use this on any @Bean that needs to inject @Values from the step + * context and on any bean that needs to share a lifecycle with a step execution (such as an ItemStream). + * The following listing shows an example: *

* *
@@ -54,4 +54,4 @@
 @Documented
 public @interface StepScope {
 
-}
\ No newline at end of file
+}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java
index 3b087c5a84..e99fa921bc 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AbstractApplicationContextFactory.java
@@ -41,13 +41,10 @@
 import org.springframework.util.ClassUtils;
 
 /**
- * {@link ApplicationContextFactory} implementation that takes a parent context and a path
- * to the context to create. When createApplicationContext method is called, the child
- * {@link ApplicationContext} will be returned. The child context is not re-created every
- * time it is requested, it is lazily initialized and cached. Clients should ensure that
- * it is closed when it is no longer needed. If a path is not set, the parent will always
- * be returned.
- *
+ * {@link ApplicationContextFactory} implementation that takes a parent context and a path to the context to create.
+ * When the {@code createApplicationContext} method is called, the child {@link ApplicationContext} is returned. The child
+ * context is not re-created every time it is requested. It is lazily initialized and cached. Clients should ensure that
+ * it is closed when it is no longer needed. If a path is not set, the parent is always returned.
  */
 public abstract class AbstractApplicationContextFactory implements ApplicationContextFactory, ApplicationContextAware {
 
@@ -64,8 +61,9 @@ public abstract class AbstractApplicationContextFactory implements ApplicationCo
 	private Collection> beanPostProcessorExcludeClasses;
 
 	/**
-	 * Create a factory instance with the resource specified. The resources are Spring
-	 * configuration files or java packages containing configuration files.
+	 * Create a factory instance with the resource specified. The resources are Spring configuration files or Java
+	 * packages that contain configuration files.
+	 *
 	 * @param resource resource to be used in the creation of the ApplicationContext.
 	 */
 	public AbstractApplicationContextFactory(Object... resource) {
@@ -86,8 +84,9 @@ public AbstractApplicationContextFactory(Object... resource) {
 	}
 
 	/**
-	 * Flag to indicate that configuration such as bean post processors and custom editors
-	 * should be copied from the parent context. Defaults to true.
+	 * Flag to indicate that configuration, such as bean post processors and custom editors, should be copied from the
+	 * parent context. Defaults to {@code true}.
+	 *
 	 * @param copyConfiguration the flag value to set
 	 */
 	public void setCopyConfiguration(boolean copyConfiguration) {
@@ -95,8 +94,9 @@ public void setCopyConfiguration(boolean copyConfiguration) {
 	}
 
 	/**
-	 * Protected access for subclasses to the flag determining whether configuration
-	 * should be copied from parent context.
+	 * Protected access for subclasses to the flag that determines whether configuration should be copied from the parent
+	 * context.
+	 *
 	 * @return the flag value
 	 */
 	protected final boolean isCopyConfiguration() {
@@ -104,9 +104,9 @@ protected final boolean isCopyConfiguration() {
 	}
 
 	/**
-	 * Determines which bean factory post processors (like property placeholders) should
-	 * be copied from the parent context. Defaults to
-	 * {@link PropertySourcesPlaceholderConfigurer} and {@link CustomEditorConfigurer}.
+	 * Determines which bean factory post processors (such as property placeholders) should be copied from the parent
+	 * context. Defaults to {@link PropertySourcesPlaceholderConfigurer} and {@link CustomEditorConfigurer}.
+	 *
 	 * @param beanFactoryPostProcessorClasses array of post processor types to be copied
 	 */
 
@@ -119,11 +119,11 @@ public void setBeanFactoryPostProcessorClasses(
 	}
 
 	/**
-	 * Determines by exclusion which bean post processors should be copied from the parent
-	 * context. Defaults to {@link BeanFactoryAware} (so any post processors that have a
-	 * reference to the parent bean factory are not copied into the child). Note that
-	 * these classes do not themselves have to be {@link BeanPostProcessor}
-	 * implementations or sub-interfaces.
+	 * Determines, by exclusion, which bean post processors should be copied from the parent context. Defaults to
+	 * {@link BeanFactoryAware} (so any post processors that have a reference to the parent bean factory are not copied
+	 * into the child). Note that these classes do not themselves have to be {@link BeanPostProcessor} implementations
+	 * or sub-interfaces.
+	 *
 	 * @param beanPostProcessorExcludeClasses the classes to set
 	 */
 	public void setBeanPostProcessorExcludeClasses(Class[] beanPostProcessorExcludeClasses) {
@@ -180,8 +180,7 @@ protected abstract ConfigurableApplicationContext createApplicationContext(Confi
 	 * Extension point for special subclasses that want to do more complex things with the
 	 * context prior to refresh. The default implementation does nothing.
 	 * @param parent the parent for the new application context
-	 * @param context the new application context before it is refreshed, but after bean
-	 * factory is initialized
+	 * @param context the new application context before it is refreshed but after the bean factory is initialized
 	 *
 	 * @see AbstractApplicationContextFactory#setBeanFactoryPostProcessorClasses(Class[])
 	 */
@@ -189,10 +188,11 @@ protected void prepareContext(ConfigurableApplicationContext parent, Configurabl
 	}
 
 	/**
-	 * Extension point for special subclasses that want to do more complex things with the
-	 * bean factory prior to refresh. The default implementation copies all configuration
-	 * from the parent according to the {@link #setCopyConfiguration(boolean) flag} set.
-	 * @param parent the parent bean factory for the new context (will never be null)
+	 * Extension point for special subclasses that want to do more complex things with the bean factory prior to
+	 * refresh. The default implementation copies all configuration from the parent according to the
+	 * {@link #setCopyConfiguration(boolean) flag} set.
+	 *
+	 * @param parent the parent bean factory for the new context (can never be null)
 	 * @param beanFactory the new bean factory before bean definitions are loaded
 	 *
 	 * @see AbstractApplicationContextFactory#setCopyConfiguration(boolean)
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java
index 1cab43fefb..bf51808926 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextFactory.java
@@ -21,8 +21,9 @@
 import org.springframework.context.ConfigurableApplicationContext;
 
 /**
- * Factory for the creation of {@link ApplicationContext}s. This interface is primarily
- * useful when creating a new {@link ApplicationContext} per execution of a {@link Job}.
+ * Factory for the creation of {@link ApplicationContext} instances. This interface
+ * is primarily useful when creating a new {@link ApplicationContext} for
+ * a {@link Job}.
  *
  * @author Lucas Ward
  */
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
index 34b486e921..5e7feeab0b 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
@@ -32,9 +32,10 @@ public class ApplicationContextJobFactory implements JobFactory {
 	private final Job job;
 
 	/**
-	 * @param jobName the id of the {@link Job} in the application context to be created
-	 * @param applicationContextFactory a factory for an application context containing a
-	 * job with the job name provided
+	 * @param jobName the ID of the {@link Job} in the application context to be
+	 * created.
+	 * @param applicationContextFactory a factory for an application context
+	 * that contains a job with the job name provided.
 	 */
 	public ApplicationContextJobFactory(String jobName, ApplicationContextFactory applicationContextFactory) {
 		@SuppressWarnings("resource")
@@ -54,7 +55,7 @@ public final Job createJob() {
 	}
 
 	/**
-	 * Just return the name of instance passed in on initialization.
+	 * Return the name of the instance passed in on initialization.
 	 *
 	 * @see JobFactory#getJobName()
 	 */
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java
index e1da66ab12..ba1aba0de4 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/AutomaticJobRegistrar.java
@@ -32,10 +32,9 @@
 import org.springframework.util.Assert;
 
 /**
- * Loads and unloads {@link Job Jobs} when the application context is created and
- * destroyed. Each resource provided is loaded as an application context with the current
- * context as its parent, and then all the jobs from the child context are registered
- * under their bean names. A {@link JobRegistry} is required.
+ * Loads and unloads {@link Job Jobs} when the application context is created and destroyed. Each provided resource is
+ * loaded as an application context with the current context as its parent. Then all the jobs from the child context
+ * are registered under their bean names. A {@link JobRegistry} is required.
  *
  * @author Lucas Ward
  * @author Dave Syer
@@ -61,9 +60,10 @@ public class AutomaticJobRegistrar implements Ordered, SmartLifecycle, Applicati
 	private int order = Ordered.LOWEST_PRECEDENCE;
 
 	/**
-	 * The enclosing application context, which can be used to check if
-	 * {@link ApplicationContextEvent events} come from the expected source.
-	 * @param applicationContext the enclosing application context if there is one
+	 * The enclosing application context, which you can use to check whether {@link ApplicationContextEvent events} come
+	 * from the expected source.
+	 *
+	 * @param applicationContext the enclosing application context, if there is one
 	 * @see ApplicationContextAware#setApplicationContext(ApplicationContext)
 	 */
 	@Override
@@ -72,9 +72,9 @@ public void setApplicationContext(ApplicationContext applicationContext) {
 	}
 
 	/**
-	 * Add some factories to the set that will be used to load contexts and jobs.
-	 * @param applicationContextFactory the {@link ApplicationContextFactory} values to
-	 * use
+	 * Add a single {@link ApplicationContextFactory} to the set that is used to load contexts and jobs.
+	 *
+	 * @param applicationContextFactory the {@link ApplicationContextFactory} values to use
 	 */
 	public void addApplicationContextFactory(ApplicationContextFactory applicationContextFactory) {
 		if (applicationContextFactory instanceof ApplicationContextAware) {
@@ -84,9 +84,9 @@ public void addApplicationContextFactory(ApplicationContextFactory applicationCo
 	}
 
 	/**
-	 * Add some factories to the set that will be used to load contexts and jobs.
-	 * @param applicationContextFactories the {@link ApplicationContextFactory} values to
-	 * use
+	 * Add an array of {@link ApplicationContextFactory} instances to the set that is used to load contexts and jobs.
+	 *
+	 * @param applicationContextFactories the {@link ApplicationContextFactory} values to use
 	 */
 	public void setApplicationContextFactories(ApplicationContextFactory[] applicationContextFactories) {
 		for (ApplicationContextFactory applicationContextFactory : applicationContextFactories) {
@@ -95,7 +95,8 @@ public void setApplicationContextFactories(ApplicationContextFactory[] applicati
 	}
 
 	/**
-	 * The job loader that will be used to load and manage jobs.
+	 * The job loader that is used to load and manage jobs.
+	 *
 	 * @param jobLoader the {@link JobLoader} to set
 	 */
 	public void setJobLoader(JobLoader jobLoader) {
@@ -108,7 +109,7 @@ public int getOrder() {
 	}
 
 	/**
-	 * The order to start up and shutdown.
+	 * The order in which to start up and shutdown.
 	 * @param order the order (default {@link Ordered#LOWEST_PRECEDENCE}).
 	 * @see Ordered
 	 */
@@ -163,8 +164,9 @@ public void start() {
 	}
 
 	/**
-	 * Check if this component has been started.
-	 * @return true if started successfully and not stopped
+	 * Check whether this component has been started.
+	 *
+	 * @return {@code true} if started successfully and not stopped.
 	 * @see Lifecycle#isRunning()
 	 */
 	@Override
@@ -180,7 +182,7 @@ public boolean isAutoStartup() {
 	}
 
 	/**
-	 * @param autoStartup true for auto start.
+	 * @param autoStartup {@code true} for auto start.
 	 * @see #isAutoStartup()
 	 */
 	public void setAutoStartup(boolean autoStartup) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java
index 38696035e9..509c2dd14c 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClasspathXmlApplicationContextsFactoryBean.java
@@ -51,10 +51,13 @@ public class ClasspathXmlApplicationContextsFactoryBean
 	private ApplicationContext applicationContext;
 
 	/**
-	 * A set of resources to load using a {@link GenericApplicationContextFactory}. Each
-	 * resource should be a Spring configuration file which is loaded into an application
-	 * context whose parent is the current context. In a configuration file the resources
-	 * can be given as a pattern (e.g. classpath*:/config/*-context.xml).
+	 * A set of resources to load by using a
+	 * {@link GenericApplicationContextFactory}. Each resource should be a
+	 * Spring configuration file that is loaded into an application context
+	 * whose parent is the current context. In a configuration file, the
+	 * resources can be given as a pattern (for example,
+	 * classpath*:/config/*-context.xml).
+	 *
 	 * @param resources array of resources to use
 	 */
 	public void setResources(Resource[] resources) {
@@ -62,8 +65,10 @@ public void setResources(Resource[] resources) {
 	}
 
 	/**
-	 * Flag to indicate that configuration such as bean post processors and custom editors
-	 * should be copied from the parent context. Defaults to true.
+	 * Flag to indicate that configuration, such as bean post processors and
+	 * custom editors, should be copied from the parent context. Defaults to
+	 * {@code true}.
+	 *
 	 * @param copyConfiguration the flag value to set
 	 */
 	public void setCopyConfiguration(boolean copyConfiguration) {
@@ -71,8 +76,8 @@ public void setCopyConfiguration(boolean copyConfiguration) {
 	}
 
 	/**
-	 * Determines which bean factory post processors (like property placeholders) should
-	 * be copied from the parent context. Defaults to
+	 * Determines which bean factory post processors (such as property
+	 * placeholders) should be copied from the parent context. Defaults to
 	 * {@link PropertySourcesPlaceholderConfigurer} and {@link CustomEditorConfigurer}.
 	 * @param beanFactoryPostProcessorClasses post processor types to be copied
 	 */
@@ -83,11 +88,12 @@ public void setBeanFactoryPostProcessorClasses(
 	}
 
 	/**
-	 * Determines by exclusion which bean post processors should be copied from the parent
-	 * context. Defaults to {@link BeanFactoryAware} (so any post processors that have a
-	 * reference to the parent bean factory are not copied into the child). Note that
-	 * these classes do not themselves have to be {@link BeanPostProcessor}
-	 * implementations or sub-interfaces.
+	 * Determines, by exclusion, which bean post processors should be copied from
+	 * the parent context. Defaults to {@link BeanFactoryAware} (so any post
+	 * processors that have a reference to the parent bean factory are not
+	 * copied into the child). Note that these classes do not themselves have to
+	 * be {@link BeanPostProcessor} implementations or sub-interfaces.
+	 *
 	 * @param beanPostProcessorExcludeClasses the classes to set
 	 */
 	public void setBeanPostProcessorExcludeClasses(Class[] beanPostProcessorExcludeClasses) {
@@ -124,7 +130,7 @@ public ApplicationContextFactory[] getObject() throws Exception {
 	}
 
 	/**
-	 * The type of object returned by this factory - an array of
+	 * The type of object returned by this factory as an array of
 	 * {@link ApplicationContextFactory}.
 	 * @return array of {@link ApplicationContextFactory}
 	 * @see FactoryBean#getObjectType()
@@ -136,7 +142,7 @@ public Class getObjectType() {
 
 	/**
 	 * Optimization hint for bean factory.
-	 * @return true
+	 * @return {@code true}
 	 * @see FactoryBean#isSingleton()
 	 */
 	@Override
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
index 9a544d6686..1d622ab0c4 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
@@ -61,7 +61,7 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
 	private Map> contextToJobNames = new ConcurrentHashMap<>();
 
 	/**
-	 * Default constructor useful for declarative configuration.
+	 * Default constructor. Useful for declarative configuration.
 	 */
 	public DefaultJobLoader() {
 		this(null, null);
@@ -244,9 +244,10 @@ private Collection getSteps(final StepLocator stepLocator, final Applicati
 	}
 
 	/**
-	 * Registers the specified {@link Job} defined in the specified
-	 * {@link ConfigurableApplicationContext}. 
- * Makes sure to update the {@link StepRegistry} if it is available. + * Registers the specified {@link Job} defined in the specified {@link ConfigurableApplicationContext}. + *
+ * Updates the {@link StepRegistry} if it is available. + * * @param context the context in which the job is defined * @param job the job to register * @throws DuplicateJobException if that job is already registered diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java index 6e263c1004..f7c36f99e7 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GenericApplicationContextFactory.java @@ -34,23 +34,20 @@ import java.util.List; /** - * {@link ApplicationContextFactory} implementation that takes a parent context and a path - * to the context to create. When createApplicationContext method is called, the child - * {@link ApplicationContext} will be returned. The child context is not re-created every - * time it is requested, it is lazily initialized and cached. Clients should ensure that + * {@link ApplicationContextFactory} implementation that takes a parent context and a path to the context to create. + * When the {@code createApplicationContext} method is called, the child {@link ApplicationContext} is returned. The child + * context is not re-created every time it is requested. It is lazily initialized and cached. Clients should ensure that * it is closed when it is no longer needed. - * */ public class GenericApplicationContextFactory extends AbstractApplicationContextFactory { /** - * Create an application context factory for the resource specified. The resource can - * be an actual {@link Resource}, in which case it will be interpreted as an XML file, - * or it can be a @Configuration class, or a package name. All types must be the - * same (mixing XML with a java package for example is not allowed and will result in - * an {@link java.lang.IllegalArgumentException}). - * @param resources some resources (XML configuration files, @Configuration - * classes or java packages to scan) + * Create an application context factory for the specified resource. The resource can be an actual {@link Resource} + * (in which case, it is interpreted as an XML file), or it can be a @Configuration class or a package name. + * All types must be the same (mixing XML with a Java package, for example, is not allowed and results in an + * {@link java.lang.IllegalArgumentException}). + * + * @param resources some resources (XML configuration files, @Configuration classes, or Java packages to scan) */ public GenericApplicationContextFactory(Object... resources) { super(resources); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java index a5cbbfe0e1..fae787ac7f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java @@ -23,13 +23,13 @@ import org.springframework.util.ClassUtils; /** - * A {@link Job} that can optionally prepend a group name to another job's name, to make - * it fit a naming convention for type or origin. E.g. the source job might be - * overnightJob and the group financeDepartment, which would - * result in a {@link Job} with identical functionality but named - * financeDepartment.overnightJob . The use of a "." separator for elements - * is deliberate, since it is a "safe" character in a - * URL. + * A {@link Job} that can optionally prepend a group name to another job's name, + * to make it fit a naming convention for type or origin. For example, the source job + * might be overnightJob and the group might be + * financeDepartment, which would result in a {@link Job} with + * identical functionality but named financeDepartment.overnightJob + * . The use of a "." separator for elements is deliberate, since it is a "safe" + * character in a URL. * * @author Dave Syer * @author Mahmoud Ben Hassine diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java index 9cf3705ab6..1614b976aa 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobFactoryRegistrationListener.java @@ -57,7 +57,7 @@ public void bind(JobFactory jobFactory, Map params) throws Exception } /** - * Take the {@link JobFactory} provided and unregister it with the + * Take the provided {@link JobFactory} and unregister it with the * {@link JobRegistry}. * @param jobFactory a {@link JobFactory} * @param params not needed by this listener. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java index d0df080c53..58f8990bdc 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobLoader.java @@ -35,10 +35,11 @@ public interface JobLoader { Collection load(ApplicationContextFactory factory) throws DuplicateJobException; /** - * Load an application context and register all the jobs, having first unregistered - * them if already registered. Implementations should also take care to close and - * clean up the application context previously created if possible (either from this - * factory or from one with the same jobs). + * Load an application context and register all the jobs, having first + * unregistered them if already registered. Implementations should also + * close and clean up the application context previously created + * (either from this factory or from one with the same jobs), if possible. + * * @param factory a factory for an application context (containing jobs) * @return a collection of the jobs created */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java index 67ff995555..cec2c6c996 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java @@ -37,9 +37,9 @@ /** * A {@link BeanPostProcessor} that registers {@link Job} beans with a - * {@link JobRegistry}. Include a bean of this type along with your job configuration, and - * use the same {@link JobRegistry} as a {@link JobLocator} when you need to locate a - * {@link Job} to launch. + * {@link JobRegistry}. Include a bean of this type along with your job + * configuration and use the same {@link JobRegistry} as a {@link JobLocator} + * when you need to locate a {@link Job} to launch. * * @author Dave Syer * @@ -118,7 +118,7 @@ public void destroy() throws Exception { } /** - * If the bean is an instance of {@link Job} then register it. + * If the bean is an instance of {@link Job}, then register it. * @throws FatalBeanException if there is a {@link DuplicateJobException}. * * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, @@ -151,9 +151,10 @@ public Object postProcessAfterInitialization(Object bean, String beanName) throw } /** - * Determine a group name for the job to be registered. Default implementation just - * returns the {@link #setGroupName(String) groupName} configured. Provides an - * extension point for specialised subclasses. + * Determine a group name for the job to be registered. The default + * implementation returns the {@link #setGroupName(String) groupName} + * configured. Provides an extension point for specialised subclasses. + * * @param beanDefinition the bean definition for the job * @param job the job * @return a group name for the job (or null if not needed) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java index 262c6b9e74..a0ef190898 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java @@ -30,7 +30,7 @@ /** * Simple map-based implementation of {@link StepRegistry}. Access to the map is - * synchronized, guarded by an internal lock. + * synchronized and guarded by an internal lock. * * @author Sebastien Gerard * @author Stephane Nicoll diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java index bb8fda56ad..d0c8b556f3 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java @@ -19,8 +19,8 @@ import org.springframework.batch.core.configuration.JobFactory; /** - * A {@link JobFactory} that just keeps a reference to a {@link Job}. It never modifies - * its {@link Job}. + * A {@link JobFactory} that keeps a reference to a {@link Job}. It never + * modifies its {@link Job}. * * @author Dave Syer * @@ -37,7 +37,7 @@ public ReferenceJobFactory(Job job) { } /** - * Just return the instance passed in on initialization. + * Return the instance that was passed in on initialization. * * @see JobFactory#createJob() */ @@ -47,7 +47,7 @@ public final Job createJob() { } /** - * Just return the name of instance passed in on initialization. + * Return the name of the instance that was passed in on initialization. * * @see JobFactory#getJobName() */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java index 90283ce9d8..8862b1e146 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractFlowParser.java @@ -151,6 +151,8 @@ protected Class getBeanClass(Element element) { } /** + * Performs the parsing for a flow definition. + * * @param element the top level element containing a flow definition * @param parserContext the {@link ParserContext} */ @@ -249,11 +251,11 @@ private Set findReachableElements(Element element) { } /** - * Find all of the elements reachable from the startElement. - * @param startElement name of the element to start from - * @param reachableElementMap Map of elements that can be reached from the - * startElement - * @param accumulator a collection of reachable element names + * Find all of the elements that are reachable from the {@code startElement}. + * + * @param startElement Name of the element to start from + * @param reachableElementMap Map of elements that can be reached from the startElement + * @param accumulator A collection of reachable element names */ protected void findAllReachableElements(String startElement, Map> reachableElementMap, Set accumulator) { @@ -270,9 +272,9 @@ protected void findAllReachableElements(String startElement, Map getNextElements(ParserContext parserCon } /** - * @param parserContext the parser context for the bean factory - * @param stepId the id of the current state if it is a step state, null otherwise + * Retrieve a list of {@link StateTransition} instances from a {@link ParserContext}. + * + * @param parserContext The parser context for the bean factory + * @param stepId The ID of the current state if it is a step state, null + * otherwise * @param stateDef The bean definition for the current state - * @param element the <step/gt; element to parse + * @param element The <step/gt; element to parse * @return a collection of * {@link org.springframework.batch.core.job.flow.support.StateTransition} references */ @@ -330,10 +335,12 @@ else if (hasNextAttribute) { } /** + * Verifies that {@code transitionElement} is not in the list of state transition patterns. + * * @param transitionElement The element to parse - * @param patterns a list of patterns on state transitions for this element - * @param element {@link Element} representing the source. - * @param parserContext the parser context for the bean factory + * @param patterns A list of patterns on state transitions for this element + * @param element The {@link Element} representing the source. + * @param parserContext The parser context for the bean factory */ protected static void verifyUniquePattern(Element transitionElement, List patterns, Element element, ParserContext parserContext) { @@ -348,7 +355,7 @@ protected static void verifyUniquePattern(Element transitionElement, List parseTransitionElement(Element transit * @param exitCode The exit code that this transition will set. Use null to default to * batchStatus. * @param stateDef The bean definition for the current state - * @param parserContext the parser context for the bean factory - * @param abandon the abandon flag to be used by the transition. + * @param parserContext The parser context for the bean factory + * @param abandon The {@code abandon} flag to be used by the transition. * @return a collection of * {@link org.springframework.batch.core.job.flow.support.StateTransition} references */ @@ -425,8 +432,10 @@ protected static Collection createTransition(FlowExecutionStatus } /** + * Gets the batch status from the end transition name by the element. + * * @param elementName An end transition element name - * @return the BatchStatus corresponding to the transition name + * @return the {@link BatchStatus} corresponding to the transition name. */ protected static FlowExecutionStatus getBatchStatusFromEndTransitionName(String elementName) { elementName = stripNamespace(elementName); @@ -445,7 +454,7 @@ else if (FAIL_ELE.equals(elementName)) { } /** - * Strip the namespace from the element name if it exists. + * Strip the namespace from the element name, if it exists. */ private static String stripNamespace(String elementName) { if (elementName.startsWith("batch:")) { @@ -457,10 +466,12 @@ private static String stripNamespace(String elementName) { } /** - * @param parserContext the parser context - * @param stateDefinition a reference to the state implementation - * @param on the pattern value - * @param next the next step id + * Gets a reference to the state transition. + * + * @param parserContext The parser context + * @param stateDefinition A reference to the state implementation + * @param on The pattern value + * @param next The next step id * @return a bean definition for a * {@link org.springframework.batch.core.job.flow.support.StateTransition} */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java index 8b6e93c11d..340d54328f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractListenerParser.java @@ -135,12 +135,15 @@ private List getMethodNameAttributes() { } /** - * @return The {@link Class} for the implementation of - * {@link AbstractListenerFactoryBean}. + * Gets the bean class. + * + * @return The {@link Class} for the implementation of {@link AbstractListenerFactoryBean}. */ protected abstract Class> getBeanClass(); /** + * Gets the metadata values. + * * @return The array of {@link ListenerMetaData}. */ protected abstract ListenerMetaData[] getMetaDataValues(); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java index 95988cf7de..8e50a4867d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkElementParser.java @@ -68,11 +68,13 @@ public class ChunkElementParser { StepListenerMetaData.itemListenerMetaData()); /** - * @param bd {@link AbstractBeanDefinition} instance of the containing bean. - * @param element the element to parse - * @param parserContext the context to use - * @param underspecified if true, a fatal error will not be raised if attribute or - * element is missing. + * Do the parsing. + * + * @param bd An {@link AbstractBeanDefinition} instance of the containing bean. + * @param element The element to parse + * @param parserContext The context to use + * @param underspecified If true, a fatal error is not raised if the attribute + * or the element is missing. */ protected void parse(Element element, AbstractBeanDefinition bd, ParserContext parserContext, boolean underspecified) { @@ -203,7 +205,7 @@ protected void parse(Element element, AbstractBeanDefinition bd, ParserContext p } /** - * Handle the ItemReader, ItemProcessor, and ItemWriter attributes/elements. + * Handle the ItemReader, ItemProcessor, and ItemWriter attributes and elements. */ private void handleItemHandler(AbstractBeanDefinition enclosing, String handlerName, String propertyName, String adapterClassName, boolean required, Element element, ParserContext parserContext, @@ -264,7 +266,8 @@ else if (refElements.size() == 1) { } /** - * Handle the adapter-method attribute by using an AbstractMethodInvokingDelegator + * Handle the adapter method attribute by using an + * {@link AbstractMethodInvokingDelegator}. */ private void handleAdapterMethodAttribute(String propertyName, String adapterClassName, MutablePropertyValues stepPvs, Element element) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java index 9705c9afc1..907edc781f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceUtils.java @@ -32,7 +32,7 @@ import java.util.Map; /** - * Utility methods used in parsing of the batch core namespace + * Utility methods used in parsing of the batch core namespace. * * @author Thomas Risberg * @author Michael Minella @@ -101,7 +101,8 @@ private static void checkForScope(ParserContext parserContext, Object source, St } /** - * Register a {@link Comparator} to be used to sort {@link StateTransition}s + * Register a {@link Comparator} to be used to sort {@link StateTransition} objects. + * * @param parserContext */ private static void addStateTransitionComparator(ParserContext parserContext) { @@ -119,7 +120,8 @@ private static boolean stateTransitionComparatorAlreadyDefined(BeanDefinitionReg } /** - * Register a RangePropertyEditor if one does not already exist. + * Register a {@code RangePropertyEditor}, if one does not already exist. + * * @param parserContext */ private static void addRangePropertyEditor(ParserContext parserContext) { @@ -160,6 +162,8 @@ else if (entry.getKey() instanceof String) { } /** + * Add a core name postprocessor. + * * @param parserContext */ private static void addCoreNamespacePostProcessor(ParserContext parserContext) { @@ -183,18 +187,19 @@ private static boolean coreNamespaceBeanPostProcessorAlreadyDefined(BeanDefiniti } /** - * Should this element be treated as incomplete? If it has a parent or is abstract, - * then it may not have all properties. + * Should this element be treated as incomplete? If it has a parent or is + * abstract, it may not have all properties. + * * @param element to be evaluated. - * @return TRUE if the element is abstract or has a parent + * @return {@code true} if the element is abstract or has a parent. */ public static boolean isUnderspecified(Element element) { return isAbstract(element) || StringUtils.hasText(element.getAttribute("parent")); } /** - * @param element to be evaluated. - * @return TRUE if the element is abstract + * @param element The element to be evaluated. + * @return {@code true} if the element is abstract. */ public static boolean isAbstract(Element element) { String abstractAttr = element.getAttribute("abstract"); @@ -202,13 +207,11 @@ public static boolean isAbstract(Element element) { } /** - * Check that the schema location declared in the source file being parsed matches the - * Spring Batch version. (The old 2.0 schema is not 100% compatible with the new - * parser, so it is an error to explicitly define 2.0. It might be an error to declare - * spring-batch.xsd as an alias, but you are only going to find that out when one of - * the sub parses breaks.) - * @param element the element that is to be parsed next - * @return true if we find a schema declaration that matches + * Check that the schema location declared in the source file being parsed + * matches the Spring Batch version. + * + * @param element The element that is to be parsed next. + * @return {@code true} if we find a schema declaration that matches. */ public static boolean namespaceMatchesVersion(Element element) { return matchesVersionInternal(element) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java index 1a524b367f..ee5b895358 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowElementParser.java @@ -29,6 +29,7 @@ * Internal parser for the <flow/> elements inside a job. * * @see JobParser + * * @author Dave Syer * */ @@ -40,11 +41,12 @@ public class FlowElementParser { /** * Parse the flow and turn it into a list of transitions. - * @param element the <flow/gt; element to parse - * @param parserContext the parser context for the bean factory + * + * @param element The <flow/gt; element to parse. + * @param parserContext The parser context for the bean factory. * @return a collection of bean definitions for - * {@link org.springframework.batch.core.job.flow.support.StateTransition} instances - * objects + * {@link org.springframework.batch.core.job.flow.support.StateTransition} + * instances objects. */ public Collection parse(Element element, ParserContext parserContext) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java index 6a91579605..6e5fd275eb 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineFlowParser.java @@ -32,11 +32,12 @@ public class InlineFlowParser extends AbstractFlowParser { private final String flowName; /** - * Construct a {@link InlineFlowParser} with the specified name and using the provided - * job repository ref. - * @param flowName the name of the flow - * @param jobFactoryRef the reference to the {@link JobParserJobFactoryBean} from the - * enclosing tag + * Construct a {@link InlineFlowParser} with the specified name and using the + * provided job repository reference. + * + * @param flowName The name of the flow. + * @param jobFactoryRef The reference to the {@link JobParserJobFactoryBean} + * from the enclosing tag. */ public InlineFlowParser(String flowName, String jobFactoryRef) { this.flowName = flowName; @@ -50,8 +51,10 @@ protected boolean shouldGenerateId() { } /** - * @param element the top level element containing a flow definition - * @param parserContext the {@link ParserContext} + * Does the parsing. + * + * @param element The top level element containing a flow definition. + * @param parserContext The {@link ParserContext}. */ @Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java index f342c1af1d..171a6c1b96 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java @@ -40,13 +40,14 @@ public class InlineStepParser extends AbstractStepParser { /** * Parse the step and turn it into a list of transitions. - * @param element the <step/gt; element to parse - * @param parserContext the parser context for the bean factory - * @param jobFactoryRef the reference to the {@link JobParserJobFactoryBean} from the - * enclosing tag + * + * @param element The <step/gt; element to parse. + * @param parserContext The parser context for the bean factory. + * @param jobFactoryRef The reference to the {@link JobParserJobFactoryBean} + * from the enclosing tag. * @return a collection of bean definitions for - * {@link org.springframework.batch.core.job.flow.support.StateTransition} instances - * objects + * {@link org.springframework.batch.core.job.flow.support.StateTransition} + * instances objects. */ public Collection parse(Element element, ParserContext parserContext, String jobFactoryRef) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java index 56300a7427..8e7e825f9b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java @@ -22,8 +22,8 @@ import org.springframework.batch.core.listener.ListenerMetaData; /** - * Parser for a step listener element. Builds a {@link JobListenerFactoryBean} using - * attributes from the configuration. + * Parser for a step listener element. Builds a {@link JobListenerFactoryBean} + * by using attributes from the configuration. * * @author Dan Garrette * @since 2.0 diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java index 0a75ac4d60..d7ff6d8d74 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java @@ -155,7 +155,7 @@ else if (listenersElements.size() > 1) { * Parse the element to retrieve {@link BeanMetadataElement}. * @param element The {@link Element} to be parsed. * @param parserContext The {@link ParserContext}. - * @return The {@link BeanMetadataElement} extracted from the element parameter. + * @return the {@link BeanMetadataElement} extracted from the element parameter. */ public BeanMetadataElement parseBeanElement(Element element, ParserContext parserContext) { String refAttribute = element.getAttribute(REF_ATTR); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java index 52723b9521..9e4ce318f4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java @@ -35,10 +35,10 @@ import org.springframework.util.Assert; /** - * Convenience factory for SimpleFlow instances for use in XML namespace. It replaces the - * states in the input with proxies that have a unique name formed from the flow name and - * the original state name (unless the name is already in that form, in which case it is - * not modified). + * Convenience factory for {@link SimpleFlow} instances for use in the XML namespace. It + * replaces the states in the input with proxies that have a unique name formed + * from the flow name and the original state name (unless the name is already in + * that form -- in that case, it is not modified). * * @author Dave Syer * @author Michael Minella @@ -57,14 +57,14 @@ public class SimpleFlowFactoryBean implements FactoryBean, Initializ /** * @param stateTransitionComparator {@link Comparator} implementation that addresses - * the ordering of state evaluation + * the ordering of state evaluation. */ public void setStateTransitionComparator(Comparator stateTransitionComparator) { this.stateTransitionComparator = stateTransitionComparator; } /** - * @param flowType Used to inject the type of flow (regular Spring Batch or JSR-352) + * @param flowType Used to inject the type of flow (regular Spring Batch or JSR-352). */ public void setFlowType(Class flowType) { this.flowType = flowType; @@ -80,8 +80,10 @@ public void setName(String name) { } /** - * The raw state transitions for the flow. They will be transformed into proxies that - * have the same behavior but unique names prefixed with the flow name. + * The raw state transitions for the flow. They are transformed into + * proxies that have the same behavior but unique names prefixed with the + * flow name. + * * @param stateTransitions the list of transitions */ public void setStateTransitions(List stateTransitions) { @@ -133,9 +135,10 @@ private String getNext(String next) { } /** - * Convenience method to get a state that proxies the input but with a different name, - * appropriate to this flow. If the state is a StepState then the step name is also - * changed. + * Convenience method to get a state that proxies the input but with a + * different name, appropriate to this flow. If the state is a {@link StepState}, + * the step name is also changed. + * * @param state * @return */ @@ -153,11 +156,12 @@ private State getProxyState(State state) { /** * Provides an extension point to provide alternative {@link StepState} - * implementations within a {@link SimpleFlow} - * @param state The state that will be used to create the StepState - * @param oldName The name to be replaced - * @param stateName The name for the new State - * @return a state for the requested data + * implementations within a {@link SimpleFlow}. + * + * @param state The state that is used to create the {@code StepState}. + * @param oldName The name to be replaced. + * @param stateName The name for the new State. + * @return a state for the requested data. */ protected State createNewStepState(State state, String oldName, String stateName) { return new StepState(stateName, ((StepState) state).getStep(oldName)); @@ -190,6 +194,8 @@ private DelegateState(String name, State state) { } /** + * Gets the current state. + * * @return The {@link State} being used by the factory bean. */ public State getState() { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java index 7684f9d9b8..2f83ca070f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SplitParser.java @@ -48,9 +48,11 @@ public class SplitParser { private final String jobFactoryRef; /** - * Construct a {@link InlineFlowParser} using the provided job repository ref. - * @param jobFactoryRef the reference to the {@link JobParserJobFactoryBean} from the - * enclosing tag + * Construct a {@link InlineFlowParser} by using the provided job repository + * reference. + * + * @param jobFactoryRef The reference to the {@link JobParserJobFactoryBean} + * from the enclosing tag. */ public SplitParser(String jobFactoryRef) { this.jobFactoryRef = jobFactoryRef; @@ -58,8 +60,9 @@ public SplitParser(String jobFactoryRef) { /** * Parse the split and turn it into a list of transitions. - * @param element the <split/gt; element to parse - * @param parserContext the parser context for the bean factory + * + * @param element The <split/gt; element to parse + * @param parserContext The parser context for the bean factory * @return a collection of bean definitions for * {@link org.springframework.batch.core.job.flow.support.StateTransition} instances * objects diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java index 90517d6bf1..b8f1840787 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java @@ -31,9 +31,10 @@ public class StandaloneStepParser extends AbstractStepParser { /** * Parse the step and turn it into a list of transitions. - * @param element the <step/gt; element to parse - * @param parserContext the parser context for the bean factory - * @return {@link AbstractBeanDefinition} instance. + * + * @param element The <step/gt; element to parse + * @param parserContext The parser context for the bean factory + * @return an {@link AbstractBeanDefinition} instance. */ public AbstractBeanDefinition parse(Element element, ParserContext parserContext) { return parseStep(element, parserContext, null); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java index 6ba064cd55..f058959bcd 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java @@ -77,11 +77,9 @@ import org.springframework.util.Assert; /** - * This {@link FactoryBean} is used by the batch namespace parser to create {@link Step} - * objects. Stores all of the properties that are configurable on the <step/> (and - * its inner <tasklet/>). Based on which properties are configured, the - * {@link #getObject()} method will delegate to the appropriate class for generating the - * {@link Step}. + * This {@link FactoryBean} is used by the batch namespace parser to create {@link Step} objects. It stores all of the + * properties that are configurable on the <step/> (and its inner <tasklet/>). Based on which properties are + * configured, the {@link #getObject()} method delegates to the appropriate class for generating the {@link Step}. * * @author Dan Garrette * @author Josh Long @@ -252,6 +250,10 @@ else if (job != null) { } } + /** + * Currently, all step implementations other than {@link TaskletStep} are + * instances of {@link AbstractStep} and do not require a transaction manager. + */ public boolean requiresTransactionManager() { // Currently all step implementations other than TaskletStep are // AbstractStep and do not require a transaction manager @@ -259,6 +261,8 @@ public boolean requiresTransactionManager() { } /** + * Enhances a step with attributes from the provided {@link StepBuilderHelper}. + * * @param builder {@link StepBuilderHelper} representing the step to be enhanced */ protected void enhanceCommonStep(StepBuilderHelper builder) { @@ -279,7 +283,8 @@ protected void enhanceCommonStep(StepBuilderHelper builder) { /** * Create a partition {@link Step}. - * @return The {@link Step}. + * + * @return the {@link Step}. */ protected Step createPartitionStep() { @@ -308,7 +313,8 @@ protected Step createPartitionStep() { /** * Creates a fault tolerant {@link Step}. - * @return The {@link Step}. + * + * @return the {@link Step}. */ protected Step createFaultTolerantStep() { @@ -393,7 +399,7 @@ else if (skipLimit != null) { /** * Creates a new {@link FaultTolerantStepBuilder}. * @param stepName The name of the step used by the created builder. - * @return The {@link FaultTolerantStepBuilder}. + * @return the {@link FaultTolerantStepBuilder}. */ protected FaultTolerantStepBuilder getFaultTolerantStepBuilder(String stepName) { return new FaultTolerantStepBuilder<>(new StepBuilder(stepName)); @@ -413,7 +419,8 @@ protected void registerItemListeners(SimpleStepBuilder builder) { /** * Creates a new {@link TaskletStep}. - * @return The {@link TaskletStep}. + * + * @return the {@link TaskletStep}. */ protected Step createSimpleStep() { SimpleStepBuilder builder = getSimpleStepBuilder(name); @@ -444,6 +451,8 @@ protected SimpleStepBuilder getSimpleStepBuilder(String stepName) { } /** + * Create a new {@link TaskletStep}. + * * @return a new {@link TaskletStep} */ protected TaskletStep createTaskletStep() { @@ -502,7 +511,8 @@ public boolean rollbackOn(Throwable ex) { /** * Create a new {@link org.springframework.batch.core.job.flow.FlowStep}. - * @return The {@link org.springframework.batch.core.job.flow.FlowStep}. + * + * @return the {@link org.springframework.batch.core.job.flow.FlowStep}. */ protected Step createFlowStep() { FlowStepBuilder builder = new StepBuilder(name).flow(flow); @@ -521,7 +531,7 @@ private Step createJobStep() throws Exception { } /** - * Validates that all components required to build a fault tolerant step are set + * Validates that all components required to build a fault tolerant step are set. */ protected void validateFaultTolerantSettings() { validateDependency("skippable-exception-classes", skippableExceptionClasses, "skip-limit", skipLimit, true); @@ -535,16 +545,15 @@ protected void validateFaultTolerantSettings() { } /** - * Check if a field is present then a second is also. If the twoWayDependency flag is - * set then the opposite must also be true: if the second value is present, the first - * must also be. - * @param dependentName the name of the first field - * @param dependentValue the value of the first field - * @param name the name of the other field (which should be absent if the first is - * present) - * @param value the value of the other field - * @param twoWayDependency true if both depend on each other - * @throws IllegalArgumentException if either condition is violated + * Check that, if a field is present, then a second field is also present. If the {@code twoWayDependency} flag is set, the opposite must + * also be true: if the second value is present, the first value must also be present. + * + * @param dependentName The name of the first field. + * @param dependentValue The value of the first field. + * @param name The name of the other field (which should be absent if the first is present). + * @param value The value of the other field. + * @param twoWayDependency Set to {@code true} if both depend on each other. + * @throws an IllegalArgumentException if either condition is violated */ private void validateDependency(String dependentName, Object dependentValue, String name, Object value, boolean twoWayDependency) { @@ -560,8 +569,9 @@ private void validateDependency(String dependentName, Object dependentValue, Str /** * Is the object non-null (or if an Integer, non-zero)? - * @param o an object - * @return true if the object has a value + * + * @param o An object + * @return {@code true} if the object has a value */ private boolean isPresent(Object o) { if (o instanceof Integer) { @@ -577,8 +587,9 @@ private boolean isPresent(Object o) { } /** - * @return true if the step is configured with any components that require fault - * tolerance + * Indicates whether the step has any components that require fault tolerance. + * + * @return {@code true} if the step is configured with any components that require fault tolerance. */ protected boolean isFaultTolerant() { return backOffPolicy != null || skipPolicy != null || retryPolicy != null || isPositive(skipLimit) @@ -677,21 +688,21 @@ public void setStepExecutionAggregator(StepExecutionAggregator stepExecutionAggr } /** - * @return stepExecutionAggregator the current step's {@link StepExecutionAggregator} + * @return The current step's {@link StepExecutionAggregator} */ protected StepExecutionAggregator getStepExecutionAggergator() { return this.stepExecutionAggregator; } /** - * @param partitionHandler the partitionHandler to set + * @param partitionHandler The partitionHandler to set */ public void setPartitionHandler(PartitionHandler partitionHandler) { this.partitionHandler = partitionHandler; } /** - * @return partitionHandler the current step's {@link PartitionHandler} + * @return The current step's {@link PartitionHandler} */ protected PartitionHandler getPartitionHandler() { return this.partitionHandler; @@ -726,7 +737,7 @@ public void setAllowStartIfComplete(boolean allowStartIfComplete) { } /** - * @return jobRepository + * @return The jobRepository */ public JobRepository getJobRepository() { return jobRepository; @@ -741,9 +752,9 @@ public void setJobRepository(JobRepository jobRepository) { } /** - * The number of times that the step should be allowed to start - * @param startLimit int containing the number of times a step should be allowed to - * start. + * The number of times that the step should be allowed to start. + * + * @param startLimit int containing the number of times a step should be allowed to start. */ public void setStartLimit(int startLimit) { this.startLimit = startLimit; @@ -762,8 +773,8 @@ protected Tasklet getTasklet() { } /** - * @return transactionManager instance of {@link PlatformTransactionManager} used by - * the step. + * @return An instance of {@link PlatformTransactionManager} + * used by the step. */ public PlatformTransactionManager getTransactionManager() { return transactionManager; @@ -781,9 +792,10 @@ public void setTransactionManager(PlatformTransactionManager transactionManager) // ========================================================= /** - * The listeners to inject into the {@link Step}. Any instance of {@link StepListener} - * can be used, and will then receive callbacks at the appropriate stage in the step. - * @param listeners an array of listeners + * The listeners to inject into the {@link Step}. Any instance of {@link StepListener} can be used and then + * receives callbacks at the appropriate stage in the step. + * + * @param listeners An array of listeners */ @SuppressWarnings("unchecked") public void setListeners(Object[] listeners) { @@ -817,28 +829,29 @@ public void setListeners(Object[] listeners) { /** * Exception classes that may not cause a rollback if encountered in the right place. - * @param noRollbackExceptionClasses the noRollbackExceptionClasses to set + * + * @param noRollbackExceptionClasses The noRollbackExceptionClasses to set */ public void setNoRollbackExceptionClasses(Collection> noRollbackExceptionClasses) { this.noRollbackExceptionClasses = noRollbackExceptionClasses; } /** - * @param transactionTimeout the transactionTimeout to set + * @param transactionTimeout The transactionTimeout to set */ public void setTransactionTimeout(int transactionTimeout) { this.transactionTimeout = transactionTimeout; } /** - * @param isolation the isolation to set + * @param isolation The isolation to set */ public void setIsolation(Isolation isolation) { this.isolation = isolation; } /** - * @param propagation the propagation to set + * @param propagation The propagation to set */ public void setPropagation(Propagation propagation) { this.propagation = propagation; @@ -849,8 +862,9 @@ public void setPropagation(Propagation propagation) { // ========================================================= /** - * A backoff policy to be applied to retry process. - * @param backOffPolicy the {@link BackOffPolicy} to set + * A backoff policy to be applied to the retry process. + * + * @param backOffPolicy The {@link BackOffPolicy} to set */ public void setBackOffPolicy(BackOffPolicy backOffPolicy) { this.backOffPolicy = backOffPolicy; @@ -866,15 +880,16 @@ public void setRetryPolicy(RetryPolicy retryPolicy) { } /** - * @param retryContextCache the {@link RetryContextCache} to set + * @param retryContextCache The {@link RetryContextCache} to set */ public void setRetryContextCache(RetryContextCache retryContextCache) { this.retryContextCache = retryContextCache; } /** - * A key generator that can be used to compare items with previously recorded items in - * a retry. Only used if the reader is a transactional queue. + * A key generator that can be used to compare items with previously recorded items in a retry. Used only if the + * reader is a transactional queue. + * * @param keyGenerator the {@link KeyGenerator} to set */ public void setKeyGenerator(KeyGenerator keyGenerator) { @@ -886,33 +901,36 @@ public void setKeyGenerator(KeyGenerator keyGenerator) { // ========================================================= /** - * Public setter for the capacity of the cache in the retry policy. If more items than - * this fail without being skipped or recovered an exception will be thrown. This is - * to guard against inadvertent infinite loops generated by item identity - * problems.
+ * + * Public setter for the capacity of the cache in the retry policy. + * If there are more items than the specified capacity, the the step fails without being skipped or recovered, + * and an exception is thrown. This guards against inadvertent infinite loops generated + * by item identity problems.
*
- * The default value should be high enough and more for most purposes. To breach the - * limit in a single-threaded step typically you have to have this many failures in a - * single transaction. Defaults to the value in the {@link MapRetryContextCache}.
- * @param cacheCapacity the cache capacity to set (greater than 0 else ignored) + * The default value should be high enough for most purposes. To breach the limit in a single-threaded step, + * you typically have to have this many failures in a single transaction. Defaults to the value in the + * {@link MapRetryContextCache}.
+ * + * @param cacheCapacity The cache capacity to set (greater than 0 else ignored) */ public void setCacheCapacity(int cacheCapacity) { this.cacheCapacity = cacheCapacity; } /** - * Public setter for the {@link CompletionPolicy} applying to the chunk level. A - * transaction will be committed when this policy decides to complete. Defaults to a - * {@link SimpleCompletionPolicy} with chunk size equal to the commitInterval - * property. - * @param chunkCompletionPolicy the chunkCompletionPolicy to set + * Public setter for the {@link CompletionPolicy} that applies to the chunk level. A transaction is committed when + * this policy decides to complete. Defaults to a {@link SimpleCompletionPolicy} with chunk size equal to the + * {@code commitInterval} property. + * + * @param chunkCompletionPolicy The {@code chunkCompletionPolicy} to set. */ public void setChunkCompletionPolicy(CompletionPolicy chunkCompletionPolicy) { this.chunkCompletionPolicy = chunkCompletionPolicy; } /** - * Set the commit interval. Either set this or the chunkCompletionPolicy but not both. + * Set the commit interval. Set either this or the {@code chunkCompletionPolicy} but not both. + * * @param commitInterval 1 by default */ public void setCommitInterval(int commitInterval) { @@ -927,9 +945,9 @@ protected Integer getCommitInterval() { } /** - * Flag to signal that the reader is transactional (usually a JMS consumer) so that - * items are re-presented after a rollback. The default is false and readers are - * assumed to be forward-only. + * Flag to signal that the reader is transactional (usually a JMS consumer) so that items are re-presented after a + * rollback. The default is {@code false}, and readers are assumed to be forward-only. + * * @param isReaderTransactionalQueue the value of the flag */ public void setIsReaderTransactionalQueue(boolean isReaderTransactionalQueue) { @@ -937,9 +955,9 @@ public void setIsReaderTransactionalQueue(boolean isReaderTransactionalQueue) { } /** - * Flag to signal that the processor is transactional, in which case it should be - * called for every item in every transaction. If false then we can cache the - * processor results between transactions in the case of a rollback. + * Flag to signal that the processor is transactional -- in that case, it should be called for every item in every + * transaction. If {@code false}, we can cache the processor results between transactions in the case of a rollback. + * * @param processorTransactional the value to set */ public void setProcessorTransactional(Boolean processorTransactional) { @@ -947,70 +965,71 @@ public void setProcessorTransactional(Boolean processorTransactional) { } /** - * Public setter for the retry limit. Each item can be retried up to this limit. Note - * this limit includes the initial attempt to process the item, therefore - * retryLimit == 1 by default. - * @param retryLimit the retry limit to set, must be greater or equal to 1. + * Public setter for the retry limit. Each item can be retried up to this limit. Note that this limit includes the + * initial attempt to process the item. Therefore, by default, retryLimit == 1. + * + * @param retryLimit The retry limit to set. Must be greater than or equal to 1. */ public void setRetryLimit(int retryLimit) { this.retryLimit = retryLimit; } /** - * Public setter for a limit that determines skip policy. If this value is positive - * then an exception in chunk processing will cause the item to be skipped and no - * exception propagated until the limit is reached. If it is zero then all exceptions - * will be propagated from the chunk and cause the step to abort. - * @param skipLimit the value to set. Default is 0 (never skip). + * Public setter for a limit that determines skip policy. If this value is positive, an exception in chunk + * processing causes the item to be skipped and no exception to be propagated until the limit is reached. If it is + * zero, all exceptions are propagated from the chunk and cause the step to abort. + * + * @param skipLimit The value to set. The default is 0 (never skip). */ public void setSkipLimit(int skipLimit) { this.skipLimit = skipLimit; } /** - * Public setter for a skip policy. If this value is set then the skip limit and - * skippable exceptions are ignored. - * @param skipPolicy the {@link SkipPolicy} to set + * Public setter for a skip policy. If this value is set, the skip limit and skippable exceptions are ignored. + * + * @param skipPolicy The {@link SkipPolicy} to set. */ public void setSkipPolicy(SkipPolicy skipPolicy) { this.skipPolicy = skipPolicy; } /** - * Public setter for the {@link TaskExecutor}. If this is set, then it will be used to - * execute the chunk processing inside the {@link Step}. - * @param taskExecutor the taskExecutor to set + * Public setter for the {@link TaskExecutor}. If this is set, it is used to execute the chunk processing + * inside the {@link Step}. + * + * @param taskExecutor The taskExecutor to set. */ public void setTaskExecutor(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } /** - * Public setter for the throttle limit. This limits the number of tasks queued for - * concurrent processing to prevent thread pools from being overwhelmed. Defaults to - * {@link TaskExecutorRepeatTemplate#DEFAULT_THROTTLE_LIMIT}. - * @param throttleLimit the throttle limit to set. + * Public setter for the throttle limit. This limits the number of tasks queued for concurrent processing to prevent + * thread pools from being overwhelmed. Defaults to {@link TaskExecutorRepeatTemplate#DEFAULT_THROTTLE_LIMIT}. + * + * @param throttleLimit The throttle limit to set. */ public void setThrottleLimit(Integer throttleLimit) { this.throttleLimit = throttleLimit; } /** - * @param itemReader the {@link ItemReader} to set + * @param itemReader The {@link ItemReader} to set. */ public void setItemReader(ItemReader itemReader) { this.itemReader = itemReader; } /** - * @param itemProcessor the {@link ItemProcessor} to set + * @param itemProcessor The {@link ItemProcessor} to set. */ public void setItemProcessor(ItemProcessor itemProcessor) { this.itemProcessor = itemProcessor; } /** - * @param itemWriter the {@link ItemWriter} to set + * @param itemWriter The {@link ItemWriter} to set. */ public void setItemWriter(ItemWriter itemWriter) { this.itemWriter = itemWriter; @@ -1021,35 +1040,38 @@ public void setItemWriter(ItemWriter itemWriter) { // ========================================================= /** - * Public setter for the {@link RetryListener}s. - * @param retryListeners the {@link RetryListener}s to set + * Public setter for the {@link RetryListener} instances. + * + * @param retryListeners The {@link RetryListener} instances to set. */ public void setRetryListeners(RetryListener... retryListeners) { this.retryListeners = retryListeners; } /** - * Public setter for exception classes that when raised won't crash the job but will - * result in transaction rollback and the item which handling caused the exception - * will be skipped. - * @param exceptionClasses {@link Map} containing the {@link Throwable}s as the keys - * and the values are {@link Boolean}s, that if true the item is skipped. + * Public setter for exception classes that, when raised, do not crash the job but result in transaction rollback. + * The item for which handling caused the exception is skipped. + * + * @param exceptionClasses A {@link Map} containing the {@link Throwable} instances as + * the keys and the {@link Boolean} instances as the values. If {@code true}, the item is skipped. */ public void setSkippableExceptionClasses(Map, Boolean> exceptionClasses) { this.skippableExceptionClasses = exceptionClasses; } /** - * Public setter for exception classes that will retry the item when raised. - * @param retryableExceptionClasses the retryableExceptionClasses to set + * Public setter for exception classes that retries the item when raised. + * + * @param retryableExceptionClasses The retryableExceptionClasses to set. */ public void setRetryableExceptionClasses(Map, Boolean> retryableExceptionClasses) { this.retryableExceptionClasses = retryableExceptionClasses; } /** - * The streams to inject into the {@link Step}. Any instance of {@link ItemStream} can - * be used, and will then receive callbacks at the appropriate stage in the step. + * The streams to inject into the {@link Step}. Any instance of {@link ItemStream} can be used, and it then + * receives callbacks at the appropriate stage in the step. + * * @param streams an array of listeners */ public void setStreams(ItemStream[] streams) { @@ -1061,28 +1083,28 @@ public void setStreams(ItemStream[] streams) { // ========================================================= /** - * @param hasChunkElement true if step has <chunk/> element. + * @param hasChunkElement {@code true} if step has <chunk/> element. */ public void setHasChunkElement(boolean hasChunkElement) { this.hasChunkElement = hasChunkElement; } /** - * @return true if the defined step has a <chunk/> element + * @return {@code true} if the defined step has a <chunk/> element. */ protected boolean hasChunkElement() { return this.hasChunkElement; } /** - * @return true if the defined step has a <tasklet/> element + * @return {@code true} if the defined step has a <tasklet/> element. */ protected boolean hasTasklet() { return this.tasklet != null; } /** - * @return true if the defined step has a <partition/> element + * @return {@code true} if the defined step has a <partition/> element. */ protected boolean hasPartitionElement() { return this.partitionHandler != null; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java index 0ddaa3fb47..7fcd56ff6b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TopLevelFlowParser.java @@ -32,6 +32,8 @@ public class TopLevelFlowParser extends AbstractFlowParser { private static final String ABSTRACT_ATTR = "abstract"; /** + * Parse the flow. + * * @param element the top level element containing a flow definition * @param parserContext the {@link ParserContext} */