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
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.commons.jcs3.engine.behavior.ICacheType
ICacheType.CacheType
-
Field Summary
FieldsModifier and TypeFieldDescriptionLateralCacheNoWait<K,
V>[] Deprecated.Should not have been public in the first placeFields inherited from interface org.apache.commons.jcs3.engine.behavior.ICache
NAME_COMPONENT_DELIMITER
-
Constructor Summary
ConstructorsConstructorDescriptionLateralCacheNoWaitFacade
(ILateralCacheListener<K, V> listener, List<LateralCacheNoWait<K, V>> noWaits, ILateralCacheAttributes cattr) Constructs with the given lateral cache, and fires events to any listeners.LateralCacheNoWaitFacade
(ILateralCacheListener<K, V> listener, LateralCacheNoWait<K, V>[] noWaits, ILateralCacheAttributes cattr) Deprecated.Use list constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
addNoWait
(LateralCacheNoWait<K, V> noWait) Adds a no wait to the list if it isn't already in the list.boolean
containsNoWait
(String tcpServer) Tells you if the no wait is in the list or not by checking for its identifying keyboolean
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.Synchronously reads from the lateral cache.This returns the generic attributes for an auxiliary cache.Gets the cacheName attribute of the LateralCacheNoWaitFacade object.Gets the cacheType attribute of the LateralCacheNoWaitFacade object.this won't be called since we don't do ICache logging here.Return the keys in this 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.protected int
Return the size of the no wait list (for testing)int
getSize()
No lateral invocation.getStats()
getStatsGets the status attribute of the LateralCacheNoWaitFacade objectboolean
Adds a remove request to the lateral cache.void
Adds a removeAll request to the lateral cache.boolean
removeNoWait
(String tcpServer) Removes a no wait from the list if it is already there by its identifying keyboolean
removeNoWait
(LateralCacheNoWait<K, V> noWait) Removes a no wait from the list if it is already there.toString()
void
update
(ICacheElement<K, V> ce) Update the cache element in all lateral cachesMethods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcher
-
Field Details
-
noWaits
Deprecated.Should not have been public in the first placeThe queuing facade to the client.
-
-
Constructor Details
-
LateralCacheNoWaitFacade
@Deprecated public LateralCacheNoWaitFacade(ILateralCacheListener<K, V> listener, LateralCacheNoWait<K, V>[] noWaits, ILateralCacheAttributes cattr) Deprecated.Use list constructorConstructs with the given lateral cache, and fires events to any listeners.- Parameters:
listener
- the cache listenernoWaits
- the array of noWaitscattr
- the configuration
-
LateralCacheNoWaitFacade
public LateralCacheNoWaitFacade(ILateralCacheListener<K, V> listener, List<LateralCacheNoWait<K, V>> noWaits, ILateralCacheAttributes cattr) Constructs with the given lateral cache, and fires events to any listeners.- Parameters:
listener
- the cache listenernoWaits
- the list of noWaitscattr
- the configuration- Since:
- 3.1
-
-
Method Details
-
getNoWaitSize
Return the size of the no wait list (for testing)- Returns:
- the noWait list size.
- Since:
- 3.1
-
containsNoWait
Tells you if the no wait is in the list or not.- Parameters:
noWait
-- Returns:
- true if the noWait is in the list.
-
containsNoWait
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
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
Removes a no wait from the list if it is already there.- Parameters:
noWait
-- Returns:
- true if it was already in the array
-
removeNoWait
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
Update the cache element in all lateral caches- Parameters:
ce
- the cache element- Throws:
IOException
-
get
Synchronously reads from the lateral cache. -
getMultiple
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
Synchronously reads from the lateral cache. Get a response from each! This will be slow. Merge them.- Parameters:
pattern
-- Returns:
- ICacheElement
-
getKeySet
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
Adds a remove request to the lateral cache.- Parameters:
key
-- Returns:
- always false.
-
removeAll
Adds a removeAll request to the lateral cache. -
dispose
Adds a dispose request to the lateral cache. -
getSize
No lateral invocation.- Returns:
- The size value
-
getCacheType
Gets the cacheType attribute of the LateralCacheNoWaitFacade object.- Returns:
- The cacheType value
-
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
-
getEventLoggingExtraInfo
this won't be called since we don't do ICache logging here.- Specified by:
getEventLoggingExtraInfo
in classAbstractAuxiliaryCache<K,
V> - Returns:
- String
-
getStats
getStats- Returns:
- String
-
getStatistics
- Returns:
- IStats
-