private static final ConcurrentHashMap delegatorCache = new ConcurrentHashMap();
do {
Object delegator = delegatorCache.get(delegatorName);
if (delegator != null) {
return delegator;
}
try {
delegator = new Object();
} catch (ClassNotFoundException e) {
Debug.logError(e, module);
}
//Debug.logInfo("putting delegator(" + delegatorName + ") into cache", module);
delegatorCache.putIfAbsent(delegatorName, delegator);
} while (true);
记录下。。concurrentMap的使用代码
最新推荐文章于 2021-03-30 09:07:12 发布