Skip to content

Commit 43ac1f1

Browse files
committed
Remove deprecated APIs scheduled for removal in v6
Resolves #4819
1 parent 9d38ace commit 43ac1f1

File tree

79 files changed

+1632
-3691
lines changed

Some content is hidden

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

79 files changed

+1632
-3691
lines changed

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

-10
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ private void registerJobRepository(BeanDefinitionRegistry registry, EnableBatchP
111111
beanDefinitionBuilder.addPropertyReference("serializer", executionContextSerializerRef);
112112
}
113113

114-
String lobHandlerRef = batchAnnotation.lobHandlerRef();
115-
if (registry.containsBeanDefinition(lobHandlerRef)) {
116-
beanDefinitionBuilder.addPropertyReference("lobHandler", lobHandlerRef);
117-
}
118-
119114
String conversionServiceRef = batchAnnotation.conversionServiceRef();
120115
if (registry.containsBeanDefinition(conversionServiceRef)) {
121116
beanDefinitionBuilder.addPropertyReference("conversionService", conversionServiceRef);
@@ -178,11 +173,6 @@ private void registerJobExplorer(BeanDefinitionRegistry registry, EnableBatchPro
178173
beanDefinitionBuilder.addPropertyReference("serializer", executionContextSerializerRef);
179174
}
180175

181-
String lobHandlerRef = batchAnnotation.lobHandlerRef();
182-
if (registry.containsBeanDefinition(lobHandlerRef)) {
183-
beanDefinitionBuilder.addPropertyReference("lobHandler", lobHandlerRef);
184-
}
185-
186176
String conversionServiceRef = batchAnnotation.conversionServiceRef();
187177
if (registry.containsBeanDefinition(conversionServiceRef)) {
188178
beanDefinitionBuilder.addPropertyReference("conversionService", conversionServiceRef);

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

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -238,14 +238,6 @@
238238
*/
239239
String jobKeyGeneratorRef() default "jobKeyGenerator";
240240

241-
/**
242-
* The large object handler to use in job repository and job explorer.
243-
* @return the bean name of the lob handler to use. Defaults to {@literal lobHandler}.
244-
* @deprecated Since 5.2 with no replacement. Scheduled for removal in v6
245-
*/
246-
@Deprecated(since = "5.2.0", forRemoval = true)
247-
String lobHandlerRef() default "lobHandler";
248-
249241
/**
250242
* The type of large objects.
251243
* @return the type of large objects.

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

+3-60
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -67,8 +67,6 @@
6767
import org.springframework.jdbc.core.JdbcTemplate;
6868
import org.springframework.jdbc.support.MetaDataAccessException;
6969
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
70-
import org.springframework.jdbc.support.lob.DefaultLobHandler;
71-
import org.springframework.jdbc.support.lob.LobHandler;
7270
import org.springframework.transaction.PlatformTransactionManager;
7371
import org.springframework.transaction.annotation.Isolation;
7472

@@ -85,7 +83,8 @@
8583
* <li>a {@link JobLauncher} named "jobLauncher"</li>
8684
* <li>a {@link JobRegistry} named "jobRegistry"</li>
8785
* <li>a {@link JobOperator} named "JobOperator"</li>
88-
* <li>a {@link JobRegistryBeanPostProcessor} named "jobRegistryBeanPostProcessor"</li>
86+
* <li>a {@link JobRegistrySmartInitializingSingleton} named
87+
* "jobRegistrySmartInitializingSingleton"</li>
8988
* <li>a {@link org.springframework.batch.core.scope.StepScope} named "stepScope"</li>
9089
* <li>a {@link org.springframework.batch.core.scope.JobScope} named "jobScope"</li>
9190
* </ul>
@@ -137,7 +136,6 @@ public JobRepository jobRepository() throws BatchConfigurationException {
137136
jobRepositoryFactoryBean.setSerializer(getExecutionContextSerializer());
138137
jobRepositoryFactoryBean.setConversionService(getConversionService());
139138
jobRepositoryFactoryBean.setJdbcOperations(getJdbcOperations());
140-
jobRepositoryFactoryBean.setLobHandler(getLobHandler());
141139
jobRepositoryFactoryBean.setCharset(getCharset());
142140
jobRepositoryFactoryBean.setMaxVarCharLength(getMaxVarCharLength());
143141
jobRepositoryFactoryBean.setIsolationLevelForCreateEnum(getIsolationLevelForCreate());
@@ -150,17 +148,6 @@ public JobRepository jobRepository() throws BatchConfigurationException {
150148
}
151149
}
152150

153-
/**
154-
* Define a job launcher.
155-
* @return a job launcher
156-
* @throws BatchConfigurationException if unable to configure the default job launcher
157-
* @deprecated Since 5.2. Use {@link #jobLauncher(JobRepository)} instead
158-
*/
159-
@Deprecated(forRemoval = true)
160-
public JobLauncher jobLauncher() throws BatchConfigurationException {
161-
return jobLauncher(jobRepository());
162-
}
163-
164151
/**
165152
* Define a job launcher bean.
166153
* @param jobRepository the job repository
@@ -191,7 +178,6 @@ public JobExplorer jobExplorer() throws BatchConfigurationException {
191178
jobExplorerFactoryBean.setJobKeyGenerator(getJobKeyGenerator());
192179
jobExplorerFactoryBean.setCharset(getCharset());
193180
jobExplorerFactoryBean.setTablePrefix(getTablePrefix());
194-
jobExplorerFactoryBean.setLobHandler(getLobHandler());
195181
jobExplorerFactoryBean.setConversionService(getConversionService());
196182
jobExplorerFactoryBean.setSerializer(getExecutionContextSerializer());
197183
try {
@@ -208,18 +194,6 @@ public JobRegistry jobRegistry() throws BatchConfigurationException {
208194
return new MapJobRegistry();
209195
}
210196

211-
/**
212-
* Define a job operator.
213-
* @return a job operator
214-
* @throws BatchConfigurationException if unable to configure the default job operator
215-
* @deprecated Since 5.2. Use
216-
* {@link #jobOperator(JobRepository, JobExplorer, JobRegistry, JobLauncher)} instead
217-
*/
218-
@Deprecated(forRemoval = true)
219-
public JobOperator jobOperator() throws BatchConfigurationException {
220-
return jobOperator(jobRepository(), jobExplorer(), jobRegistry(), jobLauncher());
221-
}
222-
223197
/**
224198
* Define a job operator bean.
225199
* @param jobRepository a job repository
@@ -249,26 +223,6 @@ public JobOperator jobOperator(JobRepository jobRepository, JobExplorer jobExplo
249223
}
250224
}
251225

252-
/**
253-
* Defines a {@link JobRegistryBeanPostProcessor}.
254-
* @return a {@link JobRegistryBeanPostProcessor}
255-
* @throws BatchConfigurationException if unable to register the bean
256-
* @since 5.1
257-
* @deprecated Use {@link #jobRegistrySmartInitializingSingleton(JobRegistry)} instead
258-
*/
259-
@Deprecated(forRemoval = true)
260-
public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor() throws BatchConfigurationException {
261-
JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor = new JobRegistryBeanPostProcessor();
262-
jobRegistryBeanPostProcessor.setJobRegistry(jobRegistry());
263-
try {
264-
jobRegistryBeanPostProcessor.afterPropertiesSet();
265-
return jobRegistryBeanPostProcessor;
266-
}
267-
catch (Exception e) {
268-
throw new BatchConfigurationException("Unable to configure the default job registry BeanPostProcessor", e);
269-
}
270-
}
271-
272226
/**
273227
* Define a {@link JobRegistrySmartInitializingSingleton} bean.
274228
* @param jobRegistry the job registry to populate
@@ -388,17 +342,6 @@ protected Charset getCharset() {
388342
return StandardCharsets.UTF_8;
389343
}
390344

391-
/**
392-
* A special handler for large objects. The default is usually fine, except for some
393-
* (usually older) versions of Oracle.
394-
* @return the {@link LobHandler} to use
395-
* @deprecated Since 5.2 with no replacement. Scheduled for removal in v6
396-
*/
397-
@Deprecated(since = "5.2.0", forRemoval = true)
398-
protected LobHandler getLobHandler() {
399-
return new DefaultLobHandler();
400-
}
401-
402345
/**
403346
* Return the {@link JdbcOperations}. If this property is not overridden, a new
404347
* {@link JdbcTemplate} will be created for the configured data source by default.

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

-176
This file was deleted.

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 the original author or authors.
2+
* Copyright 2024-2025 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.
@@ -42,9 +42,6 @@
4242
* {@link JobRegistry}. Include a bean of this type along with your job configuration and
4343
* use the same {@link JobRegistry} as a {@link JobLocator} when you need to locate a
4444
* {@link Job} to launch.
45-
* <p>
46-
* This class is an alternative to {@link JobRegistryBeanPostProcessor} and prevents early
47-
* bean initializations. You must include at most one of either of them as a bean.
4845
*
4946
* @author Henning Pöttker
5047
* @since 5.1.1

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

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2022 the original author or authors.
2+
* Copyright 2006-2025 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.
@@ -77,8 +77,6 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
7777

7878
String maxVarCharLength = element.getAttribute("max-varchar-length");
7979

80-
String lobHandler = element.getAttribute("lob-handler");
81-
8280
String serializer = element.getAttribute("serializer");
8381

8482
String conversionService = element.getAttribute("conversion-service");
@@ -97,9 +95,6 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
9795
if (StringUtils.hasText(tablePrefix)) {
9896
builder.addPropertyValue("tablePrefix", tablePrefix);
9997
}
100-
if (StringUtils.hasText(lobHandler)) {
101-
builder.addPropertyReference("lobHandler", lobHandler);
102-
}
10398
if (StringUtils.hasText(maxVarCharLength)) {
10499
builder.addPropertyValue("maxVarCharLength", maxVarCharLength);
105100
}

0 commit comments

Comments
 (0)