Skip to content

Commit e6e21c5

Browse files
Jay Bryantfmbenhassine
Jay Bryant
authored andcommitted
Improve Javadocs
1 parent 3b8b35c commit e6e21c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+379
-353
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/BatchConfigurationException.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2018 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@
1616
package org.springframework.batch.core.configuration;
1717

1818
/**
19-
* Represents an error has occurred in the configuration of base batch infrastructure
20-
* (creation of a {@link org.springframework.batch.core.repository.JobRepository} for
21-
* example.
19+
* Represents that an error has occurred in the configuration of the base batch
20+
* infrastructure (the creation of a
21+
* {@link org.springframework.batch.core.repository.JobRepository}, for example).
2222
*
2323
* @author Michael Minella
2424
* @author Mahmoud Ben Hassine
@@ -29,6 +29,7 @@ public class BatchConfigurationException extends RuntimeException {
2929
private static final long serialVersionUID = 1L;
3030

3131
/**
32+
* Create an exception with the given {@Link Throwable}.
3233
* @param t an exception to be wrapped
3334
*/
3435
public BatchConfigurationException(Throwable t) {

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/DuplicateJobException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2007 the original author or authors.
2+
* Copyright 2006-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ public DuplicateJobException(String msg) {
3636
}
3737

3838
/**
39+
* Create an exception with the given message and the given exception.
3940
* @param msg error message.
4041
* @param e instance of {@link Throwable} that is the cause of the exception.
4142
*/

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface JobFactory {
3232
Job createJob();
3333

3434
/**
35-
* @return The {@link String} containing the {@link Job} name.
35+
* @return The {@link String} that contains the {@link Job} name.
3636
*/
3737
String getJobName();
3838

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/JobRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2007 the original author or authors.
2+
* Copyright 2006-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ public interface JobRegistry extends ListableJobLocator {
3636

3737
/**
3838
* Unregisters a previously registered {@link Job}. If it was not previously
39-
* registered there is no error.
39+
* registered, there is no error.
4040
* @param jobName the {@link Job} to unregister.
4141
*/
4242
void unregister(String jobName);

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/StepRegistry.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222
import java.util.Collection;
2323

2424
/**
25-
* Registry keeping track of all the {@link Step} defined in a
25+
* Registry keeping track of all the {@link Step} instances defined in a
2626
* {@link org.springframework.batch.core.Job}.
2727
*
2828
* @author Sebastien Gerard
@@ -31,9 +31,9 @@
3131
public interface StepRegistry {
3232

3333
/**
34-
* Registers all the step of the given job. If the job is already registered, the
35-
* method {@link #unregisterStepsFromJob(String)} is called before registering the
36-
* given steps.
34+
* Registers all the step instances of the given job. If the job is already
35+
* registered, the method {@link #unregisterStepsFromJob(String)} is called before
36+
* registering the given steps.
3737
* @param jobName the give job name
3838
* @param steps the job steps
3939
* @throws DuplicateJobException if a job with the same job name has already been
@@ -42,8 +42,8 @@ public interface StepRegistry {
4242
void register(String jobName, Collection<Step> steps) throws DuplicateJobException;
4343

4444
/**
45-
* Unregisters all the steps of the given job. If the job is not registered, nothing
46-
* happens.
45+
* Unregisters all the steps instances of the given job. If the job is not registered,
46+
* nothing happens.
4747
* @param jobName the given job name
4848
*/
4949
void unregisterStepsFromJob(String jobName);

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/AbstractBatchConfiguration.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
import org.springframework.transaction.PlatformTransactionManager;
3838

3939
/**
40-
* Base {@code Configuration} class providing common structure for enabling and using
41-
* Spring Batch. Customization is available by implementing the {@link BatchConfigurer}
42-
* interface.
40+
* Base {@code Configuration} class that provides a common structure for enabling and
41+
* using Spring Batch. Customization is available by implementing the
42+
* {@link BatchConfigurer} interface.
4343
*
4444
* @author Dave Syer
4545
* @author Michael Minella
@@ -65,7 +65,7 @@ public abstract class AbstractBatchConfiguration implements InitializingBean {
6565
/**
6666
* Establish the {@link JobBuilderFactory} for the batch execution.
6767
* @return The instance of the {@link JobBuilderFactory}.
68-
* @throws Exception The {@link Exception} thrown if error occurs.
68+
* @throws Exception The {@link Exception} thrown if an error occurs.
6969
*/
7070
@Bean
7171
public JobBuilderFactory jobBuilders() throws Exception {
@@ -75,7 +75,7 @@ public JobBuilderFactory jobBuilders() throws Exception {
7575
/**
7676
* Establish the {@link StepBuilderFactory} for the batch execution.
7777
* @return The instance of the {@link StepBuilderFactory}.
78-
* @throws Exception The {@link Exception} thrown if error occurs.
78+
* @throws Exception The {@link Exception} thrown if an error occurs.
7979
*/
8080
@Bean
8181
public StepBuilderFactory stepBuilders() throws Exception {
@@ -85,31 +85,31 @@ public StepBuilderFactory stepBuilders() throws Exception {
8585
/**
8686
* Establish the {@link JobRepository} for the batch execution.
8787
* @return The instance of the {@link JobRepository}.
88-
* @throws Exception The {@link Exception} thrown if error occurs.
88+
* @throws Exception The {@link Exception} thrown if an error occurs.
8989
*/
9090
@Bean
9191
public abstract JobRepository jobRepository() throws Exception;
9292

9393
/**
9494
* Establish the {@link JobLauncher} for the batch execution.
9595
* @return The instance of the {@link JobLauncher}.
96-
* @throws Exception The {@link Exception} thrown if error occurs.
96+
* @throws Exception The {@link Exception} thrown if an error occurs.
9797
*/
9898
@Bean
9999
public abstract JobLauncher jobLauncher() throws Exception;
100100

101101
/**
102102
* Establish the {@link JobExplorer} for the batch execution.
103103
* @return The instance of the {@link JobExplorer}.
104-
* @throws Exception The {@link Exception} thrown if error occurs.
104+
* @throws Exception The {@link Exception} thrown if an error occurs.
105105
*/
106106
@Bean
107107
public abstract JobExplorer jobExplorer() throws Exception;
108108

109109
/**
110110
* Establish the {@link JobRegistry} for the batch execution.
111111
* @return The instance of the {@link JobRegistry}.
112-
* @throws Exception The {@link Exception} thrown if error occurs.
112+
* @throws Exception The {@link Exception} thrown if an error occurs.
113113
*/
114114
@Bean
115115
public JobRegistry jobRegistry() throws Exception {
@@ -119,7 +119,7 @@ public JobRegistry jobRegistry() throws Exception {
119119
/**
120120
* Establish the {@link PlatformTransactionManager} for the batch execution.
121121
* @return The instance of the {@link PlatformTransactionManager}.
122-
* @throws Exception The {@link Exception} thrown if error occurs.
122+
* @throws Exception The {@link Exception} thrown if an error occurs.
123123
*/
124124
public abstract PlatformTransactionManager transactionManager() throws Exception;
125125

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurationSelector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
2121
import org.springframework.util.Assert;
2222

2323
/**
24-
* Base {@code Configuration} class providing common structure for enabling and using
24+
* Base {@code Configuration} class that provides common structure for enabling and using
2525
* Spring Batch. Customization is available by implementing the {@link BatchConfigurer}
2626
* interface.
2727
*
@@ -50,4 +50,4 @@ public String[] selectImports(AnnotationMetadata importingClassMetadata) {
5050
return imports;
5151
}
5252

53-
}
53+
}

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/BatchConfigurer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import org.springframework.transaction.PlatformTransactionManager;
2222

2323
/**
24-
* Strategy interface for users to provide as a factory for custom components needed by a
25-
* Batch system.
24+
* Strategy interface that users can provide as a factory for custom components needed by
25+
* a Batch system.
2626
*
2727
* @author Dave Syer
2828
*

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ public class DefaultBatchConfigurer implements BatchConfigurer, InitializingBean
4949

5050
/**
5151
* Create a new {@link DefaultBatchConfigurer} with the passed datasource. This
52-
* constructor will configure a default {@link JdbcTransactionManager}.
52+
* constructor configures a default {@link JdbcTransactionManager}.
5353
* @param dataSource to use for the job repository and job explorer
5454
*/
5555
public DefaultBatchConfigurer(DataSource dataSource) {
5656
this(dataSource, new JdbcTransactionManager(dataSource));
5757
}
5858

5959
/**
60-
* Create a new {@link DefaultBatchConfigurer} with the passed datasource and
60+
* Create a new {@link DefaultBatchConfigurer} with the given datasource and
6161
* transaction manager.
62-
* @param dataSource to use for the job repository and job explorer
63-
* @param transactionManager to use for the job repository
62+
* @param dataSource The data source to use for the job repository and job explorer.
63+
* @param transactionManager The transaction manager to use for the job repository.
6464
*/
6565
public DefaultBatchConfigurer(DataSource dataSource, PlatformTransactionManager transactionManager) {
6666
Assert.notNull(dataSource, "DataSource must not be null");

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/EnableBatchProcessing.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
* }
6464
* </pre>
6565
*
66-
* The user should provide a {@link DataSource} as a bean in the context, or else
67-
* implement {@link BatchConfigurer} in the configuration class itself, e.g.
66+
* You should provide a {@link DataSource} as a bean in the context or else implement
67+
* {@link BatchConfigurer} in the configuration class itself -- for example:
6868
*
6969
* <pre class="code">
7070
* &#064;Configuration
@@ -86,16 +86,17 @@
8686
* }
8787
* </pre>
8888
*
89-
* If multiple {@link javax.sql.DataSource}s are defined in the context, the primary
90-
* autowire candidate will be used, otherwise an exception will be thrown.
89+
* If multiple {@link javax.sql.DataSource} instances are defined in the context, the
90+
* primary autowire candidate is used. Otherwise, an exception is thrown.
9191
*
9292
* Note that only one of your configuration classes needs to have the
9393
* <code>&#064;EnableBatchProcessing</code> annotation. Once you have an
94-
* <code>&#064;EnableBatchProcessing</code> class in your configuration you will have an
95-
* instance of {@link StepScope} and {@link org.springframework.batch.core.scope.JobScope}
96-
* so your beans inside steps can have <code>&#064;Scope("step")</code> and
97-
* <code>&#064;Scope("job")</code> respectively. You will also be able to
98-
* <code>&#064;Autowired</code> some useful stuff into your context:
94+
* <code>&#064;EnableBatchProcessing</code> class in your configuration, you have an
95+
* instance of {@link StepScope} and
96+
* {@link org.springframework.batch.core.scope.JobScope}, so your beans inside steps can
97+
* have <code>&#064;Scope("step")</code> and <code>&#064;Scope("job")</code> respectively.
98+
* You can also use <code>&#064;Autowired</code> to insert some useful beans into your
99+
* context:
99100
*
100101
* <ul>
101102
* <li>a {@link JobRepository} (bean name "jobRepository" of type
@@ -108,19 +109,19 @@
108109
* "jobExplorer" of type
109110
* {@link org.springframework.batch.core.explore.support.SimpleJobExplorer})</li>
110111
* <li>a {@link JobBuilderFactory} (bean name "jobBuilders") as a convenience to prevent
111-
* you from having to inject the job repository into every job, as in the examples
112-
* above</li>
112+
* you from having to inject the job repository into every job, as in the earlier
113+
* examples</li>
113114
* <li>a {@link StepBuilderFactory} (bean name "stepBuilders") as a convenience to prevent
114115
* you from having to inject the job repository and transaction manager into every
115116
* step</li>
116117
* </ul>
117118
*
118-
* The transaction manager provided by this annotation will be of type
119-
* {@link org.springframework.jdbc.support.JdbcTransactionManager} configured with the
120-
* {@link javax.sql.DataSource} provided within the context.
119+
* The transaction manager provided by this annotation is of type
120+
* {@link org.springframework.jdbc.support.JdbcTransactionManager} and is configured with
121+
* the {@link javax.sql.DataSource} provided within the context.
121122
*
122-
* In order to use a custom transaction manager, a custom {@link BatchConfigurer} should
123-
* be provided. For example:
123+
* To use a custom transaction manager, you should provide a custom
124+
* {@link BatchConfigurer} -- for example:
124125
*
125126
* <pre class="code">
126127
* &#064;Configuration
@@ -142,14 +143,13 @@
142143
* }
143144
* </pre>
144145
*
145-
* If the configuration is specified as <code>modular=true</code> then the context will
146-
* also contain an {@link AutomaticJobRegistrar}. The job registrar is useful for
147-
* modularizing your configuration if there are multiple jobs. It works by creating
148-
* separate child application contexts containing job configurations and registering those
149-
* jobs. The jobs can then create steps and other dependent components without needing to
150-
* worry about bean definition name clashes. Beans of type
151-
* {@link ApplicationContextFactory} will be registered automatically with the job
152-
* registrar. Example:
146+
* If the configuration is specified as <code>modular=true</code>, the context also
147+
* contains an {@link AutomaticJobRegistrar}. The job registrar is useful for modularizing
148+
* your configuration if there are multiple jobs. It works by creating separate child
149+
* application contexts to contain job configurations and register those jobs. The jobs
150+
* can then create steps and other dependent components without needing to worry about
151+
* bean definition name clashes. Beans of type {@link ApplicationContextFactory} are
152+
* automatically registered with the job registrar. Example:
153153
*
154154
* <pre class="code">
155155
* &#064;Configuration
@@ -171,12 +171,12 @@
171171
* }
172172
* </pre>
173173
*
174-
* Note that a modular parent context in general should <em>not</em> itself contain
174+
* Note that a modular parent context, in general, should <em>not</em> itself contain
175175
* &#64;Bean definitions for job, especially if a {@link BatchConfigurer} is provided,
176-
* because cyclic configuration dependencies are otherwise likely to develop.
176+
* because cyclic configuration dependencies are likely to develop.
177177
*
178178
* <p>
179-
* For reference, the first example above can be compared to the following Spring XML
179+
* For reference, compare the first example shown earlier to the following Spring XML
180180
* configuration:
181181
*
182182
* <pre class="code">
@@ -208,11 +208,11 @@
208208

209209
/**
210210
* Indicate whether the configuration is going to be modularized into multiple
211-
* application contexts. If true then you should not create any &#64;Bean Job
212-
* definitions in this context, but rather supply them in separate (child) contexts
213-
* through an {@link ApplicationContextFactory}.
211+
* application contexts. If true, you should not create any &#64;Bean Job definitions
212+
* in this context but, rather, supply them in separate (child) contexts through an
213+
* {@link ApplicationContextFactory}.
214214
* @return boolean indicating whether the configuration is going to be modularized
215-
* into multiple application contexts. Defaults to false.
215+
* into multiple application contexts. Defaults to {@code false}.
216216
*/
217217
boolean modular() default false;
218218

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/JobBuilderFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.springframework.util.Assert;
2121

2222
/**
23-
* Convenient factory for a {@link JobBuilder} which sets the {@link JobRepository}
23+
* Convenient factory for a {@link JobBuilder} that sets the {@link JobRepository}
2424
* automatically.
2525
*
2626
* @author Dave Syer
@@ -41,8 +41,8 @@ public JobBuilderFactory(JobRepository jobRepository) {
4141
}
4242

4343
/**
44-
* Creates a job builder and initializes its job repository. Note that if the builder
45-
* is used to create a &#64;Bean definition then the name of the job and the bean name
44+
* Creates a job builder and initializes its job repository. Note that, if the builder
45+
* is used to create a &#64;Bean definition, the name of the job and the bean name
4646
* might be different.
4747
* @param name the name of the job
4848
* @return a job builder

0 commit comments

Comments
 (0)