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
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.commons.jcs3.engine.behavior.ICacheType
ICacheType.CacheType
-
Field Summary
Fields inherited from interface org.apache.commons.jcs3.engine.behavior.ICache
NAME_COMPONENT_DELIMITER
-
Constructor Summary
ConstructorsConstructorDescriptionLateralCacheNoWait
(LateralCache<K, V> cache) Constructs with the given lateral cache, and fires up an event queue for asynchronous processing. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Synchronously reads from the lateral cache.This returns the generic attributes for an auxiliary cache.Gets the cacheName attribute of the LateralCacheNoWait objectNo lateral invocation.this won't be called since we don't do ICache logging here.The identifying key to this no waitReturn 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.int
getSize()
No lateral invocation.getStats()
getStatsReturns the async cache status.boolean
Adds a remove request to the lateral cache.void
Adds a removeAll request to the lateral cache.void
Resets the event q by first destroying the existing one and starting up new one.void
setIdentityKey
(String identityKey) Set the identifying key to this no waittoString()
void
update
(ICacheElement<K, V> ce) Puts an item to the cache.Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcher
-
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
Set the identifying key to this no wait- Parameters:
identityKey
- the identityKey to set- Since:
- 3.1
-
update
Description copied from interface:ICache
Puts an item to the cache.- Parameters:
ce
-- 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.- Parameters:
pattern
-- Returns:
- ICacheElement<K, V> if found, else empty
-
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
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
Gets the cacheName attribute of the LateralCacheNoWait object- Returns:
- The cacheName value
-
fixCache
Replaces the lateral cache service handle with the given handle and reset the queue by starting up a new instance.- Parameters:
lateral
-
-
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
getStats- Returns:
- String
-
getEventLoggingExtraInfo
this won't be called since we don't do ICache logging here.- Specified by:
getEventLoggingExtraInfo
in classAbstractAuxiliaryCache<K,
V> - Returns:
- String
-
getStatistics
- Returns:
- statistics about this communication
-
toString
-