mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
synchronize getCache method of cache manager implementations
This commit is contained in:
@@ -125,7 +125,8 @@ public class EhCacheManager implements CacheManager
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public <K, V> Cache<K, V> getCache(Class<K> key, Class<V> value, String name)
|
||||
public synchronized <K, V> Cache<K, V> getCache(Class<K> key, Class<V> value,
|
||||
String name)
|
||||
{
|
||||
net.sf.ehcache.Cache c = cacheManager.getCache(name);
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ public class GuavaCacheManager implements CacheManager
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public <K, V> GuavaCache<K, V> getCache(Class<K> key, Class<V> value,
|
||||
String name)
|
||||
public synchronized <K, V> GuavaCache<K, V> getCache(Class<K> key,
|
||||
Class<V> value, String name)
|
||||
{
|
||||
logger.trace("try to retrieve cache {}", name);
|
||||
|
||||
@@ -146,7 +146,7 @@ public class GuavaCacheManager implements CacheManager
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private Map<String, GuavaCache> cacheMap = Maps.newConcurrentMap();
|
||||
private volatile Map<String, GuavaCache> cacheMap = Maps.newHashMap();
|
||||
|
||||
/** Field description */
|
||||
private GuavaCacheConfiguration defaultConfiguration;
|
||||
|
||||
Reference in New Issue
Block a user