Package org.springframework.batch.core.job.flow

Examples of org.springframework.batch.core.job.flow.FlowJob


  }

  @Override
  public final FlowJob getObject() throws Exception {
    Assert.isTrue(StringUtils.hasText(name), "The job must have an id.");
    FlowJob flowJob = new FlowJob(name);

    if (restartable != null) {
      flowJob.setRestartable(restartable);
    }

    if (jobRepository != null) {
      flowJob.setJobRepository(jobRepository);
    }

    if (jobParametersValidator != null) {
      flowJob.setJobParametersValidator(jobParametersValidator);
    }

    if (jobExecutionListeners != null) {
      flowJob.setJobExecutionListeners(jobExecutionListeners);
    }

    if (jobParametersIncrementer != null) {
      flowJob.setJobParametersIncrementer(jobParametersIncrementer);
    }

    if (flow != null) {
      flowJob.setFlow(flow);
    }

    flowJob.afterPropertiesSet();
    return flowJob;
  }
View Full Code Here


   * Build a job that executes the flow provided, normally composed of other steps.
   *
   * @return a flow job
   */
  public Job build() {
    FlowJob job = new FlowJob();
    job.setName(getName());
    job.setFlow(flow);
    super.enhance(job);
    try {
      job.afterPropertiesSet();
    }
    catch (Exception e) {
      throw new StepBuilderException(e);
    }
    return job;
View Full Code Here

    }
    return bean;
  }

  private void postProcessJob(Object bean, String beanName) {
    FlowJob job = (FlowJob) bean;
    job.setName(this.groupName);
    // Add the job name, job parameters incrementer and job restartable flag to {@link DistributedJobLocator}
    // Since, the Spring batch doesn't have persistent JobRegistry, the {@link DistributedJobLocator}
    // acts as the store to have jobName , job parameter incrementer and restartable flag to be
    // used by {@link DistributedJobService}
    jobLocator.addJob(this.groupName, (job.getJobParametersIncrementer() != null) ? true : false,
        job.isRestartable());
    jobLocator.addStepNames(this.groupName, job.getStepNames());
    super.postProcessAfterInitialization(bean, beanName);
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.job.flow.FlowJob

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.