Commit 72f9d45b06d80926cd980635ad9d8fbc4819ba9d
1 parent
2608e455
Exists in
AFDemo_Timeout_Ex3
time out ex.3 ยังติดขาแรก (to)
Showing
2 changed files
with
10 additions
and
20 deletions
Show diff stats
AF-Demo/src/af/state/StateIdle.java
| @@ -24,6 +24,9 @@ public class StateIdle implements IAFState { | @@ -24,6 +24,9 @@ public class StateIdle implements IAFState { | ||
| 24 | EC02Instance ec02Ins = (EC02Instance) instance; | 24 | EC02Instance ec02Ins = (EC02Instance) instance; |
| 25 | if(ec02Ins.getAFInstance().getInvoke()!=null){ | 25 | if(ec02Ins.getAFInstance().getInvoke()!=null){ |
| 26 | for(EquinoxRawData eqxRawData : eqxRawDataList){ | 26 | for(EquinoxRawData eqxRawData : eqxRawDataList){ |
| 27 | + this.ec02Builder.setEquinoxRawData(eqxRawData, abstractAF, ec02Ins); | ||
| 28 | + ec02Ins.getAFInstance().setInvoke(eqxRawData.getInvoke()); | ||
| 29 | + ec02Ins.getAFInstance().setOrig(eqxRawData.getRawDataAttribute(EQXMsg.ORIG)); | ||
| 27 | EQXRawInstance eqxRaw = new EQXRawInstance(); | 30 | EQXRawInstance eqxRaw = new EQXRawInstance(); |
| 28 | eqxRaw.setMessage("Already in use!"); | 31 | eqxRaw.setMessage("Already in use!"); |
| 29 | eqxRaw.setTo(ec02Ins.getAFInstance().getOrig()); | 32 | eqxRaw.setTo(ec02Ins.getAFInstance().getOrig()); |
| @@ -78,7 +81,6 @@ public class StateIdle implements IAFState { | @@ -78,7 +81,6 @@ public class StateIdle implements IAFState { | ||
| 78 | ec02Ins.setEqxRawDataList(this.eqxRawDataList); | 81 | ec02Ins.setEqxRawDataList(this.eqxRawDataList); |
| 79 | ec02Ins.getAFInstance().setTimeout(this.eqxRawDataList); | 82 | ec02Ins.getAFInstance().setTimeout(this.eqxRawDataList); |
| 80 | ec02Ins.getAFInstance().setState(eqxState); | 83 | ec02Ins.getAFInstance().setState(eqxState); |
| 81 | - ec02Ins.getAFInstance().setTime(date); | ||
| 82 | return this.eqxState; | 84 | return this.eqxState; |
| 83 | } | 85 | } |
| 84 | 86 |
AF-Demo/src/af/state/StateWaitA.java
| @@ -22,14 +22,9 @@ public class StateWaitA implements IAFState { | @@ -22,14 +22,9 @@ public class StateWaitA implements IAFState { | ||
| 22 | @Override | 22 | @Override |
| 23 | public String doAction(AbstractAF abstractAF, Object instance, ArrayList<EquinoxRawData> eqxRawDataList) { | 23 | public String doAction(AbstractAF abstractAF, Object instance, ArrayList<EquinoxRawData> eqxRawDataList) { |
| 24 | EC02Instance ec02Ins = (EC02Instance) instance; | 24 | EC02Instance ec02Ins = (EC02Instance) instance; |
| 25 | - AppLog.d("######"+ec02Ins.getAFInstance().getTime()); | ||
| 26 | if(ec02Ins.getEquinoxProperties().getDiag().equals("Timeout")){ | 25 | if(ec02Ins.getEquinoxProperties().getDiag().equals("Timeout")){ |
| 27 | this.eqxRawDataList=ec02Ins.getAFInstance().getTimeout(); | 26 | this.eqxRawDataList=ec02Ins.getAFInstance().getTimeout(); |
| 28 | eqxState = ec02Ins.getAFInstance().getState(); | 27 | eqxState = ec02Ins.getAFInstance().getState(); |
| 29 | - date = new Date(); | ||
| 30 | - long seconds = (date.getTime()-ec02Ins.getAFInstance().getTime().getTime())/1000; | ||
| 31 | - AppLog.d("Defferent Time: "+seconds); | ||
| 32 | - | ||
| 33 | } | 28 | } |
| 34 | else{ | 29 | else{ |
| 35 | for (EquinoxRawData eqxRawData : eqxRawDataList) { | 30 | for (EquinoxRawData eqxRawData : eqxRawDataList) { |
| @@ -53,21 +48,14 @@ public class StateWaitA implements IAFState { | @@ -53,21 +48,14 @@ public class StateWaitA implements IAFState { | ||
| 53 | 48 | ||
| 54 | ArrayList<EQXRawInstance> eqxRawList = new ArrayList<EQXRawInstance>(); | 49 | ArrayList<EQXRawInstance> eqxRawList = new ArrayList<EQXRawInstance>(); |
| 55 | 50 | ||
| 56 | - EQXRawInstance eqxRaw = new EQXRawInstance(); | ||
| 57 | - eqxRaw.setMessage("C Req."); | ||
| 58 | - eqxRaw.setTo(abstractAF.getUtils().getHmWarmConfig().get("Resource-Name-C").get(0)); | ||
| 59 | - eqxRaw.setCtype(EQXMsg.TEXTXML); | ||
| 60 | - eqxRawList.add(eqxRaw); | ||
| 61 | - ArrayList<EquinoxRawData> rawList = this.ec02Builder.getBRequest(eqxRawList); | ||
| 62 | - for (int i = 0; i < rawList.size(); i++) { | ||
| 63 | - this.eqxRawDataList.add(rawList.get(i)); | ||
| 64 | - } | ||
| 65 | - date = new Date(); | ||
| 66 | - | ||
| 67 | - long seconds = (date.getTime()-ec02Ins.getAFInstance().getTime().getTime())/1000; | ||
| 68 | - AppLog.d("Defferent Time: "+seconds); | ||
| 69 | - this.eqxState = AFState.W_CRes; | ||
| 70 | 51 | ||
| 52 | + EQXRawInstance eqxRaw = new EQXRawInstance(); | ||
| 53 | + eqxRaw.setMessage("A Res."); | ||
| 54 | + eqxRaw.setTo(ec02Ins.getAFInstance().getOrig()); | ||
| 55 | + eqxRaw.setCtype(EQXMsg.TEXTPLAIN); | ||
| 56 | + this.eqxRawDataList.add(this.ec02Builder.getHTTPResponse(eqxRaw,ec02Ins.getAFInstance().getInvoke())); | ||
| 57 | + this.eqxState = AFState.IDLE; | ||
| 58 | + ec02Ins.getAFInstance().setInvoke(null); | ||
| 71 | } | 59 | } |
| 72 | } | 60 | } |
| 73 | 61 |