Class LateralCacheNoWait<K,V>

java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache<K,V>
org.apache.commons.jcs3.auxiliary.lateral.LateralCacheNoWait<K,V>
All Implemented Interfaces:
AuxiliaryCache<K,V>, ICache<K,V>, ICacheType

public class LateralCacheNoWait<K,V> extends AbstractAuxiliaryCache<K,V>
Used to queue up update requests to the underlying cache. These requests will be processed in their order of arrival via the cache event queue processor.
  • Constructor Details

    • LateralCacheNoWait

      Constructs with the given lateral cache, and fires up an event queue for asynchronous processing.

      Parameters:
      cache -
  • Method Details

    • getIdentityKey

      The identifying key to this no wait
      Returns:
      the identity key
      Since:
      3.1
    • setIdentityKey

      public void setIdentityKey(String identityKey)
      Set the identifying key to this no wait
      Parameters:
      identityKey - the identityKey to set
      Since:
      3.1
    • update

      public void update(ICacheElement<K,V> ce) throws IOException
      Description copied from interface: ICache
      Puts an item to the cache.
      Parameters:
      ce -
      Throws:
      IOException
    • get

      public ICacheElement<K,V> get(K key)
      Synchronously reads from the lateral cache.

      Specified by:
      get in interface ICache<K,V>
      Specified by:
      get in class AbstractAuxiliaryCache<K,V>
      Parameters:
      key -
      Returns:
      ICacheElement<K, V> if found, else null
    • getMultiple

      public Map<K,ICacheElement<K,V>> getMultiple(Set<K> keys)
      Gets multiple items from the cache based on the given set of keys.

      Parameters:
      keys -
      Returns:
      a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache for any of these keys
    • getMatching

      public Map<K,ICacheElement<K,V>> getMatching(String pattern)
      Synchronously reads from the lateral cache.

      Parameters:
      pattern -
      Returns:
      ICacheElement<K, V> if found, else empty
    • getKeySet

      public Set<K> getKeySet() throws IOException
      Return the keys in this cache.

      Returns:
      a set of the key type TODO This should probably be done in chunks with a range passed in. This will be a problem if someone puts a 1,000,000 or so items in a region.
      Throws:
      IOException - if access to the auxiliary cache fails
      See Also:
    • remove

      public boolean remove(K key)
      Adds a remove request to the lateral cache.

      Parameters:
      key -
      Returns:
      always false
    • removeAll

      public void removeAll()
      Adds a removeAll request to the lateral cache.
    • dispose

      public void dispose()
      Adds a dispose request to the lateral cache.
    • getSize

      public int getSize()
      No lateral invocation.

      Returns:
      The size value
    • getCacheType

      No lateral invocation.

      Returns:
      The cacheType value
    • getStatus

      Returns the async cache status. An error status indicates either the lateral connection is not available, or the asyn queue has been unexpectedly destroyed. No lateral invocation.

      Returns:
      The status value
    • getCacheName

      public String getCacheName()
      Gets the cacheName attribute of the LateralCacheNoWait object

      Returns:
      The cacheName value
    • fixCache

      public void fixCache(ICacheServiceNonLocal<K,V> lateral)
      Replaces the lateral cache service handle with the given handle and reset the queue by starting up a new instance.

      Parameters:
      lateral -
    • resetEventQ

      public void resetEventQ()
      Resets the event q by first destroying the existing one and starting up new one.
    • getAuxiliaryCacheAttributes

      Description copied from interface: AuxiliaryCache
      This returns the generic attributes for an auxiliary cache. Most implementations will cast this to a more specific type.

      Returns:
      Returns the AuxiliaryCacheAttributes.
    • getStats

      public String getStats()
      getStats
      Returns:
      String
    • getEventLoggingExtraInfo

      this won't be called since we don't do ICache logging here.

      Specified by:
      getEventLoggingExtraInfo in class AbstractAuxiliaryCache<K,V>
      Returns:
      String
    • getStatistics

      Returns:
      statistics about this communication
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      debugging info.