|
@@ -7,6 +7,7 @@
|
|
*/
|
|
*/
|
|
package com.yomahub.liteflow.slot;
|
|
package com.yomahub.liteflow.slot;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.ListUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.yomahub.liteflow.exception.NoSuchContextBeanException;
|
|
import com.yomahub.liteflow.exception.NoSuchContextBeanException;
|
|
import com.yomahub.liteflow.exception.NullParamException;
|
|
import com.yomahub.liteflow.exception.NullParamException;
|
|
@@ -112,11 +113,23 @@ public class Slot{
|
|
}
|
|
}
|
|
|
|
|
|
public <T> T getChainReqData(String chainId) {
|
|
public <T> T getChainReqData(String chainId) {
|
|
- return (T) metaDataMap.get(CHAIN_REQ_PREFIX + chainId);
|
|
|
|
|
|
+ String key = CHAIN_REQ_PREFIX + chainId;
|
|
|
|
+ if (hasMetaData(key)){
|
|
|
|
+ Queue<Object> queue = (Queue<Object>) metaDataMap.get(key);
|
|
|
|
+ return (T)queue.poll();
|
|
|
|
+ }else{
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public <T> void setChainReqData(String chainId, T t) {
|
|
public <T> void setChainReqData(String chainId, T t) {
|
|
- putMetaDataMap(CHAIN_REQ_PREFIX + chainId, t);
|
|
|
|
|
|
+ String key = CHAIN_REQ_PREFIX + chainId;
|
|
|
|
+ if (hasMetaData(key)){
|
|
|
|
+ Queue<Object> queue = (Queue<Object>) metaDataMap.get(key);
|
|
|
|
+ queue.offer(t);
|
|
|
|
+ }else{
|
|
|
|
+ putMetaDataMap(key, new ConcurrentLinkedQueue<>(ListUtil.toList(t)));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public <T> void setPrivateDeliveryData(String nodeId, T t){
|
|
public <T> void setPrivateDeliveryData(String nodeId, T t){
|