package cn.amq.traffic;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
/**
 * 设备联动执行状态缓存
 * @author Lenovo
 *
 */
public class CacheExecStateDataService {

	Object mutex = new Object();
	
	private Map<String,String> cacheExecStateDataMap = new HashMap<String,String>();

	public Map<String,String> getCacheExecStateDataMap() {
		synchronized (mutex) {
			Map<String,String> tempCacheExecStateDataMap = new HashMap<String,String>();
			tempCacheExecStateDataMap = cacheExecStateDataMap;
			return tempCacheExecStateDataMap;
		}
	}

	public void setCacheExecStateDataMap(String key,String value) {
		synchronized (mutex) {
			if (StringUtils.isNotEmpty(key) && cacheExecStateDataMap!=null) {
				cacheExecStateDataMap.put(key,value);
			}
		}
	}
}
