Add method in ExecutionContext to expose the internal map as read-only
Resolves #4004
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
d9bf57e572
commit
06e6bdbc98
@@ -82,11 +82,7 @@ public class JobContext extends SynchronizedAttributeAccessor {
|
||||
* @return a map containing the items from the job {@link ExecutionContext}
|
||||
*/
|
||||
public Map<String, Object> getJobExecutionContext() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
for (Entry<String, Object> entry : jobExecution.getExecutionContext().entrySet()) {
|
||||
result.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
return Collections.unmodifiableMap(result);
|
||||
return jobExecution.getExecutionContext().toMap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,22 +111,14 @@ public class StepContext extends SynchronizedAttributeAccessor {
|
||||
* @return a map containing the items from the step {@link ExecutionContext}
|
||||
*/
|
||||
public Map<String, Object> getStepExecutionContext() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
for (Entry<String, Object> entry : stepExecution.getExecutionContext().entrySet()) {
|
||||
result.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
return Collections.unmodifiableMap(result);
|
||||
return stepExecution.getExecutionContext().toMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a map containing the items from the job {@link ExecutionContext}
|
||||
*/
|
||||
public Map<String, Object> getJobExecutionContext() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
for (Entry<String, Object> entry : stepExecution.getJobExecution().getExecutionContext().entrySet()) {
|
||||
result.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
return Collections.unmodifiableMap(result);
|
||||
return stepExecution.getJobExecution().getExecutionContext().toMap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user