OPEN - issue BATCH-378: RepeatListener is confusing and too generic to use for 'intercepting' a step

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

No need for setListener() methods.
This commit is contained in:
dsyer
2008-02-29 13:44:16 +00:00
parent 256574358b
commit 3c981017cd
12 changed files with 10 additions and 24 deletions

View File

@@ -57,10 +57,6 @@ public class SimpleJob extends AbstractJob {
}
}
public void setListener(JobListener listener) {
this.listener.register(listener);
}
/**
* Run the specified job by looping through the steps and delegating to the
* {@link Step}.

View File

@@ -116,15 +116,6 @@ public class ItemOrientedStep extends AbstractStep implements InitializingBean {
listener.register(listeners[i]);
}
}
/**
* Register the objects as a listener.
* @see #setListeners(Object[])
* @param listener the listener to set
*/
public void setListener(Object listener) {
this.listener.register(listener);
}
/**
* The {@link RepeatOperations} to use for the outer loop of the batch

View File

@@ -141,14 +141,14 @@ public class SimpleJobTests extends TestCase {
}
public void testRunNormallyWithListener() throws Exception {
job.setListener(new JobListenerSupport() {
job.setListeners(new JobListenerSupport[] {new JobListenerSupport() {
public void beforeJob(JobExecution jobExecution) {
list.add("before");
}
public void afterJob() {
list.add("after");
}
});
}});
job.execute(jobExecution);
assertEquals(4, list.size());
}