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