1 18 package net.sf.mybatchfwk.history; 19 20 import java.util.Iterator ; 21 import java.util.List ; 22 import java.util.Vector ; 23 24 import net.sf.mybatchfwk.BatchConfiguration; 25 import net.sf.mybatchfwk.BatchException; 26 27 35 public class MemoryExecutionHistory implements IExecutionHistory { 36 37 protected List <String > completedTasksList; 38 protected List <String > failedTasksList; 39 40 43 public void initStorage(BatchConfiguration configuration) throws BatchException { 44 completedTasksList = new Vector <String >(); 45 failedTasksList = new Vector <String >(); 46 } 47 48 51 public void closeStorage() throws BatchException { 52 } 53 54 57 public Iterator completedTasksIdIterator() throws BatchException { 58 return completedTasksList.iterator(); 59 } 60 61 64 public Iterator failedTasksIdIterator() throws BatchException { 65 return failedTasksList.iterator(); 66 } 67 68 71 public boolean isCompletedTask(String id) throws BatchException { 72 return completedTasksList.contains(id); 73 } 74 75 78 public boolean isFailedTask(String id) throws BatchException { 79 return failedTasksList.contains(id); 80 } 81 82 85 public void storeCompletedTaskId(String id) throws BatchException { 86 completedTasksList.add(id); 87 } 88 89 92 public void storeFailedTaskId(String id) throws BatchException { 93 failedTasksList.add(id); 94 } 95 } 96 | Popular Tags |