From 7565cd19f834895cca5ed4ac305979740134e7bf Mon Sep 17 00:00:00 2001 From: dsyer Date: Wed, 23 Jan 2008 16:45:33 +0000 Subject: [PATCH] OPEN - issue BATCH-304: BatchCommandLineLauncher simplified and rename http://jira.springframework.org/browse/BATCH-304 Remove JobIdentifierFactory from runner --- .../bootstrap/support/SimpleCommandLineJobRunner.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/bootstrap/support/SimpleCommandLineJobRunner.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/bootstrap/support/SimpleCommandLineJobRunner.java index 63d0a2c28..72fff1876 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/bootstrap/support/SimpleCommandLineJobRunner.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/bootstrap/support/SimpleCommandLineJobRunner.java @@ -101,8 +101,6 @@ public class SimpleCommandLineJobRunner { public static final String BEAN_REF_CONTEXT_KEY = "bean.ref.context"; - private JobIdentifierFactory jobIdentifierFactory = new ScheduledJobIdentifierFactory(); - private BeanFactoryLocator beanFactoryLocator; private ExitCodeMapper exitCodeMapper = new SimpleJvmExitCodeMapper(); @@ -138,7 +136,6 @@ public class SimpleCommandLineJobRunner { * @param jobIdentifierFactory the {@link JobIdentifierFactory} to set */ public void setJobIdentifierFactory(JobIdentifierFactory jobIdentifierFactory) { - this.jobIdentifierFactory = jobIdentifierFactory; } /** @@ -238,11 +235,7 @@ public class SimpleCommandLineJobRunner { jobName = defaultJobName; } - if (jobName == null) { - throw new NoSuchJobException("Null job name cannot be located."); - } - JobIdentifier runtimeInformation = jobIdentifierFactory.getJobIdentifier(jobName); - status = launcher.run(jobLocator.getJob(runtimeInformation.getName()), new JobInstanceProperties()).getExitStatus(); + status = launcher.run(jobLocator.getJob(jobName), new JobInstanceProperties()).getExitStatus(); } catch (NoSuchJobException e) { logger.fatal("Could not locate JobConfiguration \"" + jobName + "\"", e);