org.apache.jcs.auxiliary.lateral
Class LateralCacheNoWaitFacade<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.LateralCacheNoWaitFacade<K,V>
All Implemented Interfaces:
AuxiliaryCache<K,V>, ICache<K,V>, ICacheType

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


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.jcs.engine.behavior.ICacheType
ICacheType.CacheType
 
Field Summary
 LateralCacheNoWait<K,V>[] noWaits
          The queuing facade to the client.
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache
cacheEventLogger, elementSerializer, keyMatcher
 
Constructor Summary
LateralCacheNoWaitFacade(ILateralCacheListener<K,V> listener, LateralCacheNoWait<K,V>[] noWaits, ILateralCacheAttributes cattr)
          Constructs with the given lateral cache, and fires events to any listeners.
 
Method Summary
 boolean addNoWait(LateralCacheNoWait<K,V> noWait)
          Adds a no wait to the list if it isn't already in the list.
 boolean containsNoWait(LateralCacheNoWait<K,V> noWait)
          Tells you if the no wait is in the list or not.
 void dispose()
          Adds a dispose request to the lateral cache.
 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 LateralCacheNoWaitFacade object.
 ICacheType.CacheType getCacheType()
          Gets the cacheType attribute of the LateralCacheNoWaitFacade object.
 String getEventLoggingExtraInfo()
          this won't be called since we don't do ICache logging here.
 Set<K> getGroupKeys(String group)
          Gets the set of keys of objects currently in the group.
 Set<String> getGroupNames()
          Gets the set of group names 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()
          Gets the status attribute of the LateralCacheNoWaitFacade object
 boolean remove(K key)
          Adds a remove request to the lateral cache.
 void removeAll()
          Adds a removeAll request to the lateral cache.
 boolean removeNoWait(LateralCacheNoWait<K,V> noWait)
          Removes a no wait from the list if it is already there.
 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
 

Field Detail

noWaits

public LateralCacheNoWait<K extends Serializable,V extends Serializable>[] noWaits
The queuing facade to the client.

Constructor Detail

LateralCacheNoWaitFacade

public LateralCacheNoWaitFacade(ILateralCacheListener<K,V> listener,
                                LateralCacheNoWait<K,V>[] noWaits,
                                ILateralCacheAttributes cattr)
Constructs with the given lateral cache, and fires events to any listeners.

Parameters:
noWaits -
cattr -
Method Detail

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.

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

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

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. Get a response from each! This will be slow. Merge them.

Parameters:
pattern -
Returns:
ICacheElement

getGroupKeys

public Set<K> getGroupKeys(String group)
Gets the set of keys of objects currently in the group.

Parameters:
group -
Returns:
a Set of group keys.

getGroupNames

public Set<String> getGroupNames()
Gets the set of group names in the cache

Returns:
a Set of group names.

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()
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

public CacheStatus getStatus()
Gets the status attribute of the LateralCacheNoWaitFacade object

Returns:
The status value

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.

toString

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

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

getStats

public String getStats()
getStats

Returns:
String

getStatistics

public IStats getStatistics()
Returns:
IStats


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