From a293f3e29c2e2bb7708ee1114ff13008cdac712e Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Thu, 10 Oct 2024 23:24:11 +0200 Subject: [PATCH] Deprecate public APIs related to LobHandler Resolves #4588 --- .../core/configuration/annotation/EnableBatchProcessing.java | 2 ++ .../configuration/support/DefaultBatchConfiguration.java | 3 ++- .../batch/core/explore/support/JobExplorerFactoryBean.java | 4 +++- .../batch/core/repository/dao/JdbcExecutionContextDao.java | 5 +++++ .../core/repository/support/JobRepositoryFactoryBean.java | 5 +++-- .../batch/core/configuration/xml/spring-batch.xsd | 1 + 6 files changed, 16 insertions(+), 4 deletions(-) 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 44803ad28..27239d36c 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 @@ -241,7 +241,9 @@ public @interface EnableBatchProcessing { /** * The large object handler to use in job repository and job explorer. * @return the bean name of the lob handler to use. Defaults to {@literal lobHandler}. + * @deprecated Since 5.2 with no replacement. Scheduled for removal in v6 */ + @Deprecated(since = "5.2.0", forRemoval = true) String lobHandlerRef() default "lobHandler"; /** diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java index 3f9608893..365af8487 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultBatchConfiguration.java @@ -392,8 +392,9 @@ public class DefaultBatchConfiguration implements ApplicationContextAware { * A special handler for large objects. The default is usually fine, except for some * (usually older) versions of Oracle. * @return the {@link LobHandler} to use - * + * @deprecated Since 5.2 with no replacement. Scheduled for removal in v6 */ + @Deprecated(since = "5.2.0", forRemoval = true) protected LobHandler getLobHandler() { return new DefaultLobHandler(); } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java index 4d99c15fa..9d3e24dae 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -143,7 +143,9 @@ public class JobExplorerFactoryBean extends AbstractJobExplorerFactoryBean imple * {@code null}, which works for most databases. * @param lobHandler Large object handler for saving an * {@link org.springframework.batch.item.ExecutionContext}. + * @deprecated Since 5.2 with no replacement. Scheduled for removal in v6 */ + @Deprecated(since = "5.2.0", forRemoval = true) public void setLobHandler(LobHandler lobHandler) { this.lobHandler = lobHandler; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java index e59c45939..07915965c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java @@ -268,6 +268,11 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem getJdbcTemplate().update(getQuery(DELETE_STEP_EXECUTION_CONTEXT), stepExecution.getId()); } + /** + * @deprecated Since 5.2 with no replacement. Scheduled for removal in v6 + * @param lobHandler the lob handler to use + */ + @Deprecated(since = "5.2.0", forRemoval = true) public void setLobHandler(LobHandler lobHandler) { this.lobHandler = lobHandler; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java index 2d72203d6..70b0b5443 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/JobRepositoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -129,9 +129,10 @@ public class JobRepositoryFactoryBean extends AbstractJobRepositoryFactoryBean i * (usually older) versions of Oracle. The default is determined from the data base * type. * @param lobHandler the {@link LobHandler} to set - * + * @deprecated Since 5.2 with no replacement. Scheduled for removal in v6 * @see LobHandler */ + @Deprecated(since = "5.2.0", forRemoval = true) public void setLobHandler(LobHandler lobHandler) { this.lobHandler = lobHandler; } diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch.xsd b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch.xsd index 987988665..5cf435ab6 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch.xsd +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch.xsd @@ -270,6 +270,7 @@