Skip to content

Commit 0958cf4

Browse files
committed
Deprecate the Map-based JobRepository and JobExplorer
This commit deprecates the Map-based JobRepository and JobExplorer factory beans with the associated DAOs in favor of using the JDBC-based implementations with an in-memory database. Resolves #3780
1 parent 264243b commit 0958cf4

File tree

6 files changed

+31
-5
lines changed

6 files changed

+31
-5
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2013 the original author or authors.
2+
* Copyright 2006-2020 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.
@@ -31,8 +31,13 @@
3131
* {@link SimpleJobExplorer} using in-memory DAO implementations.
3232
*
3333
* @author Dave Syer
34+
* @author Mahmoud Ben Hassine
3435
* @since 2.0
36+
*
37+
* @deprecated as of v4.3 in favor of using the {@link JobExplorerFactoryBean}
38+
* with an in-memory database. Scheduled for removal in v5.0.
3539
*/
40+
@Deprecated
3641
public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean implements InitializingBean {
3742

3843
private MapJobRepositoryFactoryBean repositoryFactory;

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapExecutionContextDao.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2018 the original author or authors.
2+
* Copyright 2006-2020 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.
@@ -34,8 +34,12 @@
3434
* @author Dave Syer
3535
* @author David Turanski
3636
* @author Mahmoud Ben Hassine
37+
*
38+
* @deprecated as of v4.3 in favor of using the {@link JdbcExecutionContextDao}
39+
* with an in-memory database. Scheduled for removal in v5.0.
3740
*/
3841
@SuppressWarnings("serial")
42+
@Deprecated
3943
public class MapExecutionContextDao implements ExecutionContextDao {
4044

4145
private final ConcurrentMap<ContextKey, ExecutionContext> contexts = TransactionAwareProxyFactory

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobExecutionDao.java

Lines changed: 5 additions & 1 deletion
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-2020 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.
@@ -35,7 +35,11 @@
3535

3636
/**
3737
* In-memory implementation of {@link JobExecutionDao}.
38+
*
39+
* @deprecated as of v4.3 in favor of using the {@link JdbcJobExecutionDao}
40+
* with an in-memory database. Scheduled for removal in v5.0.
3841
*/
42+
@Deprecated
3943
public class MapJobExecutionDao implements JobExecutionDao {
4044

4145
// JDK6 Make this into a ConcurrentSkipListMap: adds and removes tend to be very near the front or back

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobInstanceDao.java

Lines changed: 5 additions & 1 deletion
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-2020 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.
@@ -35,7 +35,11 @@
3535

3636
/**
3737
* In-memory implementation of {@link JobInstanceDao}.
38+
*
39+
* @deprecated as of v4.3 in favor of using the {@link JdbcJobInstanceDao}
40+
* with an in-memory database. Scheduled for removal in v5.0.
3841
*/
42+
@Deprecated
3943
public class MapJobInstanceDao implements JobInstanceDao {
4044
private static final String STAR_WILDCARD = "\\*";
4145
private static final String STAR_WILDCARD_PATTERN = ".*";

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapStepExecutionDao.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737

3838
/**
3939
* In-memory implementation of {@link StepExecutionDao}.
40+
*
41+
* @deprecated as of v4.3 in favor of using the {@link JdbcStepExecutionDao}
42+
* with an in-memory database. Scheduled for removal in v5.0.
4043
*/
44+
@Deprecated
4145
public class MapStepExecutionDao implements StepExecutionDao {
4246

4347
private Map<Long, Map<Long, StepExecution>> executionsByJobExecutionId = new ConcurrentHashMap<>();

spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2014 the original author or authors.
2+
* Copyright 2006-2020 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.
@@ -39,7 +39,12 @@
3939
* multi-threaded step.
4040
*
4141
* @author Robert Kasanicky
42+
* @author Mahmoud Ben Hassine
43+
*
44+
* @deprecated as of v4.3 in favor or using the {@link JobRepositoryFactoryBean}
45+
* with an in-memory database. Scheduled for removal in v5.0.
4246
*/
47+
@Deprecated
4348
public class MapJobRepositoryFactoryBean extends AbstractJobRepositoryFactoryBean {
4449

4550
private MapJobExecutionDao jobExecutionDao;

0 commit comments

Comments
 (0)