Class BundlingNamedCache

All Implemented Interfaces:
CacheMap, NamedCache, NamedCollection, NamedMap, Releasable, ConcurrentMap, InvocableMap, ObservableMap, QueryMap, AutoCloseable, Map

public class BundlingNamedCache extends WrapperNamedCache
Bundling NamedCache implementation.
Since:
Coherence 3.3
Author:
gg 2007.02.13
See Also:
  • Constructor Details

    • BundlingNamedCache

      public BundlingNamedCache(NamedCache cache)
      Construct a BundlingNamedCache based on the specified NamedCache.
      Parameters:
      cache - the NamedCache that will be wrapped by this BundlingNamedCache
  • Method Details

    • ensureGetBundler

      public AbstractBundler ensureGetBundler(int cBundleThreshold)
      Configure the bundler for the "get" operations. If the bundler does not exist and bundling is enabled, it will be instantiated.
      Parameters:
      cBundleThreshold - the bundle size threshold; pass zero to disable "get" operation bundling
      Returns:
      the "get" bundler or null if bundling is disabled
    • ensurePutBundler

      public AbstractBundler ensurePutBundler(int cBundleThreshold)
      Configure the bundler for the "put" operations. If the bundler does not exist and bundling is enabled, it will be instantiated.
      Parameters:
      cBundleThreshold - the bundle size threshold; pass zero to disable "put" operation bundling
      Returns:
      the "put" bundler or null if bundling is disabled
    • ensureRemoveBundler

      public AbstractBundler ensureRemoveBundler(int cBundleThreshold)
      Configure the bundler for the "remove" operations. If the bundler does not exist and bundling is enabled, it will be instantiated.
      Parameters:
      cBundleThreshold - the bundle size threshold; pass zero to disable "remove" operation bundling
      Returns:
      the "remove" bundler or null if bundling is disabled
    • getGetBundler

      public AbstractBundler getGetBundler()
      Obtain the bundler for the "get" operations.
      Returns:
      the "get" bundler
    • getPutBundler

      public AbstractBundler getPutBundler()
      Obtain the bundler for the "put" operations.
      Returns:
      the "put" bundler
    • getRemoveBundler

      public AbstractBundler getRemoveBundler()
      Obtain the bundler for the "remove" operations.
      Returns:
      the "remove" bundler
    • get

      public Object get(Object oKey)
      Returns the value to which this map maps the specified key.
      Specified by:
      get in interface ConcurrentMap
      Specified by:
      get in interface Map
      Overrides:
      get in class WrapperObservableMap
      Parameters:
      oKey - the key object
      Returns:
      the value to which this map maps the specified key, or null if the map contains no mapping for this key
      See Also:
    • getAll

      public Map getAll(Collection colKeys)
      Get all the specified keys, if they are in the Map. For each key that is in the cache, that key and its corresponding value will be placed in the map that is returned by this method. The absence of a key in the returned map indicates that it was not in the cache, which may imply (for caches that can load behind the scenes) that the requested data could not be loaded.
      Specified by:
      getAll in interface CacheMap
      Specified by:
      getAll in interface NamedMap
      Overrides:
      getAll in class WrapperNamedCache
      Parameters:
      colKeys - a collection of keys that may be in the named cache
      Returns:
      a Map of keys to values for the specified keys passed in colKeys
    • put

      public Object put(Object oKey, Object oValue)
      Associates the specified value with the specified key in this map.

      Note: this method always returns null.

      Specified by:
      put in interface CacheMap
      Specified by:
      put in interface ConcurrentMap
      Specified by:
      put in interface Map
      Overrides:
      put in class WrapperConcurrentMap
      Parameters:
      oKey - key with which the specified value is to be associated
      oValue - value to be associated with the specified key
      Returns:
      previous value associated with specified key, or null if there was no mapping for key
    • putAll

      public void putAll(Map map)
      Copies all of the mappings from the specified map to this map. The effect of this call is equivalent to that of calling AbstractKeyBasedMap.put(K, V) on this map once for each mapping in the passed map. The behavior of this operation is unspecified if the passed map is modified while the operation is in progress.
      Specified by:
      putAll in interface ConcurrentMap
      Specified by:
      putAll in interface Map
      Overrides:
      putAll in class WrapperConcurrentMap
      Parameters:
      map - the Map containing the key/value pairings to put into this Map
    • remove

      public Object remove(Object oKey)
      Removes the mapping for this key from this map if present. Expensive: updates both the underlying cache and the local cache.

      Note: this method always returns null.

      Specified by:
      remove in interface ConcurrentMap
      Specified by:
      remove in interface Map
      Overrides:
      remove in class WrapperConcurrentMap
      Parameters:
      oKey - key whose mapping is to be removed from the map
      Returns:
      previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.