REOPENED - issue BATCH-472: Exceeding the start limit on a step will cause a vague exception type to be thrown.

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

StartLimitExceededException made public and moved to core package. The constructor changed to simply accept string.
This commit is contained in:
robokaso
2008-03-19 09:31:10 +00:00
parent 16f0b60532
commit 1851025c54
4 changed files with 15 additions and 16 deletions

View File

@@ -0,0 +1,11 @@
package org.springframework.batch.core;
/**
* Indicates the step's start limit has been exceeded.
*/
public class StartLimitExceededException extends RuntimeException {
public StartLimitExceededException(String message) {
super(message);
}
}

View File

@@ -21,6 +21,7 @@ import java.util.Iterator;
import java.util.List;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.StartLimitExceededException;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionException;
@@ -198,7 +199,8 @@ public class SimpleJob extends AbstractJob {
}
else {
// start max has been exceeded, throw an exception.
throw new StartLimitExceededException(step);
throw new StartLimitExceededException("Maximum start limit exceeded for step: " + step.getName()
+ "StartMax: " + step.getStartLimit());
}
}

View File

@@ -1,15 +0,0 @@
package org.springframework.batch.core.job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.UnexpectedJobExecutionException;
/**
* Indicates the step's start limit has been exceeded.
*/
class StartLimitExceededException extends UnexpectedJobExecutionException {
public StartLimitExceededException(Step step) {
super("Maximum start limit exceeded for step: " + step.getName()
+ "StartMax: " + step.getStartLimit());
}
}