diff --git a/core/src/main/java/org/springframework/batch/core/domain/JobExecution.java b/core/src/main/java/org/springframework/batch/core/domain/JobExecution.java index df182eaf2..bf6b50bdb 100644 --- a/core/src/main/java/org/springframework/batch/core/domain/JobExecution.java +++ b/core/src/main/java/org/springframework/batch/core/domain/JobExecution.java @@ -138,16 +138,6 @@ public class JobExecution extends Entity { } } - /** - * Accessor for the runtime information of this execution. - * - * @return the {@link JobRuntimeInformation} that was used to start this job - * execution. - */ - public JobIdentifier getJobIdentifier() { - return job.getIdentifier(); - } - /** * Accessor for the potentially multiple step contexts that are in progress. * In a single-threaded, sequential execution there would normally be only diff --git a/core/src/test/java/org/springframework/batch/core/domain/JobExecutionTests.java b/core/src/test/java/org/springframework/batch/core/domain/JobExecutionTests.java index a1db22568..f4d05afc1 100644 --- a/core/src/test/java/org/springframework/batch/core/domain/JobExecutionTests.java +++ b/core/src/test/java/org/springframework/batch/core/domain/JobExecutionTests.java @@ -100,7 +100,7 @@ public class JobExecutionTests extends TestCase { } public void testContextContainsInfo() throws Exception { - assertEquals("foo", context.getJobIdentifier().getName()); + assertEquals("foo", context.getJob().getIdentifier().getName()); } public void testNullContexts() throws Exception { diff --git a/execution/src/main/java/org/springframework/batch/execution/launch/SimpleJobExecutorFacade.java b/execution/src/main/java/org/springframework/batch/execution/launch/SimpleJobExecutorFacade.java index 6b626a9a4..804dff00f 100644 --- a/execution/src/main/java/org/springframework/batch/execution/launch/SimpleJobExecutorFacade.java +++ b/execution/src/main/java/org/springframework/batch/execution/launch/SimpleJobExecutorFacade.java @@ -184,7 +184,7 @@ class SimpleJobExecutorFacade implements JobExecutorFacade, public void before(JobExecution execution) { synchronized (mutex) { running++; - jobExecutionRegistry.put(execution.getJobIdentifier(), execution); + jobExecutionRegistry.put(execution.getJob().getIdentifier(), execution); } for (Iterator iterator = listeners.iterator(); iterator.hasNext();) { JobExecutionListener listener = (JobExecutionListener) iterator @@ -224,7 +224,7 @@ class SimpleJobExecutorFacade implements JobExecutorFacade, synchronized (mutex) { // assume execution is synchronous so when we get to here we are // not running any more - jobExecutionRegistry.remove(execution.getJobIdentifier()); + jobExecutionRegistry.remove(execution.getJob().getIdentifier()); running--; } } @@ -268,7 +268,7 @@ class SimpleJobExecutorFacade implements JobExecutorFacade, JobExecution element = (JobExecution) iter.next(); i++; String runtime = "job" + i; - props.setProperty(runtime, "" + element.getJobIdentifier()); + props.setProperty(runtime, "" + element.getJob().getIdentifier()); int j = 0; for (Iterator iterator = element.getStepContexts().iterator(); iterator .hasNext();) { diff --git a/execution/src/main/java/org/springframework/batch/execution/resource/BatchResourceFactoryBean.java b/execution/src/main/java/org/springframework/batch/execution/resource/BatchResourceFactoryBean.java index b15e8ff03..e0d76e354 100644 --- a/execution/src/main/java/org/springframework/batch/execution/resource/BatchResourceFactoryBean.java +++ b/execution/src/main/java/org/springframework/batch/execution/resource/BatchResourceFactoryBean.java @@ -130,7 +130,7 @@ public class BatchResourceFactoryBean extends AbstractFactoryBean implements StepExecution execution = context.getStepExecution(); stepName = execution.getStep().getName(); jobName = execution.getStep().getJob().getName(); - jobIdentifier = execution.getJobExecution().getJobIdentifier(); + jobIdentifier = execution.getJobExecution().getJob().getIdentifier(); } /** diff --git a/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java b/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java index 7d7d468cb..e68d6720b 100644 --- a/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java +++ b/execution/src/main/java/org/springframework/batch/execution/step/simple/SimpleStepExecutor.java @@ -164,7 +164,7 @@ public class SimpleStepExecutor implements StepExecutor { // Add the job identifier so that it can be used to identify // the conversation in StepScope stepScopeContext.setAttribute(StepScope.ID_KEY, stepExecution - .getJobExecution().getJobIdentifier()); + .getJobExecution().getJob().getIdentifier()); try { stepExecution