use of org.springframework.batch.core.BatchStatus in project head by mifos.
the class MifosBatchJob method launchJob.
/**
* A method responsible for the actual launch of the Spring Batch job.
* @param job Job class
* @param jobParameters Job parameters
* @return Batch computation status
* @throws BatchJobException when something goes wrong
*/
private BatchStatus launchJob(Job job, JobParameters jobParameters) throws BatchJobException {
BatchStatus exitStatus = BatchStatus.UNKNOWN;
JobExecution jobExecution = null;
try {
batchJobStarted();
requiresExclusiveAccess();
jobExecution = jobLauncher.run(job, jobParameters);
exitStatus = jobExecution.getStatus();
} catch (JobInstanceAlreadyCompleteException jiace) {
exitStatus = BatchStatus.COMPLETED;
return exitStatus;
} catch (Exception ex) {
throw new BatchJobException(ex);
} finally {
batchJobFinished();
}
return exitStatus;
}
use of org.springframework.batch.core.BatchStatus in project pinpoint by naver.
the class AlarmJobTest method main.
public static void main(String[] args) throws Exception {
GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext("/applicationContext-test.xml");
JobLauncherTestUtils testLauncher = applicationContext.getBean(JobLauncherTestUtils.class);
JobExecution jobExecution = testLauncher.launchJob(getParameters());
BatchStatus status = jobExecution.getStatus();
assertEquals(BatchStatus.COMPLETED, status);
applicationContext.close();
}
use of org.springframework.batch.core.BatchStatus in project pinpoint by naver.
the class AlarmJobTest method main.
public static void main(String[] args) throws Exception {
GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext("/applicationContext-test.xml");
JobLauncherTestUtils testLauncher = applicationContext.getBean(JobLauncherTestUtils.class);
JobExecution jobExecution = testLauncher.launchJob(getParameters());
BatchStatus status = jobExecution.getStatus();
assertEquals(BatchStatus.COMPLETED, status);
applicationContext.close();
}
Aggregations