Tidy up some exception class names
This commit is contained in:
@@ -17,7 +17,7 @@ package org.springframework.batch.core.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.io.exception.InfrastructureException;
|
||||
|
||||
/**
|
||||
* Batch domain object representing a job. Job is an explicit abstraction
|
||||
@@ -43,8 +43,8 @@ public interface Job {
|
||||
* and statistics as necessary.
|
||||
*
|
||||
* @param execution a {@link JobExecution}
|
||||
* @throws BatchCriticalException
|
||||
* @throws InfrastructureException
|
||||
*/
|
||||
void execute(JobExecution execution) throws BatchCriticalException;
|
||||
void execute(JobExecution execution) throws InfrastructureException;
|
||||
|
||||
}
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.io.exception.InfrastructureException;
|
||||
|
||||
/**
|
||||
* Exception to indicate the the job has been interrupted. The exception state
|
||||
* indicated is not normally recoverable by batch application clients, but
|
||||
* internally it is useful to force a check. The exception will often be wrapped
|
||||
* in a runtime exception (usually {@link BatchCriticalException} before
|
||||
* in a runtime exception (usually {@link InfrastructureException} before
|
||||
* reaching the client.
|
||||
*
|
||||
* @author Lucas Ward
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.io.exception.InfrastructureException;
|
||||
|
||||
/**
|
||||
* Batch domain interface representing the configuration of a step. As with the
|
||||
@@ -57,9 +57,9 @@ public interface Step {
|
||||
* @param stepExecution an entity representing the step to be executed
|
||||
*
|
||||
* @throws JobInterruptedException if the step is interrupted externally
|
||||
* @throws BatchCriticalException if there is a problem that needs to be
|
||||
* @throws InfrastructureException if there is a problem that needs to be
|
||||
* signalled to the caller
|
||||
*/
|
||||
void execute(StepExecution stepExecution) throws JobInterruptedException, BatchCriticalException;
|
||||
void execute(StepExecution stepExecution) throws JobInterruptedException, InfrastructureException;
|
||||
|
||||
}
|
||||
@@ -61,10 +61,12 @@ public interface JobRepository {
|
||||
* @throws JobExecutionAlreadyRunningException if there is a
|
||||
* {@link JobExecution} alrady running for the job instance that would
|
||||
* otherwise be returned
|
||||
* @throws JobRestartException if more than one JobInstance if found or if
|
||||
* JobInstance.getJobExecutionCount() is greater than Job.getStartLimit()
|
||||
*
|
||||
*/
|
||||
public JobExecution createJobExecution(Job job, JobParameters jobParameters)
|
||||
throws JobExecutionAlreadyRunningException;
|
||||
throws JobExecutionAlreadyRunningException, JobRestartException;
|
||||
|
||||
/**
|
||||
* Save or Update a {@link JobExecution}. If no ID is found a new instance
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
*/
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
|
||||
/**
|
||||
* An exception indicating an illegal attempt to restart a job.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class BatchRestartException extends BatchCriticalException {
|
||||
public class JobRestartException extends JobException {
|
||||
|
||||
/**
|
||||
* @param string the message
|
||||
*/
|
||||
public BatchRestartException(String string) {
|
||||
public JobRestartException(String string) {
|
||||
super(string);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class BatchRestartException extends BatchCriticalException {
|
||||
* @param msg the cause
|
||||
* @param t the message
|
||||
*/
|
||||
public BatchRestartException(String msg, Throwable t) {
|
||||
public JobRestartException(String msg, Throwable t) {
|
||||
super(msg, t);
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
/**
|
||||
* This exception identifies that a batch domain object is invalid, which
|
||||
* is generally caused by an invalid ID. (An ID which doesn't exist in the database).
|
||||
*
|
||||
* @author Lucas Ward
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class NoSuchBatchDomainObjectException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 4399621765157283111L;
|
||||
|
||||
public NoSuchBatchDomainObjectException(String message){
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user