Class NullImplementation.NullCacheStore
- java.lang.Object
-
- com.tangosol.util.NullImplementation.NullCacheStore
-
- All Implemented Interfaces:
CacheLoader,CacheStore
- Enclosing class:
- NullImplementation
public static class NullImplementation.NullCacheStore extends Object implements CacheStore
An implementation of an CacheStore that does nothing.
-
-
Field Summary
Fields Modifier and Type Field Description static NullImplementation.NullCacheStoreINSTANCESingleton instance.
-
Constructor Summary
Constructors Constructor Description NullCacheStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderase(Object oKey)Remove the specified key from the underlying store if present.voideraseAll(Collection colKeys)Remove the specified keys from the underlying store if present.Objectload(Object oKey)Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.MaploadAll(Collection colKeys)Return the values associated with each the specified keys in the passed collection.voidstore(Object oKey, Object oValue)Store the specified value under the specified key in the underlying store.voidstoreAll(Map mapEntries)Store the specified values under the specified keys in the underlying store.
-
-
-
Field Detail
-
INSTANCE
public static final NullImplementation.NullCacheStore INSTANCE
Singleton instance.
-
-
Method Detail
-
load
public Object load(Object oKey)
Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.- Specified by:
loadin interfaceCacheLoader- Parameters:
oKey- key whose associated value is to be returned- Returns:
- the value associated with the specified key, or null if no value is available for that key
-
loadAll
public Map loadAll(Collection colKeys)
Return the values associated with each the specified keys in the passed collection. If a key does not have an associated value in the underlying store, then the return map will not have an entry for that key.The default implementation of this method calls
CacheLoader.load(K)for each key in the supplied Collection. Implementations that can optimize multi-key operationsshouldoverride this default implementation.- Specified by:
loadAllin interfaceCacheLoader- Parameters:
colKeys- a collection of keys to load- Returns:
- a Map of keys to associated values for the specified keys
-
store
public void store(Object oKey, Object oValue)
Store the specified value under the specified key in the underlying store. This method is intended to support both key/value creation and value update for a specific key.- Specified by:
storein interfaceCacheStore- Parameters:
oKey- key to store the value underoValue- value to be stored
-
storeAll
public void storeAll(Map mapEntries)
Store the specified values under the specified keys in the underlying store. This method is intended to support both key/value creation and value update for the specified keys.If this operation fails (by throwing an exception) after a partial success, the convention is that entries which have been stored successfully are to be removed from the specified mapEntries, indicating that the store operation for the entries left in the map has failed or has not been attempted.
The default implementation of this method calls
CacheStore.store(K, V)for each entry in the supplied Map. Once stored successfully, an entry is removed from the Map (if possible). Implementations that can optimize multi-entry operationsshouldoverride this default implementation.- Specified by:
storeAllin interfaceCacheStore- Parameters:
mapEntries- a Map of any number of keys and values to store
-
erase
public void erase(Object oKey)
Remove the specified key from the underlying store if present.- Specified by:
erasein interfaceCacheStore- Parameters:
oKey- key whose mapping is being removed from the cache
-
eraseAll
public void eraseAll(Collection colKeys)
Remove the specified keys from the underlying store if present.If this operation fails (by throwing an exception) after a partial success, the convention is that keys which have been erased successfully are to be removed from the specified colKeys, indicating that the erase operation for the keys left in the collection has failed or has not been attempted.
The default implementation of this method calls
CacheStore.erase(K)for each key in the supplied Collection. Once erased successfully, the key is removed from the Collection (if possible). Implementations that can optimize multi-key operationsshouldoverride this default implementation.- Specified by:
eraseAllin interfaceCacheStore- Parameters:
colKeys- keys whose mappings are being removed from the cache
-
-