org.apache.jcs.auxiliary.lateral
Class LateralCacheNoWait<K extends Serializable,V extends Serializable>

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

public class LateralCacheNoWait<K extends Serializable,V extends Serializable>
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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.jcs.engine.behavior.ICacheType
ICacheType.CacheType
 
Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
cacheEventLogger, elementSerializer, keyMatcher
 
Constructor Summary
LateralCacheNoWait(LateralCache<K,V> cache)
          Constructs with the given lateral cache, and fires up an event queue for aysnchronous processing.
 
Method Summary
 void dispose()
          Adds a dispose request to the lateral cache.
 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.
 ICacheElement<K,V> get(K key)
          Synchronously reads from the lateral cache.
 AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
          This returns the generic attributes for an auxiliary cache.
 String getCacheName()
          Gets the cacheName attribute of the LateralCacheNoWait object
 ICacheType.CacheType getCacheType()
          No lateral invocation.
 String getEventLoggingExtraInfo()
          this won't be called since we don't do ICache logging here.
 Set<K> getGroupKeys(String groupName)
          Gets the set of keys of objects currently in the group
 Set<String> getGroupNames()
          Gets the set of group names currently in the cache
 Map<K,ICacheElement<K,V>> getMatching(String pattern)
          Synchronously reads from the lateral cache.
 Map<K,ICacheElement<K,V>> getMultiple(Set<K> keys)
          Gets multiple items from the cache based on the given set of keys.
 int getSize()
          No lateral invocation.
 IStats getStatistics()
           
 String getStats()
          getStats
 CacheStatus getStatus()
          Returns the asyn cache status.
 boolean remove(K key)
          Adds a remove request to the lateral cache.
 void removeAll()
          Adds a removeAll request to the lateral cache.
 void resetEventQ()
          Resets the event q by first destroying the existing one and starting up new one.
 String toString()
           
 void update(ICacheElement<K,V> ce)
          Puts an item to the cache.
 
Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LateralCacheNoWait

public LateralCacheNoWait(LateralCache<K,V> cache)
Constructs with the given lateral cache, and fires up an event queue for aysnchronous processing.

Parameters:
cache -
Method Detail

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.

Parameters:
key -
Returns:
ICacheElement 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 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 if found, else empty

getGroupKeys

public Set<K> getGroupKeys(String groupName)
Description copied from interface: AuxiliaryCache
Gets the set of keys of objects currently in the group

Parameters:
groupName -
Returns:
Set

getGroupNames

public Set<String> getGroupNames()
Description copied from interface: AuxiliaryCache
Gets the set of group names currently in the cache

Returns:
Set

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

public ICacheType.CacheType getCacheType()
No lateral invocation.

Returns:
The cacheType value

getStatus

public CacheStatus getStatus()
Returns the asyn 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

public AuxiliaryCacheAttributes 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

public String getEventLoggingExtraInfo()
this won't be called since we don't do ICache logging here.

Specified by:
getEventLoggingExtraInfo in class AbstractAuxiliaryCache<K extends Serializable,V extends Serializable>
Returns:
String

getStatistics

public IStats getStatistics()
Returns:
statistics about this communication

toString

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


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.