1 package org.mr.core.util.patterns.flow; 2 3 import java.util.Map ; 4 5 50 51 58 public class DefaultFlowFramework implements FlowFramework{ 59 60 protected Flow m_flow = null; 61 62 public void setFlow(Flow i_flow){ 63 m_flow = i_flow; 64 } 65 66 public Map execute(Map i_map) { 67 Declaration next = null; 68 69 for (int i=1; true ; i++) { 71 next = m_flow.getNextStep(next,i_map); 72 if(next == null){ 73 postExecution(i_map, i); 74 break; 75 } 76 preSingleExecute(next, i_map, i); 77 i_map = next.execute(i_map); 78 postSingleExecute(next, i_map, i); 79 } 80 return i_map; 81 } 82 83 89 protected void preSingleExecute(Declaration i_current, Map i_map, int i_orderMunber){ 90 } 91 92 98 protected void postSingleExecute(Declaration i_current, Map i_map, int i_orderMunber){ 99 } 100 101 106 protected void postExecution(Map i_map, int i_totalExecutions){ 107 } 108 } 109 | Popular Tags |