Skip to content

Commit bb3809c

Browse files
committed
Remove deprecated APIs
Resolves #3836
1 parent f8bdf55 commit bb3809c

File tree

37 files changed

+217
-2712
lines changed

37 files changed

+217
-2712
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2020 the original author or authors.
2+
* Copyright 2006-2021 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.
@@ -250,22 +250,6 @@ public boolean isStopping() {
250250
return status == BatchStatus.STOPPING;
251251
}
252252

253-
/**
254-
* Signal the {@link JobExecution} to stop. Iterates through the associated
255-
* {@link StepExecution}s, calling {@link StepExecution#setTerminateOnly()}.
256-
*
257-
* @deprecated Use {@link org.springframework.batch.core.launch.JobOperator#stop(long)}
258-
* or {@link org.springframework.batch.core.launch.support.CommandLineJobRunner}
259-
* with the "-stop" option instead.
260-
*/
261-
@Deprecated
262-
public void stop() {
263-
for (StepExecution stepExecution : stepExecutions) {
264-
stepExecution.setTerminateOnly();
265-
}
266-
status = BatchStatus.STOPPING;
267-
}
268-
269253
/**
270254
* Sets the {@link ExecutionContext} for this execution
271255
*

spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java

-42
Original file line numberDiff line numberDiff line change
@@ -70,27 +70,6 @@ public Long getLong(String key){
7070
return value==null ? null : ((Long)value).longValue();
7171
}
7272

73-
/**
74-
* Typesafe Getter for the Long represented by the provided key. If the
75-
* key does not exist, the default value will be returned.
76-
*
77-
* @param key to return the value for
78-
* @param defaultValue to return if the value doesn't exist
79-
* @return the parameter represented by the provided key, defaultValue
80-
* otherwise.
81-
* @deprecated Use {@link JobParameters#getLong(java.lang.String, java.lang.Long)}
82-
* instead. This method will be removed in a future release.
83-
*/
84-
@Deprecated
85-
public Long getLong(String key, long defaultValue){
86-
if(parameters.containsKey(key)){
87-
return getLong(key);
88-
}
89-
else{
90-
return defaultValue;
91-
}
92-
}
93-
9473
/**
9574
* Typesafe Getter for the Long represented by the provided key. If the
9675
* key does not exist, the default value will be returned.
@@ -156,27 +135,6 @@ public Double getDouble(String key){
156135
return value==null ? null : value.doubleValue();
157136
}
158137

159-
/**
160-
* Typesafe Getter for the Double represented by the provided key. If the
161-
* key does not exist, the default value will be returned.
162-
*
163-
* @param key to return the value for
164-
* @param defaultValue to return if the value doesn't exist
165-
* @return the parameter represented by the provided key, defaultValue
166-
* otherwise.
167-
* @deprecated Use {@link JobParameters#getDouble(java.lang.String, java.lang.Double)}
168-
* instead. This method will be removed in a future release.
169-
*/
170-
@Deprecated
171-
public Double getDouble(String key, double defaultValue){
172-
if(parameters.containsKey(key)){
173-
return getDouble(key);
174-
}
175-
else{
176-
return defaultValue;
177-
}
178-
}
179-
180138
/**
181139
* Typesafe Getter for the Double represented by the provided key. If the
182140
* key does not exist, the default value will be returned.

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

-44
This file was deleted.

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

-28
This file was deleted.

spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ScheduledJobParametersFactory.java

-112
This file was deleted.

spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java

+1-37
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-2021 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.
@@ -84,26 +84,6 @@ public SimpleStepExecutionSplitter(JobRepository jobRepository, boolean allowSta
8484
this.stepName = stepName;
8585
}
8686

87-
/**
88-
* Construct a {@link SimpleStepExecutionSplitter} from its mandatory
89-
* properties.
90-
*
91-
* @param jobRepository the {@link JobRepository}
92-
* @param step the target step (a local version of it), used to extract the
93-
* name and allowStartIfComplete flags
94-
* @param partitioner a {@link Partitioner} to use for generating input
95-
* parameters
96-
*
97-
* @deprecated use {@link #SimpleStepExecutionSplitter(JobRepository, boolean, String, Partitioner)} instead
98-
*/
99-
@Deprecated
100-
public SimpleStepExecutionSplitter(JobRepository jobRepository, Step step, Partitioner partitioner) {
101-
this.jobRepository = jobRepository;
102-
this.allowStartIfComplete = step.isAllowStartIfComplete();
103-
this.partitioner = partitioner;
104-
this.stepName = step.getName();
105-
}
106-
10787
/**
10888
* Check mandatory properties (step name, job repository and partitioner).
10989
*
@@ -247,22 +227,6 @@ private Map<String, ExecutionContext> getContexts(StepExecution stepExecution, i
247227
* @throws JobExecutionException if unable to check if the step execution is startable
248228
*/
249229
protected boolean isStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException {
250-
return getStartable(stepExecution, context);
251-
}
252-
253-
/**
254-
* Check if a step execution is startable.
255-
* @param stepExecution the step execution to check
256-
* @param context the execution context of the step
257-
* @return true if the step execution is startable, false otherwise
258-
* @throws JobExecutionException if unable to check if the step execution is startable
259-
* @deprecated This method is deprecated in favor of
260-
* {@link SimpleStepExecutionSplitter#isStartable} and will be removed in a
261-
* future version.
262-
*/
263-
@Deprecated
264-
protected boolean getStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException {
265-
266230
JobInstance jobInstance = stepExecution.getJobExecution().getJobInstance();
267231
String stepName = stepExecution.getStepName();
268232
StepExecution lastStepExecution = jobRepository.getLastStepExecution(jobInstance, stepName);

0 commit comments

Comments
 (0)