1 package org.sapia.soto.state; 2 3 import java.util.ArrayList ; 4 import java.util.List ; 5 6 7 17 public class ExecContainer { 18 protected List _execs = new ArrayList (); 19 20 public ExecContainer() { 21 } 22 23 28 public void addExecutable(Executable exec) { 29 _execs.add(exec); 30 } 31 32 35 public void execute(Result st) { 36 Step step; 37 38 for (int i = 0; i < _execs.size(); i++) { 39 step = (Step) _execs.get(i); 40 step.execute(st); 41 42 if (st.isError()) { 43 handleError(st); 44 45 return; 46 } else if (st.isAborted()) { 47 return; 48 } else if (st.getNextStateId() != null) { 49 return; 50 } 51 } 52 53 handleSuccess(st); 54 } 55 56 62 protected void handleError(Result st) { 63 } 64 65 72 protected void handleSuccess(Result st) { 73 } 74 } 75 | Popular Tags |