- Timestamp:
- 11/23/06 18:21:31 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_CO/com/scenari/m/co/agent/sortie/HAgentSortie.java
r7458 r7466 52 52 import com.scenari.m.co.donnee.IComputedData; 53 53 import com.scenari.m.co.instance.IWInstFormation; 54 import com.scenari.s.fw.log.HLogMgr; 54 55 import com.scenari.s.fw.log.HTrace; 55 56 import com.scenari.s.fw.log.HTraceMgr; … … 61 62 62 63 /** Cache en mémoire du résultat. */ 63 protected transient IComputedData f ResultatCache = null;64 protected transient IComputedData fDataCache = null; 64 65 65 66 /** Trace. */ … … 83 84 public IComputedData computeAsData(IHDialog pDialog, Object pArguments) throws Exception { 84 85 85 if (f ResultatCache != null) return fResultatCache;86 if (fDataCache != null) return fDataCache; 86 87 87 88 IComputedData vResult = IComputedData.NULL; … … 102 103 103 104 String vCache = ((HComposantTypeSortie) fComposant.hGetComposantType()).hGetResultatCache(); 104 if (vCache != null) {105 if (vCache != null) { 105 106 if ("*".equals(vCache)) { 106 f ResultatCache = new DataVolatileString(vResult.getString(), vResult.getMime());107 return f ResultatCache;107 fDataCache = new DataVolatileString(vResult.getString(), vResult.getMime()); 108 return fDataCache; 108 109 } else if ("node".equals(vCache)) { 109 f ResultatCache = new DataVolatileNode(vResult.getNode(), vResult.getMime());110 return f ResultatCache;110 fDataCache = new DataVolatileNode(vResult.getNode(), vResult.getMime()); 111 return fDataCache; 111 112 } 112 113 } … … 115 116 116 117 public Node computeAsNode(IHDialog pDialog, Object pArguments) throws Exception { 117 return computeAsData(pDialog, pArguments).getNode(); 118 119 if (fDataCache != null) return fDataCache.getNode(); 120 String vCache = ((HComposantTypeSortie) fComposant.hGetComposantType()).hGetResultatCache(); 121 if (vCache != null) { 122 xComputeCache(vCache, pDialog, pArguments); 123 return fDataCache.getNode(); 124 } 125 126 IData vSource = ((WComposantSortie) fComposant).hGetSource(); 127 128 if (!hIsActif(pDialog)) { 129 return IData.NULL_NODE; 130 } else if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 131 return ((WComposantSortie) fComposant).hGetSource().getNode(pDialog, this, pArguments); 132 } else { 133 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 134 return vSource.getNode(pDialog, this, pArguments); 135 } else { 136 return new XDonneeResultatSortie(this, pDialog, pArguments).getNode(); 137 } 138 } 118 139 } 119 140 … … 122 143 */ 123 144 public String computeAsString(IHDialog pDialog, Object pArguments) throws Exception { 124 return computeAsData(pDialog, pArguments).getString(); 145 146 if (fDataCache != null) return fDataCache.getString(); 147 148 String vCache = ((HComposantTypeSortie) fComposant.hGetComposantType()).hGetResultatCache(); 149 if (vCache != null) { 150 xComputeCache(vCache, pDialog, pArguments); 151 return fDataCache.getString(); 152 } 153 154 IData vSource = ((WComposantSortie) fComposant).hGetSource(); 155 156 if (!hIsActif(pDialog)) { 157 return IData.NULL_STRING; 158 } else if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 159 return ((WComposantSortie) fComposant).hGetSource().getString(pDialog, this, pArguments); 160 } else { 161 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 162 return vSource.getString(pDialog, this, pArguments); 163 } else { 164 return new XDonneeResultatSortie(this, pDialog, pArguments).getString(); 165 } 166 } 167 } 168 169 protected void xComputeCache(String pCache, IHDialog pDialog, Object pArguments) throws Exception { 170 if (!hIsActif(pDialog)) { 171 fDataCache = IComputedData.NULL; 172 } 173 IData vSource = ((WComposantSortie) fComposant).hGetSource(); 174 if ("*".equals(pCache)) { 175 if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 176 fDataCache = new DataVolatileString(vSource.getString(pDialog, this, pArguments)); 177 } else { 178 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 179 try { 180 pDialog.hExecStackPush(this); 181 fDataCache = new DataVolatileString(vSource.getString(pDialog, this, pArguments)); 182 } finally { 183 pDialog.hExecStackPop(); 184 } 185 } else { 186 fDataCache = new DataVolatileString(new XDonneeResultatSortie(this, pDialog, pArguments).getString()); 187 } 188 } 189 } else if ("node".equals(pCache)) { 190 if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 191 fDataCache = new DataVolatileNode(vSource.getNode(pDialog, this, pArguments)); 192 } else { 193 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 194 try { 195 pDialog.hExecStackPush(this); 196 fDataCache = new DataVolatileNode(vSource.getNode(pDialog, this, pArguments)); 197 } finally { 198 pDialog.hExecStackPop(); 199 } 200 } else { 201 fDataCache = new DataVolatileNode(new XDonneeResultatSortie(this, pDialog, pArguments).getNode()); 202 } 203 } 204 } else { 205 throw HLogMgr.hNewException("Valeur de cache inconnue '" + pCache + "' définie dans " + this); 206 } 125 207 } 126 208
Note: See TracChangeset
for help on using the changeset viewer.