Tidy up some exception class names

This commit is contained in:
dsyer
2008-03-01 11:59:33 +00:00
parent 90cb1e8ea3
commit b47a6e6405
51 changed files with 167 additions and 259 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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);
}
}