Class LateralCache<K,V>
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache<K,V>
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging<K,V>
org.apache.commons.jcs3.auxiliary.lateral.LateralCache<K,V>
- All Implemented Interfaces:
AuxiliaryCache<K,
,V> ICache<K,
,V> ICacheType
Lateral distributor. Returns null on get by default. Net search not implemented.
-
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
ConstructorsConstructorDescriptionDeprecated.Causes NPELateralCache
(ILateralCacheAttributes cattr, ICacheServiceNonLocal<K, V> lateral, LateralCacheMonitor monitor) Constructor for the LateralCache object -
Method Summary
Modifier and TypeMethodDescriptionvoid
fixCache
(ICacheServiceNonLocal<K, V> restoredLateral) Replaces the current remote cache service handle with the given handle.This returns the generic attributes for an auxiliary cache.Gets the cacheName attribute of the LateralCache objectGets the cacheType attribute of the LateralCache objectGets the extra info for the event log.Return the keys in this cache.int
getSize()
Returns the current cache size.The NoWait on top does not call out to here yet.getStats()
getStatsReturns the cache status.protected void
Synchronously dispose the cache.protected ICacheElement<K,
V> processGet
(K key) The performance costs are too great.protected Map<K,
ICacheElement<K, V>> processGetMatching
(String pattern) Implementation of getMatching.protected boolean
processRemove
(K key) Synchronously remove from the remote cache; if failed, replace the remote handle with a zombie.protected void
Synchronously removeAll from the remote cache; if failed, replace the remote handle with a zombie.protected void
processUpdate
(ICacheElement<K, V> ce) Update lateral.toString()
Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging
dispose, disposeWithEventLogging, get, getMatching, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, remove, removeAll, removeAllWithEventLogging, removeWithEventLogging, update, updateWithEventLogging
Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcher
-
Constructor Details
-
LateralCache
public LateralCache(ILateralCacheAttributes cattr, ICacheServiceNonLocal<K, V> lateral, LateralCacheMonitor monitor) Constructor for the LateralCache object- Parameters:
cattr
-lateral
-monitor
-
-
LateralCache
Deprecated.Causes NPEConstructor for the LateralCache object- Parameters:
cattr
-
-
-
Method Details
-
processUpdate
Update lateral.- Specified by:
processUpdate
in classAbstractAuxiliaryCacheEventLogging<K,
V> - Parameters:
ce
-- Throws:
IOException
-
processGet
The performance costs are too great. It is not recommended that you enable lateral gets.- Specified by:
processGet
in classAbstractAuxiliaryCacheEventLogging<K,
V> - Parameters:
key
-- Returns:
- ICacheElement<K, V> or null
- Throws:
IOException
-
processGetMatching
Description copied from class:AbstractAuxiliaryCacheEventLogging
Implementation of getMatching.- Specified by:
processGetMatching
in classAbstractAuxiliaryCacheEventLogging<K,
V> - Parameters:
pattern
-- 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
- Throws:
IOException
-
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:
-
processRemove
Synchronously remove from the remote cache; if failed, replace the remote handle with a zombie.- Specified by:
processRemove
in classAbstractAuxiliaryCacheEventLogging<K,
V> - Parameters:
key
-- Returns:
- false always
- Throws:
IOException
-
processRemoveAll
Synchronously removeAll from the remote cache; if failed, replace the remote handle with a zombie.- Specified by:
processRemoveAll
in classAbstractAuxiliaryCacheEventLogging<K,
V> - Throws:
IOException
-
processDispose
Synchronously dispose the cache. Not sure we want this.- Specified by:
processDispose
in classAbstractAuxiliaryCacheEventLogging<K,
V> - Throws:
IOException
-
getStatus
Returns the cache status.- Returns:
- The status value
-
getSize
Returns the current cache size.- Returns:
- The size value
-
getCacheType
Gets the cacheType attribute of the LateralCache object- Returns:
- The cacheType value
-
getCacheName
Gets the cacheName attribute of the LateralCache object- Returns:
- The cacheName value
-
fixCache
Replaces the current remote cache service handle with the given handle.- Parameters:
restoredLateral
-
-
getStats
getStats- Returns:
- String
-
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
Description copied from class:AbstractAuxiliaryCache
Gets the extra info for the event log.- Specified by:
getEventLoggingExtraInfo
in classAbstractAuxiliaryCache<K,
V> - Returns:
- extra data.
-
getStatistics
The NoWait on top does not call out to here yet.- Returns:
- almost nothing
-