IN PROGRESS - issue BATCH-7: Remove transaction synchronization and state management from input/output sources (formerly buffering)

http://jira.springframework.org/browse/BATCH-7

Lazy-initialisation solution to the "who's in step scope" issue
This commit is contained in:
dsyer
2008-01-31 09:54:38 +00:00
parent 9d1ebb42c7
commit 15cffeb925
66 changed files with 653 additions and 761 deletions

View File

@@ -43,7 +43,7 @@ public interface Step {
* Flag to indicate if restart data needs to be saved for this step.
* @return true if restart data should be saved
*/
boolean isSaveRestartData();
boolean isSaveStreamContext();
/**
* @return the number of times a job can be started with the same

View File

@@ -87,11 +87,11 @@ public class StepInstance extends Entity {
this.stepExecutionCount = stepExecutionCount;
}
public StreamContext getRestartData() {
public StreamContext getStreamContext() {
return streamContext;
}
public void setRestartData(StreamContext streamContext) {
public void setStreamContext(StreamContext streamContext) {
this.streamContext = streamContext;
}

View File

@@ -34,7 +34,7 @@ public class StepSupport implements Step, BeanNameAware {
private boolean allowStartIfComplete;
private boolean saveRestartData = false;
private boolean saveStreamContext = false;
/**
* Default constructor for {@link StepSupport}.
@@ -121,12 +121,12 @@ public class StepSupport implements Step, BeanNameAware {
this.allowStartIfComplete = allowStartIfComplete;
}
public void setSaveRestartData(boolean saveRestartData) {
this.saveRestartData = saveRestartData;
public void setSaveStreamContext(boolean saveStreamContext) {
this.saveStreamContext = saveStreamContext;
}
public boolean isSaveRestartData() {
return saveRestartData;
public boolean isSaveStreamContext() {
return saveStreamContext;
}
/**

View File

@@ -22,14 +22,16 @@ import org.springframework.batch.core.domain.JobInstance;
import org.springframework.batch.core.domain.JobParameters;
import org.springframework.batch.core.domain.StepExecution;
import org.springframework.batch.core.domain.StepInstance;
import org.springframework.batch.item.StreamContext;
/**
* <p>
* Repository for storing batch jobs and steps. Before using any methods, a Job
* must first be obtained using the findOrCreateJob method. Once a Job and it's
* related steps are obtained, they can be updated. It should be noted that any
* reconstituted steps are expected to contain restart data <strong>if the
* RestartPolicy associated with the step returns true, and RestartData exists.</strong>
* reconstituted steps are expected to contain restart data <strong>if the step
* says it wants to be restored after a restart, and {@link StreamContext}
* exists.</strong>
* </p>
*
* Once a Job/Steps has been created, Job and Step executions can be created and
@@ -47,23 +49,21 @@ import org.springframework.batch.core.domain.StepInstance;
public interface JobRepository {
/**
* Find or create a job execution for a given {@link JobIdentifier} and configuration.
* If the job that is uniquely identified by {@link JobIdentifier} already
* exists, its persisted values (including ID) will be returned in a new
* {@link JobInstance} object. If no previous run is found, a new job will
* be created and returned.
* Find or create a job execution for a given {@link JobIdentifier} and
* configuration. If the job that is uniquely identified by
* {@link JobIdentifier} already exists, its persisted values (including ID)
* will be returned in a new {@link JobInstance} object. If no previous run
* is found, a new job will be created and returned.
* @param jobParameters the runtime parameters for the job
* @param jobConfiguration
* describes the configuration for this job
* @param jobConfiguration describes the configuration for this job
*
* @return a valid job execution for the identifier provided
* @throws JobExecutionAlreadyRunningException
* if there is a {@link JobExecution} alrady running for the
* job instance that would otherwise be returned
* @throws JobExecutionAlreadyRunningException if there is a
* {@link JobExecution} alrady running for the job instance that would
* otherwise be returned
*
*/
public JobExecution createJobExecution(Job job,
JobParameters jobParameters)
public JobExecution createJobExecution(Job job, JobParameters jobParameters)
throws JobExecutionAlreadyRunningException;
/**