Class LateralCacheNoWaitFacade<K,V>

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

public class LateralCacheNoWaitFacade<K,V> extends AbstractAuxiliaryCache<K,V>
Used to provide access to multiple services under nowait protection. Composite factory should construct LateralCacheNoWaitFacade to give to the composite cache out of caches it constructs from the varies manager to lateral services. Perhaps the lateralcache factory should be able to do this.
  • Field Details

  • Constructor Details

  • Method Details

    • getNoWaitSize

      protected int getNoWaitSize()
      Return the size of the no wait list (for testing)
      Returns:
      the noWait list size.
      Since:
      3.1
    • containsNoWait

      public boolean containsNoWait(LateralCacheNoWait<K,V> noWait)
      Tells you if the no wait is in the list or not.

      Parameters:
      noWait -
      Returns:
      true if the noWait is in the list.
    • containsNoWait

      public boolean containsNoWait(String tcpServer)
      Tells you if the no wait is in the list or not by checking for its identifying key

      Parameters:
      tcpServer - the identifying key
      Returns:
      true if the noWait is in the list.
      Since:
      3.1
    • addNoWait

      public boolean addNoWait(LateralCacheNoWait<K,V> noWait)
      Adds a no wait to the list if it isn't already in the list.

      Parameters:
      noWait -
      Returns:
      true if it wasn't already contained
    • removeNoWait

      public boolean removeNoWait(LateralCacheNoWait<K,V> noWait)
      Removes a no wait from the list if it is already there.

      Parameters:
      noWait -
      Returns:
      true if it was already in the array
    • removeNoWait

      public boolean removeNoWait(String tcpServer)
      Removes a no wait from the list if it is already there by its identifying key

      Parameters:
      tcpServer - the identifying key.
      Returns:
      true if it was already in the array
      Since:
      3.1
    • update

      public void update(ICacheElement<K,V> ce) throws IOException
      Update the cache element in all lateral caches
      Parameters:
      ce - the cache element
      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
    • 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. Get a response from each! This will be slow. Merge them.

      Parameters:
      pattern -
      Returns:
      ICacheElement
    • 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

      Gets the cacheType attribute of the LateralCacheNoWaitFacade object.

      Returns:
      The cacheType value
    • getCacheName

      public String getCacheName()
      Gets the cacheName attribute of the LateralCacheNoWaitFacade object.

      Returns:
      The cacheName value
    • getStatus

      Gets the status attribute of the LateralCacheNoWaitFacade object
      Returns:
      The status value
    • 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      "LateralCacheNoWaitFacade: " + cacheName;
    • getEventLoggingExtraInfo

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

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

      public String getStats()
      getStats
      Returns:
      String
    • getStatistics

      Returns:
      IStats