org.springframework.batch.core.repository.dao
Class MapJobExecutionDao

java.lang.Object
  extended by org.springframework.batch.core.repository.dao.MapJobExecutionDao
All Implemented Interfaces:
JobExecutionDao

public class MapJobExecutionDao
extends Object
implements JobExecutionDao

In-memory implementation of JobExecutionDao.


Constructor Summary
MapJobExecutionDao()
           
 
Method Summary
 void clear()
           
 List<JobExecution> findJobExecutions(JobInstance jobInstance)
          Return all JobExecution for given JobInstance, sorted backwards by creation order (so the first element is the most recent).
 Set<JobExecution> findRunningJobExecutions(String jobName)
           
 JobExecution getJobExecution(Long executionId)
           
 JobExecution getLastJobExecution(JobInstance jobInstance)
          Find the last JobExecution to have been created for a given JobInstance.
 void saveJobExecution(JobExecution jobExecution)
          Save a new JobExecution.
 void synchronizeStatus(JobExecution jobExecution)
          Because it may be possible that the status of a JobExecution is updated while running, the following method will synchronize only the status and version fields.
 void updateJobExecution(JobExecution jobExecution)
          Update and existing JobExecution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapJobExecutionDao

public MapJobExecutionDao()
Method Detail

clear

public void clear()

saveJobExecution

public void saveJobExecution(JobExecution jobExecution)
Description copied from interface: JobExecutionDao
Save a new JobExecution. Preconditions: jobInstance the jobExecution belongs to must have a jobInstanceId.

Specified by:
saveJobExecution in interface JobExecutionDao

findJobExecutions

public List<JobExecution> findJobExecutions(JobInstance jobInstance)
Description copied from interface: JobExecutionDao
Return all JobExecution for given JobInstance, sorted backwards by creation order (so the first element is the most recent).

Specified by:
findJobExecutions in interface JobExecutionDao

updateJobExecution

public void updateJobExecution(JobExecution jobExecution)
Description copied from interface: JobExecutionDao
Update and existing JobExecution. Preconditions: jobExecution must have an Id (which can be obtained by the save method) and a jobInstanceId.

Specified by:
updateJobExecution in interface JobExecutionDao

getLastJobExecution

public JobExecution getLastJobExecution(JobInstance jobInstance)
Description copied from interface: JobExecutionDao
Find the last JobExecution to have been created for a given JobInstance.

Specified by:
getLastJobExecution in interface JobExecutionDao
Parameters:
jobInstance - the JobInstance
Returns:
the last JobExecution to execute for this instance

findRunningJobExecutions

public Set<JobExecution> findRunningJobExecutions(String jobName)
Specified by:
findRunningJobExecutions in interface JobExecutionDao
Returns:
all JobExecution that are still running (or indeterminate state), i.e. having null end date, for the specified job name.

getJobExecution

public JobExecution getJobExecution(Long executionId)
Specified by:
getJobExecution in interface JobExecutionDao
Returns:
the JobExecution for given identifier.

synchronizeStatus

public void synchronizeStatus(JobExecution jobExecution)
Description copied from interface: JobExecutionDao
Because it may be possible that the status of a JobExecution is updated while running, the following method will synchronize only the status and version fields.

Specified by:
synchronizeStatus in interface JobExecutionDao
Parameters:
jobExecution - to be updated.


Copyright © 2013 SpringSource. All Rights Reserved.