Commit 88c4b1b000d05d42d401c6af49b62343936fc454
1 parent
ab936f84
Exists in
AFDemo_Timeout_Ex2
Time out Flow2
Showing
3 changed files
with
41 additions
and
12 deletions
Show diff stats
AF-Demo/src/af/state/StateIdle.java
... | ... | @@ -53,12 +53,19 @@ public class StateIdle implements IAFState { |
53 | 53 | this.eqxState = AFState.W_E01Res; |
54 | 54 | }*/ |
55 | 55 | ArrayList<EQXRawInstance> eqxRawList = new ArrayList<EQXRawInstance>(); |
56 | + | |
57 | + EQXRawInstance eqxRawB1 = new EQXRawInstance(); | |
58 | + eqxRawB1.setMessage("B1 Req."); | |
59 | + eqxRawB1.setTo(abstractAF.getUtils().getHmWarmConfig().get("Resource-Name-B").get(0)); | |
60 | + eqxRawB1.setCtype(EQXMsg.TEXTXML); | |
61 | + eqxRawList.add(eqxRawB1); | |
62 | + | |
63 | + EQXRawInstance eqxRawB2 = new EQXRawInstance(); | |
64 | + eqxRawB2.setMessage("B2 Req."); | |
65 | + eqxRawB2.setTo(abstractAF.getUtils().getHmWarmConfig().get("Resource-Name-B").get(0)); | |
66 | + eqxRawB2.setCtype(EQXMsg.TEXTXML); | |
67 | + eqxRawList.add(eqxRawB2); | |
56 | 68 | |
57 | - EQXRawInstance eqxRaw = new EQXRawInstance(); | |
58 | - eqxRaw.setMessage("B Req."); | |
59 | - eqxRaw.setTo(abstractAF.getUtils().getHmWarmConfig().get("Resource-Name-B").get(0)); | |
60 | - eqxRaw.setCtype(EQXMsg.TEXTXML); | |
61 | - eqxRawList.add(eqxRaw); | |
62 | 69 | ArrayList<EquinoxRawData> rawList = this.ec02Builder.getBRequest(eqxRawList); |
63 | 70 | for (int i = 0; i < rawList.size(); i++) { |
64 | 71 | this.eqxRawDataList.add(rawList.get(i)); | ... | ... |
AF-Demo/src/af/state/StateWaitA.java
... | ... | @@ -43,15 +43,29 @@ public class StateWaitA implements IAFState { |
43 | 43 | * EQXRawInstance(); eqxRaw.setMessage(message.trim()); |
44 | 44 | * eqxRaw.setTo(ec02Ins.getAFInstance().getOrig()); |
45 | 45 | * eqxRaw.setCtype(EQXMsg.TEXTPLAIN); |
46 | + * | |
46 | 47 | * this.eqxRawDataList.add(this.ec02Builder.getHTTPResponse(eqxRaw)) |
47 | 48 | * ; this.eqxState = AFState.IDLE; } else { |
48 | 49 | * |
49 | 50 | * } } |
50 | 51 | */ |
52 | + | |
51 | 53 | |
52 | - ArrayList<EQXRawInstance> eqxRawList = new ArrayList<EQXRawInstance>(); | |
54 | + for(int i=0;i<ec02Ins.getAFInstance().getTimeout().size();i++){ | |
55 | + if(ec02Ins.getAFInstance().getTimeout().get(i).getInvoke().equals(eqxRawData.getInvoke())){ | |
56 | + ec02Ins.getAFInstance().getTimeout().remove(i); | |
57 | + } | |
58 | + } | |
59 | + if(ec02Ins.getAFInstance().getTimeout().size()!=0){ | |
60 | + this.eqxRawDataList=ec02Ins.getAFInstance().getTimeout(); | |
61 | + this.eqxState = AFState.W_CRes; | |
62 | + } | |
63 | + else{ | |
64 | + this.eqxState = AFState.W_CRes; | |
65 | + } | |
66 | + //ArrayList<EQXRawInstance> eqxRawList = new ArrayList<EQXRawInstance>(); | |
53 | 67 | |
54 | - EQXRawInstance eqxRaw = new EQXRawInstance(); | |
68 | + /*EQXRawInstance eqxRaw = new EQXRawInstance(); | |
55 | 69 | eqxRaw.setMessage("C Req."); |
56 | 70 | eqxRaw.setTo(abstractAF.getUtils().getHmWarmConfig().get("Resource-Name-C").get(0)); |
57 | 71 | eqxRaw.setCtype(EQXMsg.TEXTXML); |
... | ... | @@ -59,10 +73,7 @@ public class StateWaitA implements IAFState { |
59 | 73 | ArrayList<EquinoxRawData> rawList = this.ec02Builder.getBRequest(eqxRawList); |
60 | 74 | for (int i = 0; i < rawList.size(); i++) { |
61 | 75 | this.eqxRawDataList.add(rawList.get(i)); |
62 | - } | |
63 | - | |
64 | - this.eqxState = AFState.W_CRes; | |
65 | - | |
76 | + }*/ | |
66 | 77 | } |
67 | 78 | } |
68 | 79 | ... | ... |
AF-Demo/src/af/state/StateWaitC.java
... | ... | @@ -46,13 +46,24 @@ public class StateWaitC implements IAFState { |
46 | 46 | * |
47 | 47 | * } } |
48 | 48 | */ |
49 | - AppLog.d("THAT INVOKE --->"+ec02Ins.getAFInstance().getInvoke()); | |
49 | + for(int i=0;i<ec02Ins.getAFInstance().getTimeout().size();i++){ | |
50 | + if(ec02Ins.getAFInstance().getTimeout().get(i).getInvoke().equals(eqxRawData.getInvoke())){ | |
51 | + ec02Ins.getAFInstance().getTimeout().remove(i); | |
52 | + } | |
53 | + } | |
54 | + | |
55 | + if(ec02Ins.getAFInstance().getTimeout().size()!=0){ | |
56 | + this.eqxRawDataList=ec02Ins.getAFInstance().getTimeout(); | |
57 | + eqxState = ec02Ins.getAFInstance().getState(); | |
58 | + } | |
59 | + else{ | |
50 | 60 | EQXRawInstance eqxRaw = new EQXRawInstance(); |
51 | 61 | eqxRaw.setMessage("A Res."); |
52 | 62 | eqxRaw.setTo(ec02Ins.getAFInstance().getOrig()); |
53 | 63 | eqxRaw.setCtype(EQXMsg.TEXTPLAIN); |
54 | 64 | this.eqxRawDataList.add(this.ec02Builder.getHTTPResponse(eqxRaw,ec02Ins.getAFInstance().getInvoke())); |
55 | 65 | this.eqxState = AFState.IDLE; |
66 | + } | |
56 | 67 | } |
57 | 68 | } |
58 | 69 | ec02Ins.setEqxRawDataList(this.eqxRawDataList); | ... | ... |