diff --git a/core/src/main/java/org/springframework/batch/core/executor/AbstractJobExecutor.java b/core/src/main/java/org/springframework/batch/core/executor/AbstractJobExecutor.java deleted file mode 100644 index 12eb20446..000000000 --- a/core/src/main/java/org/springframework/batch/core/executor/AbstractJobExecutor.java +++ /dev/null @@ -1,51 +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.executor; - -import org.springframework.batch.core.configuration.JobConfiguration; -import org.springframework.batch.core.domain.JobExecution; -import org.springframework.batch.io.exception.BatchCriticalException; -import org.springframework.batch.repeat.ExitStatus; - -/** - * Support class with empty implementations of interface methods. - * - * @author Dave Syer - * - */ -public abstract class AbstractJobExecutor implements JobExecutor { - - /** - * Wraps a call to {@link #run(JobConfiguration, JobExecution)} with a call - * to the listener's before and after methods. The after listener is also - * executed in a finally block. - * - * @see org.springframework.batch.core.executor.JobExecutor#run(org.springframework.batch.core.configuration.JobConfiguration, - * org.springframework.batch.core.domain.JobExecution, - * org.springframework.batch.core.executor.JobExecutionListener) - */ - public final ExitStatus run(JobConfiguration configuration, - JobExecution execution, JobExecutionListener listener) - throws BatchCriticalException { - listener.before(execution); - try { - return this.run(configuration, execution); - } finally { - listener.after(execution); - } - } - -} diff --git a/core/src/main/java/org/springframework/batch/core/executor/JobExecutionListener.java b/core/src/main/java/org/springframework/batch/core/executor/JobExecutionListener.java deleted file mode 100644 index c3014394e..000000000 --- a/core/src/main/java/org/springframework/batch/core/executor/JobExecutionListener.java +++ /dev/null @@ -1,43 +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.executor; - -import org.springframework.batch.core.domain.JobExecution; - -/** - * Listener interface for the job execution lifecycle. - * - * @author Dave Syer - * - */ -public interface JobExecutionListener { - - /** - * Callback for the start of a job, before any steps are processed. - * - * @param execution - * the current {@link JobExecution} - */ - void before(JobExecution execution); - - /** - * Callback for the start of a job, after all steps are processed, or on an - * error. - * - * @param execution - */ - void after(JobExecution execution); -} diff --git a/core/src/main/java/org/springframework/batch/core/executor/JobExecutionListenerSupport.java b/core/src/main/java/org/springframework/batch/core/executor/JobExecutionListenerSupport.java deleted file mode 100644 index c5ad2faab..000000000 --- a/core/src/main/java/org/springframework/batch/core/executor/JobExecutionListenerSupport.java +++ /dev/null @@ -1,47 +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.executor; - -import org.springframework.batch.core.domain.JobExecution; - -/** - * Simple no-op implementation of {@link JobExecutionListener} which does - * nothing. - * - * @author Dave Syer - * - */ -public class JobExecutionListenerSupport implements JobExecutionListener { - - /** - * No-op for subclasses to extend. - * - * @see org.springframework.batch.core.executor.JobExecutionListener#after(org.springframework.batch.core.domain.JobExecution) - */ - public void after(JobExecution execution) { - // no-op - } - - /** - * No-op for subclasses to extend. - * - * @see org.springframework.batch.core.executor.JobExecutionListener#before(org.springframework.batch.core.domain.JobExecution) - */ - public void before(JobExecution execution) { - // no-op - } - -} diff --git a/core/src/main/java/org/springframework/batch/core/executor/JobExecutor.java b/core/src/main/java/org/springframework/batch/core/executor/JobExecutor.java index 5a4deb8f1..b2e8a81c1 100644 --- a/core/src/main/java/org/springframework/batch/core/executor/JobExecutor.java +++ b/core/src/main/java/org/springframework/batch/core/executor/JobExecutor.java @@ -33,5 +33,4 @@ public interface JobExecutor { public ExitStatus run(JobConfiguration configuration, JobExecution execution) throws BatchCriticalException; - public ExitStatus run(JobConfiguration configuration, JobExecution execution, JobExecutionListener listener) throws BatchCriticalException; } diff --git a/core/src/test/java/org/springframework/batch/core/executor/JobExecutionListenerSupportTests.java b/core/src/test/java/org/springframework/batch/core/executor/JobExecutionListenerSupportTests.java deleted file mode 100644 index 56ca5e9dc..000000000 --- a/core/src/test/java/org/springframework/batch/core/executor/JobExecutionListenerSupportTests.java +++ /dev/null @@ -1,65 +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.executor; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; - -import org.springframework.batch.core.domain.JobExecution; - -/** - * @author Dave Syer - * - */ -public class JobExecutionListenerSupportTests extends TestCase { - - private List list = new ArrayList(); - - /** - * Test method for - * {@link org.springframework.batch.core.executor.JobExecutionListenerSupport#after(org.springframework.batch.core.domain.JobExecution)}. - */ - public void testAfter() { - JobExecutionListener listener = new JobExecutionListenerSupport() { - public void after(JobExecution execution) { - super.after(execution); - list.add("after"); - } - }; - - listener.after(null); - assertEquals(1, list.size()); - } - - /** - * Test method for - * {@link org.springframework.batch.core.executor.JobExecutionListenerSupport#before(org.springframework.batch.core.domain.JobExecution)}. - */ - public void testBefore() { - JobExecutionListener listener = new JobExecutionListenerSupport() { - public void before(JobExecution execution) { - super.before(execution); - list.add("after"); - } - }; - - listener.before(null); - assertEquals(1, list.size()); - } - -}