mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-19779: Stack specific: Caches are no synchronized between the nodes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54391 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -96,10 +96,21 @@ public final class DefaultSimpleCache<K extends Serializable, V extends Object>
|
||||
@Override
|
||||
public void put(K key, V value)
|
||||
{
|
||||
AbstractMap.SimpleImmutableEntry<K, V> kvp = new AbstractMap.SimpleImmutableEntry<K, V>(key, value);
|
||||
map.put(key, kvp);
|
||||
putAndCheckUpdate(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>put</code> method that may be used to check for updates in a thread-safe manner.
|
||||
*
|
||||
* @return <code>true</code> if the put resulted in a change in value, <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean putAndCheckUpdate(K key, V value)
|
||||
{
|
||||
AbstractMap.SimpleImmutableEntry<K, V> kvp = new AbstractMap.SimpleImmutableEntry<K, V>(key, value);
|
||||
AbstractMap.SimpleImmutableEntry<K, V> priorKVP = map.put(key, kvp);
|
||||
return priorKVP != null && (! priorKVP.equals(kvp));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(K key)
|
||||
{
|
||||
|
Reference in New Issue
Block a user