Skip to content

Commit 1af6455

Browse files
Jay Bryantfmbenhassine
Jay Bryant
authored andcommitted
Editing pass
for grammar, spelling, consistency and (most importantly) clarity.
1 parent a393dc5 commit 1af6455

File tree

4 files changed

+89
-81
lines changed

4 files changed

+89
-81
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/explore/JobExplorer.java

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2019 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.
@@ -26,8 +26,8 @@
2626
import org.springframework.lang.Nullable;
2727

2828
/**
29-
* Entry point for browsing executions of running or historical jobs and steps. Since the
30-
* data may be re-hydrated from persistent storage, it may not contain volatile fields
29+
* Entry point for browsing the executions of running or historical jobs and steps. Since
30+
* the data may be re-hydrated from persistent storage, it cannot contain volatile fields
3131
* that would have been present when the execution was active.
3232
*
3333
* @author Dave Syer
@@ -39,19 +39,19 @@
3939
public interface JobExplorer {
4040

4141
/**
42-
* Fetch {@link JobInstance} values in descending order of creation (and therefore
43-
* usually of first execution).
44-
* @param jobName the name of the job to query
45-
* @param start the start index of the instances to return
46-
* @param count the maximum number of instances to return
47-
* @return the {@link JobInstance} values up to a maximum of count values
42+
* Fetch {@link JobInstance} values in descending order of creation (and, therefore,
43+
* usually, of first execution).
44+
* @param jobName The name of the job to query.
45+
* @param start The start index of the instances to return.
46+
* @param count The maximum number of instances to return.
47+
* @return the {@link JobInstance} values up to a maximum of count values.
4848
*/
4949
List<JobInstance> getJobInstances(String jobName, int start, int count);
5050

5151
/**
52-
* Find the last job instance by Id for the given job.
53-
* @param jobName name of the job
54-
* @return the last job instance by Id if any or null otherwise
52+
* Find the last job instance, by ID, for the given job.
53+
* @param jobName The name of the job.
54+
* @return the last job instance by Id if any or {@code null} otherwise.
5555
*
5656
* @since 4.2
5757
*/
@@ -61,52 +61,53 @@ default JobInstance getLastJobInstance(String jobName) {
6161
}
6262

6363
/**
64-
* Retrieve a {@link JobExecution} by its id. The complete object graph for this
65-
* execution should be returned (unless otherwise indicated) including the parent
64+
* Retrieve a {@link JobExecution} by its ID. The complete object graph for this
65+
* execution should be returned (unless otherwise indicated), including the parent
6666
* {@link JobInstance} and associated {@link ExecutionContext} and
6767
* {@link StepExecution} instances (also including their execution contexts).
68-
* @param executionId the job execution id
69-
* @return the {@link JobExecution} with this id, or null if not found
68+
* @param executionId The job execution ID.
69+
* @return the {@link JobExecution} that has this ID or {@code null} if not found.
7070
*/
7171
@Nullable
7272
JobExecution getJobExecution(@Nullable Long executionId);
7373

7474
/**
75-
* Retrieve a {@link StepExecution} by its id and parent {@link JobExecution} id. The
75+
* Retrieve a {@link StepExecution} by its ID and parent {@link JobExecution} ID. The
7676
* execution context for the step should be available in the result, and the parent
77-
* job execution should have its primitive properties, but may not contain the job
77+
* job execution should have its primitive properties, but it may not contain the job
7878
* instance information.
79-
* @param jobExecutionId the parent job execution id
80-
* @param stepExecutionId the step execution id
81-
* @return the {@link StepExecution} with this id, or null if not found
79+
* @param jobExecutionId The parent job execution ID.
80+
* @param stepExecutionId The step execution ID.
81+
* @return the {@link StepExecution} that has this ID or {@code null} if not found.
8282
*
8383
* @see #getJobExecution(Long)
8484
*/
8585
@Nullable
8686
StepExecution getStepExecution(@Nullable Long jobExecutionId, @Nullable Long stepExecutionId);
8787

8888
/**
89-
* @param instanceId {@link Long} id for the jobInstance to obtain.
90-
* @return the {@link JobInstance} with this id, or null
89+
* @param instanceId {@link Long} The ID for the {@link jobInstance} to obtain.
90+
* @return the {@code JobInstance} that has this ID, or {@code null} if not found.
9191
*/
9292
@Nullable
9393
JobInstance getJobInstance(@Nullable Long instanceId);
9494

9595
/**
9696
* Retrieve job executions by their job instance. The corresponding step executions
97-
* may not be fully hydrated (e.g. their execution context may be missing), depending
98-
* on the implementation. Use {@link #getStepExecution(Long, Long)} to hydrate them in
99-
* that case.
100-
* @param jobInstance the {@link JobInstance} to query
101-
* @return the set of all executions for the specified {@link JobInstance}
97+
* may not be fully hydrated (for example, their execution context may be missing),
98+
* depending on the implementation. In that case, use
99+
* {@link #getStepExecution(Long, Long)} to hydrate them.
100+
* @param jobInstance The {@link JobInstance} to query.
101+
* @return the set of all executions for the specified {@link JobInstance}.
102102
*/
103103
List<JobExecution> getJobExecutions(JobInstance jobInstance);
104104

105105
/**
106106
* Find the last {@link JobExecution} that has been created for a given
107107
* {@link JobInstance}.
108-
* @param jobInstance the {@link JobInstance}
109-
* @return the last {@link JobExecution} that has been created for this instance or
108+
* @param jobInstance The {@code JobInstance} for which to find the last
109+
* {@code JobExecution}.
110+
* @return the last {@code JobExecution} that has been created for this instance or
110111
* {@code null} if no job execution is found for the given job instance.
111112
*
112113
* @since 4.2
@@ -118,39 +119,39 @@ default JobExecution getLastJobExecution(JobInstance jobInstance) {
118119

119120
/**
120121
* Retrieve running job executions. The corresponding step executions may not be fully
121-
* hydrated (e.g. their execution context may be missing), depending on the
122-
* implementation. Use {@link #getStepExecution(Long, Long)} to hydrate them in that
123-
* case.
124-
* @param jobName the name of the job
125-
* @return the set of running executions for jobs with the specified name
122+
* hydrated (for example, their execution context may be missing), depending on the
123+
* implementation. In that case, use {@link #getStepExecution(Long, Long)} to hydrate
124+
* them.
125+
* @param jobName The name of the job.
126+
* @return the set of running executions for jobs with the specified name.
126127
*/
127128
Set<JobExecution> findRunningJobExecutions(@Nullable String jobName);
128129

129130
/**
130131
* Query the repository for all unique {@link JobInstance} names (sorted
131132
* alphabetically).
132-
* @return the set of job names that have been executed
133+
* @return the set of job names that have been executed.
133134
*/
134135
List<String> getJobNames();
135136

136137
/**
137-
* Fetch {@link JobInstance} values in descending order of creation (and there for
138-
* usually of first execution) with a 'like'/wildcard criteria.
139-
* @param jobName the name of the job to query for.
140-
* @param start the start index of the instances to return.
141-
* @param count the maximum number of instances to return.
142-
* @return a list of {@link JobInstance} for the job name requested.
138+
* Fetch {@link JobInstance} values in descending order of creation (and, therefore,
139+
* usually of first execution) with a 'like' or wildcard criteria.
140+
* @param jobName The name of the job for which to query.
141+
* @param start The start index of the instances to return.
142+
* @param count The maximum number of instances to return.
143+
* @return a list of {@link JobInstance} for the requested job name.
143144
*/
144145
List<JobInstance> findJobInstancesByJobName(String jobName, int start, int count);
145146

146147
/**
147-
* Query the repository for the number of unique {@link JobInstance}s associated with
148-
* the supplied job name.
149-
* @param jobName the name of the job to query for
148+
* Query the repository for the number of unique {@link JobInstance} objects
149+
* associated with the supplied job name.
150+
* @param jobName The name of the job for which to query.
150151
* @return the number of {@link JobInstance}s that exist within the associated job
151-
* repository
152-
* @throws NoSuchJobException thrown when there is no {@link JobInstance} for the
153-
* jobName specified.
152+
* repository.
153+
* @throws {@code NoSuchJobException} thrown when there is no {@link JobInstance} for
154+
* the jobName specified.
154155
*/
155156
int getJobInstanceCount(@Nullable String jobName) throws NoSuchJobException;
156157

spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2021 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.
@@ -24,8 +24,8 @@
2424
import org.springframework.beans.factory.FactoryBean;
2525

2626
/**
27-
* A {@link FactoryBean} that automates the creation of a {@link SimpleJobExplorer}.
28-
* Declares abstract methods for providing DAO object implementations.
27+
* A {@link FactoryBean} that automates the creation of a {@link SimpleJobExplorer}. It
28+
* declares abstract methods for providing DAO object implementations.
2929
*
3030
* @see JobExplorerFactoryBean
3131
* @author Dave Syer
@@ -35,32 +35,37 @@
3535
public abstract class AbstractJobExplorerFactoryBean implements FactoryBean<JobExplorer> {
3636

3737
/**
38-
* @return fully configured {@link JobInstanceDao} implementation.
39-
* @throws Exception thrown if error occurs during JobInstanceDao creation.
38+
* Creates a job instance data access object (DAO).
39+
* @return a fully configured {@link JobInstanceDao} implementation.
40+
* @throws {@code Exception} thrown if error occurs during JobInstanceDao creation.
4041
*/
4142
protected abstract JobInstanceDao createJobInstanceDao() throws Exception;
4243

4344
/**
44-
* @return fully configured {@link JobExecutionDao} implementation.
45-
* @throws Exception thrown if error occurs during JobExecutionDao creation.
45+
* Creates a job execution data access object (DAO).
46+
* @return a fully configured {@link JobExecutionDao} implementation.
47+
* @throws {@code Exception} thrown if error occurs during JobExecutionDao creation.
4648
*/
4749
protected abstract JobExecutionDao createJobExecutionDao() throws Exception;
4850

4951
/**
50-
* @return fully configured {@link StepExecutionDao} implementation.
51-
* @throws Exception thrown if error occurs during StepExecutionDao creation.
52+
* Creates a step execution data access object (DAO).
53+
* @return a fully configured {@link StepExecutionDao} implementation.
54+
* @throws {@code Exception} thrown if error occurs during StepExecutionDao creation.
5255
*/
5356
protected abstract StepExecutionDao createStepExecutionDao() throws Exception;
5457

5558
/**
59+
* Creates an execution context instance data access object (DAO).
5660
* @return fully configured {@link ExecutionContextDao} implementation.
57-
* @throws Exception thrown if error occurs during ExecutionContextDao creation.
61+
* @throws {@code Exception} thrown if error occurs during ExecutionContextDao
62+
* creation.
5863
*/
5964
protected abstract ExecutionContextDao createExecutionContextDao() throws Exception;
6065

6166
/**
62-
* The type of object to be returned from {@link #getObject()}.
63-
* @return JobExplorer.class
67+
* Returns the type of object to be returned from {@link #getObject()}.
68+
* @return {@code JobExplorer.class}
6469
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
6570
*/
6671
@Override

spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
import org.springframework.util.Assert;
4646

4747
/**
48-
* A {@link FactoryBean} that automates the creation of a {@link SimpleJobExplorer} using
49-
* JDBC DAO implementations. Requires the user to describe what kind of database they are
50-
* using.
48+
* A {@link FactoryBean} that automates the creation of a {@link SimpleJobExplorer} by
49+
* using JDBC DAO implementations. Requires the user to describe what kind of database
50+
* they use.
5151
*
5252
* @author Dave Syer
5353
* @author Mahmoud Ben Hassine
@@ -75,56 +75,58 @@ protected long getNextKey() {
7575
private Charset charset = StandardCharsets.UTF_8;
7676

7777
/**
78-
* A custom implementation of the {@link ExecutionContextSerializer}. The default, if
79-
* not injected, is the {@link Jackson2ExecutionContextStringSerializer}.
80-
* @param serializer used to serialize/deserialize an
81-
* {@link org.springframework.batch.item.ExecutionContext}
78+
* A custom implementation of {@link ExecutionContextSerializer}. The default, if not
79+
* injected, is the {@link Jackson2ExecutionContextStringSerializer}.
80+
* @param serializer The serializer used to serialize or deserialize an
81+
* {@link org.springframework.batch.item.ExecutionContext}.
8282
* @see ExecutionContextSerializer
8383
*/
8484
public void setSerializer(ExecutionContextSerializer serializer) {
8585
this.serializer = serializer;
8686
}
8787

8888
/**
89+
* Sets the data source.
90+
*
8991
* Public setter for the {@link DataSource}.
90-
* @param dataSource a {@link DataSource}
92+
* @param dataSource A {@code DataSource}.
9193
*/
9294
public void setDataSource(DataSource dataSource) {
9395
this.dataSource = dataSource;
9496
}
9597

9698
/**
97-
* Public setter for the {@link JdbcOperations}. If this property is not set
98-
* explicitly, a new {@link JdbcTemplate} will be created for the configured
99-
* DataSource by default.
99+
* Public setter for the {@link JdbcOperations}. If this property is not explicitly
100+
* set, a new {@link JdbcTemplate} is created, by default, for the configured
101+
* {@link DataSource}.
100102
* @param jdbcOperations a {@link JdbcOperations}
101103
*/
102104
public void setJdbcOperations(JdbcOperations jdbcOperations) {
103105
this.jdbcOperations = jdbcOperations;
104106
}
105107

106108
/**
107-
* Sets the table prefix for all the batch meta-data tables.
108-
* @param tablePrefix prefix for the batch meta-data tables
109+
* Sets the table prefix for all the batch metadata tables.
110+
* @param tablePrefix The table prefix for the batch metadata tables.
109111
*/
110112
public void setTablePrefix(String tablePrefix) {
111113
this.tablePrefix = tablePrefix;
112114
}
113115

114116
/**
115117
* The lob handler to use when saving {@link ExecutionContext} instances. Defaults to
116-
* null which works for most databases.
117-
* @param lobHandler Large object handler for saving
118-
* {@link org.springframework.batch.item.ExecutionContext}
118+
* {@code null}, which works for most databases.
119+
* @param lobHandler Large object handler for saving an
120+
* {@link org.springframework.batch.item.ExecutionContext}.
119121
*/
120122
public void setLobHandler(LobHandler lobHandler) {
121123
this.lobHandler = lobHandler;
122124
}
123125

124126
/**
125-
* Set the {@link Charset} to use when deserializing the execution context. Defaults
127+
* Sets the {@link Charset} to use when deserializing the execution context. Defaults
126128
* to "UTF-8". Must not be {@code null}.
127-
* @param charset to use when deserializing the execution context.
129+
* @param charset The character set to use when deserializing the execution context.
128130
* @see JdbcExecutionContextDao#setCharset(Charset)
129131
* @since 5.0
130132
*/

spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.util.Set;
3232

3333
/**
34-
* Implementation of {@link JobExplorer} using the injected DAOs.
34+
* Implementation of {@link JobExplorer} that uses the injected DAOs.
3535
*
3636
* @author Dave Syer
3737
* @author Lucas Ward
@@ -55,8 +55,8 @@ public class SimpleJobExplorer implements JobExplorer {
5555
private ExecutionContextDao ecDao;
5656

5757
/**
58-
* Provide default constructor with low visibility in case user wants to use use
59-
* aop:proxy-target-class="true" for AOP interceptor.
58+
* Provides a default constructor with low visibility in case you want to use
59+
* aop:proxy-target-class="true" for the AOP interceptor.
6060
*/
6161
SimpleJobExplorer() {
6262
}

0 commit comments

Comments
 (0)