OPEN - issue BATCH-304: BatchCommandLineLauncher simplified and rename
http://jira.springframework.org/browse/BATCH-304 Remove Javadocs references to non-existent classes
This commit is contained in:
@@ -46,7 +46,7 @@ public class JobInstance extends Entity {
|
||||
|
||||
public JobInstance(Long id, JobParameters jobParameters) {
|
||||
super(id);
|
||||
Assert.notNull(jobParameters, "JobInstanceProperties must not be null.");
|
||||
Assert.notNull(jobParameters, "JobParameters must not be null.");
|
||||
this.jobParameters = jobParameters;
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ public class JobInstance extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return JobInstanceProperties
|
||||
* @return {@link JobParameters}
|
||||
*/
|
||||
public JobParameters getJobInstanceProperties() {
|
||||
public JobParameters getJobParameters() {
|
||||
return jobParameters;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class JobInstance extends Entity {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return super.toString()+", JobInstanceProperties=["+ jobParameters +"]" +
|
||||
return super.toString()+", JobParameters=["+ jobParameters +"]" +
|
||||
", Job=[" + job + "]";
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
@@ -34,9 +34,9 @@ public class JobParametersBuilder {
|
||||
*/
|
||||
public JobParametersBuilder() {
|
||||
|
||||
this.stringMap = new HashMap();
|
||||
this.longMap = new HashMap();
|
||||
this.dateMap = new HashMap();
|
||||
this.stringMap = new LinkedHashMap();
|
||||
this.longMap = new LinkedHashMap();
|
||||
this.dateMap = new LinkedHashMap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.batch.core.repository.JobExecutionAlreadyRunningExcep
|
||||
public interface JobLauncher {
|
||||
|
||||
/**
|
||||
* Start a job execution for the given Job and JobInstanceProperties.
|
||||
* Start a job execution for the given {@link Job} and {@link JobParameters}.
|
||||
*
|
||||
* @return the exit code from the job if it returns synchronously. If the
|
||||
* implementation is asynchronous, the status might well be unknown.
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
import org.springframework.batch.core.domain.JobExecution;
|
||||
import org.springframework.batch.core.domain.JobInstance;
|
||||
import org.springframework.batch.core.domain.JobParameters;
|
||||
import org.springframework.batch.core.executor.JobExecutor;
|
||||
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
|
||||
@@ -63,12 +64,12 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean{
|
||||
private TaskExecutor taskExecutor = new SyncTaskExecutor();
|
||||
|
||||
/**
|
||||
* Run the provided job with the given JobInstanceProperties. The JobInstanceProperties will
|
||||
* Run the provided job with the given {@link JobParameters}. The {@link JobParameters} will
|
||||
* be used to determine if this is an execution of an existing job instance, or if a new
|
||||
* one should be created.
|
||||
*
|
||||
* @param Job, the job to be run.
|
||||
* @param JobInstanceProperties, the JobInstanceProperties for this particular execution.
|
||||
* @param job, the job to be run.
|
||||
* @param jobParameters, the {@link JobParameters} for this particular execution.
|
||||
* @return JobExecutionAlreadyRunningException if the JobInstance already exists and has
|
||||
* an execution already running.
|
||||
*/
|
||||
@@ -76,7 +77,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean{
|
||||
throws JobExecutionAlreadyRunningException {
|
||||
|
||||
Assert.notNull(job, "The Job must not be null.");
|
||||
Assert.notNull(jobParameters, "The JobInstanceProperties must not be null.");
|
||||
Assert.notNull(jobParameters, "The JobParameters must not be null.");
|
||||
|
||||
final JobExecution jobExecution = jobRepository.createJobExecution(job, jobParameters);
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ public class SimpleJobRepository implements JobRepository {
|
||||
throws JobExecutionAlreadyRunningException {
|
||||
|
||||
Assert.notNull(job, "Job must not be null.");
|
||||
Assert.notNull(jobParameters, "JobInstanceProperties must not be null.");
|
||||
Assert.notNull(jobParameters, "JobParameters must not be null.");
|
||||
|
||||
List jobs = new ArrayList();
|
||||
JobInstance jobInstance;
|
||||
|
||||
@@ -122,7 +122,7 @@ public class JdbcJobDao implements JobDao, InitializingBean {
|
||||
public JobInstance createJobInstance(String jobName, JobParameters jobParameters) {
|
||||
|
||||
Assert.notNull(jobName, "Job Name must not be null.");
|
||||
Assert.notNull(jobParameters, "JobInstanceProperties must not be null.");
|
||||
Assert.notNull(jobParameters, "JobParameters must not be null.");
|
||||
|
||||
Long jobId = new Long(jobIncrementer.nextLongValue());
|
||||
Object[] parameters = new Object[] { jobId, jobName, createJobKey(jobParameters) };
|
||||
@@ -168,7 +168,7 @@ public class JdbcJobDao implements JobDao, InitializingBean {
|
||||
public List findJobInstances(final String jobName, final JobParameters jobParameters) {
|
||||
|
||||
Assert.notNull(jobName, "Job Name must not be null.");
|
||||
Assert.notNull(jobParameters, "JobInstanceProperties must not be null.");
|
||||
Assert.notNull(jobParameters, "JobParameters must not be null.");
|
||||
|
||||
Object[] parameters = new Object[] { jobName,
|
||||
createJobKey(jobParameters) };
|
||||
|
||||
@@ -57,7 +57,7 @@ public class MapJobDao implements JobDao {
|
||||
List list = new ArrayList();
|
||||
for (Iterator iter = jobsById.values().iterator(); iter.hasNext();) {
|
||||
JobInstance jobInstance = (JobInstance) iter.next();
|
||||
if (jobInstance.getJobName().equals(jobName) && jobInstance.getJobInstanceProperties().equals(jobParameters)) {
|
||||
if (jobInstance.getJobName().equals(jobName) && jobInstance.getJobParameters().equals(jobParameters)) {
|
||||
list.add(jobInstance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class DefaultJobInstanceLabelGenerator implements JobInstanceLabelGenerat
|
||||
return null;
|
||||
}
|
||||
StringBuilder builder = new StringBuilder(""+jobInstance.getJobName());
|
||||
Map map = jobInstance.getJobInstanceProperties().getParameters();
|
||||
Map map = jobInstance.getJobParameters().getParameters();
|
||||
for (Iterator iterator = map.values().iterator(); iterator.hasNext();) {
|
||||
Object value = iterator.next();
|
||||
builder.append("-" + ((value instanceof Date) ? dateFormat.format(value) : ""+value));
|
||||
|
||||
@@ -107,7 +107,7 @@ public abstract class AbstractJobDaoTests extends
|
||||
assertTrue(jobs.size() == 1);
|
||||
JobInstance tempJob = (JobInstance) jobs.get(0);
|
||||
assertTrue(jobInstance.equals(tempJob));
|
||||
assertEquals(jobParameters, tempJob.getJobInstanceProperties());
|
||||
assertEquals(jobParameters, tempJob.getJobParameters());
|
||||
}
|
||||
|
||||
public void testFindJobWithNullRuntime() {
|
||||
@@ -138,7 +138,7 @@ public abstract class AbstractJobDaoTests extends
|
||||
jobs = jobDao.findJobInstances("ScheduledJob", jobParameters);
|
||||
assertEquals(1, jobs.size());
|
||||
JobInstance jobInstance = (JobInstance) jobs.get(0);
|
||||
assertEquals(jobParameters, jobInstance.getJobInstanceProperties());
|
||||
assertEquals(jobParameters, jobInstance.getJobParameters());
|
||||
|
||||
jobs = jobDao.findJobInstances("ScheduledJob", tempProps);
|
||||
assertEquals(0, jobs.size());
|
||||
@@ -263,7 +263,7 @@ public abstract class AbstractJobDaoTests extends
|
||||
|
||||
assertEquals(1, jobs.size());
|
||||
assertEquals(jobParameters.getString("job.key"), ((JobInstance) jobs.get(0))
|
||||
.getJobInstanceProperties().getString("job.key"));
|
||||
.getJobParameters().getString("job.key"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user