Package org.springframework.batch.core

Examples of org.springframework.batch.core.JobInstance.incrementVersion()


  public JobInstance createJobInstance(String jobName, JobParameters jobParameters) {

    Assert.state(getJobInstance(jobName, jobParameters) == null, "JobInstance must not already exist");

    JobInstance jobInstance = new JobInstance(currentId.getAndIncrement(), jobName);
    jobInstance.incrementVersion();
    jobInstances.put(jobName + "|" + jobKeyGenerator.generateKey(jobParameters), jobInstance);

    return jobInstance;
  }
View Full Code Here


        "JobInstance must not already exist");

    Long jobId = jobIncrementer.nextLongValue();

    JobInstance jobInstance = new JobInstance(jobId, jobName);
    jobInstance.incrementVersion();

    Object[] parameters = new Object[] { jobId, jobName,
        jobKeyGenerator.generateKey(jobParameters), jobInstance.getVersion() };
    getJdbcTemplate().update(
        getQuery(CREATE_JOB_INSTANCE),
View Full Code Here

    @Override
    public JobInstance mapRow(ResultSet rs, int rowNum) throws SQLException {
      JobInstance jobInstance = new JobInstance(rs.getLong(1), rs.getString(2));
      // should always be at version=0 because they never get updated
      jobInstance.incrementVersion();
      return jobInstance;
    }
  }

  @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.