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
    Singleton instance.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    erase(Object oKey)
    Remove the specified key from the underlying store if present.
    void
    Remove the specified keys from the underlying store if present.
    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.
    Return the values associated with each the specified keys in the passed collection.
    void
    store(Object oKey, Object oValue)
    Store the specified value under the specified key in the underlying store.
    void
    storeAll(Map mapEntries)
    Store the specified values under the specified keys in the underlying store.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • NullCacheStore

      public NullCacheStore()
  • Method Details

    • 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:
      load in interface CacheLoader
      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 operations should override this default implementation.

      Specified by:
      loadAll in interface CacheLoader
      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:
      store in interface CacheStore
      Parameters:
      oKey - key to store the value under
      oValue - 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 operations should override this default implementation.

      Specified by:
      storeAll in interface CacheStore
      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:
      erase in interface CacheStore
      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 operations should override this default implementation.

      Specified by:
      eraseAll in interface CacheStore
      Parameters:
      colKeys - keys whose mappings are being removed from the cache