1 4 package net.sf.mybatchfwk.test; 5 6 import net.sf.mybatchfwk.BatchConfiguration; 7 import net.sf.mybatchfwk.BatchException; 8 import net.sf.mybatchfwk.ExecutionReport; 9 import net.sf.mybatchfwk.IBatch; 10 import net.sf.mybatchfwk.ITask; 11 import net.sf.mybatchfwk.ITaskExecutor; 12 13 public class SimpleBatch implements IBatch { 14 15 public void init(BatchConfiguration configuration) throws BatchException { 16 17 } 18 19 public void execute(ITaskExecutor executor) throws BatchException { 20 int i = 0; 21 while ((i++ < 5) && (executor.isRunning())) { 22 executor.execute(new SimpleTask(i)); 23 } 24 } 25 26 public void pause() throws BatchException { 27 28 } 29 30 public void resume() throws BatchException { 31 32 } 33 34 public void end(ExecutionReport report) throws BatchException { 35 36 } 37 38 public void endOfExecution(ITask task, Throwable exception) { 39 40 } 41 42 public void manageFatalError(ExecutionReport report, Throwable throwable) { 43 44 } 45 } 46 | Popular Tags |