Exemplo n.º 1
0
 private V replace(AdvancedCache<?, ?> cache, K key, V value) {
   startAtomic();
   try {
     AtomicMap<K, V> map = getAtomicMap(cache, dataKey);
     if (map.containsKey(key)) return map.put(key, value);
     else return null;
   } finally {
     endAtomic();
   }
 }
Exemplo n.º 2
0
 private V putIfAbsent(AdvancedCache<?, ?> cache, K key, V value) {
   startAtomic();
   try {
     AtomicMap<K, V> data = getDataInternal(cache);
     if (!data.containsKey(key)) return data.put(key, value);
     return null;
   } finally {
     endAtomic();
   }
 }
 @Override
 public V replace(K key, V value) {
   startAtomic();
   try {
     AtomicMap<K, V> map = getAtomicMap(dataKey);
     if (map.containsKey(key)) return map.put(key, value);
     else return null;
   } finally {
     endAtomic();
   }
 }
  @Override
  public V putIfAbsent(K key, V value) {
    startAtomic();
    try {
      AtomicMap<K, V> data = getDataInternal();
      if (!data.containsKey(key)) return data.put(key, value);

      return null;
    } finally {
      endAtomic();
    }
  }