/** * Registers the specified {@link Job} defined in the specified {@link ConfigurableApplicationContext}. * <br> * Makes sure to update the {@link StepRegistry} if it is available. * * @param context the context in which the job is defined * @param job the job to register * @throws DuplicateJobException if that job is already registered */ private void doRegister(ConfigurableApplicationContext context, Job job) throws DuplicateJobException { final JobFactory jobFactory = new ReferenceJobFactory(job); jobRegistry.register(jobFactory); if (stepRegistry != null) { if (!(job instanceof StepLocator)) { throw new UnsupportedOperationException("Cannot locate steps from a Job that is not a StepLocator: job=" + job.getName() + " does not implement StepLocator"); } stepRegistry.register(job.getName(), getSteps((StepLocator) job, context)); } }
/** * Registers the specified {@link Job} defined in the specified {@link ConfigurableApplicationContext}. * <br> * Makes sure to update the {@link StepRegistry} if it is available. * * @param context the context in which the job is defined * @param job the job to register * @throws DuplicateJobException if that job is already registered */ private void doRegister(ConfigurableApplicationContext context, Job job) throws DuplicateJobException { final JobFactory jobFactory = new ReferenceJobFactory(job); jobRegistry.register(jobFactory); if (stepRegistry != null) { if (!(job instanceof StepLocator)) { throw new UnsupportedOperationException("Cannot locate steps from a Job that is not a StepLocator: job=" + job.getName() + " does not implement StepLocator"); } stepRegistry.register(job.getName(), getSteps((StepLocator) job, context)); } }
/** * Registers the specified {@link Job} defined in the specified {@link ConfigurableApplicationContext}. * <br> * Makes sure to update the {@link StepRegistry} if it is available. * * @param context the context in which the job is defined * @param job the job to register * @throws DuplicateJobException if that job is already registered */ private void doRegister(ConfigurableApplicationContext context, Job job) throws DuplicateJobException { final JobFactory jobFactory = new ReferenceJobFactory(job); jobRegistry.register(jobFactory); if (stepRegistry != null) { if (!(job instanceof StepLocator)) { throw new UnsupportedOperationException("Cannot locate steps from a Job that is not a StepLocator: job=" + job.getName() + " does not implement StepLocator"); } stepRegistry.register(job.getName(), getSteps((StepLocator) job, context)); } }
/** * Registers the specified {@link Job} defined in the specified {@link ConfigurableApplicationContext}. * <br> * Makes sure to update the {@link StepRegistry} if it is available. * * @param context the context in which the job is defined * @param job the job to register * @throws DuplicateJobException if that job is already registered */ private void doRegister(ConfigurableApplicationContext context, Job job) throws DuplicateJobException { final JobFactory jobFactory = new ReferenceJobFactory(job); jobRegistry.register(jobFactory); if (stepRegistry != null) { if (!(job instanceof StepLocator)) { throw new UnsupportedOperationException("Cannot locate steps from a Job that is not a StepLocator: job=" + job.getName() + " does not implement StepLocator"); } stepRegistry.register(job.getName(), getSteps((StepLocator) job, context)); } }