Class AbstractAuxiliaryCacheEventLogging<K,V>
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache<K,V>
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging<K,V>
- All Implemented Interfaces:
AuxiliaryCache<K,
,V> ICache<K,
,V> ICacheType
- Direct Known Subclasses:
AbstractDiskCache
,AbstractRemoteAuxiliaryCache
,LateralCache
All ICacheEvents are defined as final. Children must implement process events. These are wrapped
in event log parent calls.
You can override the public method, but if you don't, the default will call getWithTiming.
-
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie.protected final void
Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie.Gets the item from the cache.Map<K,
ICacheElement<K, V>> getMatching
(String pattern) Gets items from the cache matching the given pattern.protected final Map<K,
ICacheElement<K, V>> getMatchingWithEventLogging
(String pattern) Gets matching items from the cache based on the given pattern.Map<K,
ICacheElement<K, V>> getMultiple
(Set<K> keys) Gets multiple items from the cache based on the given set of keys.protected final Map<K,
ICacheElement<K, V>> getMultipleWithEventLogging
(Set<K> keys) Gets multiple items from the cache based on the given set of keys.protected final ICacheElement<K,
V> getWithEventLogging
(K key) Gets the item from the cache.protected abstract void
Specific implementation of dispose.protected abstract ICacheElement<K,
V> processGet
(K key) Implementation of get.protected abstract Map<K,
ICacheElement<K, V>> processGetMatching
(String pattern) Implementation of getMatching.protected abstract boolean
processRemove
(K key) Specific implementation of remove.protected abstract void
Specific implementation of removeAll.protected abstract void
processUpdate
(ICacheElement<K, V> cacheElement) Implementation of put.boolean
Removes the item from the cache.void
Removes all from the region.protected final void
Removes all from the region.protected final boolean
removeWithEventLogging
(K key) Removes the item from the cache.void
update
(ICacheElement<K, V> cacheElement) Puts an item into the cache.protected final void
updateWithEventLogging
(ICacheElement<K, V> cacheElement) Puts an item into the cache.Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getEventLoggingExtraInfo, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcher
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.jcs3.auxiliary.AuxiliaryCache
getAuxiliaryCacheAttributes, getKeySet, getStatistics
Methods inherited from interface org.apache.commons.jcs3.engine.behavior.ICache
getCacheName, getSize, getStats, getStatus
Methods inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheType
getCacheType
-
Constructor Details
-
AbstractAuxiliaryCacheEventLogging
public AbstractAuxiliaryCacheEventLogging()
-
-
Method Details
-
update
Puts an item into the cache.- Parameters:
cacheElement
-- Throws:
IOException
-
updateWithEventLogging
Puts an item into the cache. Wrapped in logging.- Parameters:
cacheElement
-- Throws:
IOException
-
processUpdate
Implementation of put.- Parameters:
cacheElement
-- Throws:
IOException
-
get
Gets the item from the cache.- Specified by:
get
in interfaceICache<K,
V> - Specified by:
get
in classAbstractAuxiliaryCache<K,
V> - Parameters:
key
-- Returns:
- ICacheElement, a wrapper around the key, value, and attributes
- Throws:
IOException
-
getWithEventLogging
Gets the item from the cache. Wrapped in logging.- Parameters:
key
-- Returns:
- ICacheElement, a wrapper around the key, value, and attributes
- Throws:
IOException
-
processGet
Implementation of get.- Parameters:
key
-- Returns:
- ICacheElement, a wrapper around the key, value, and attributes
- Throws:
IOException
-
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
- Throws:
IOException
-
getMultipleWithEventLogging
protected final Map<K,ICacheElement<K, getMultipleWithEventLoggingV>> (Set<K> keys) throws IOException 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
- Throws:
IOException
-
getMatching
Gets items from the cache matching the given pattern. Items from memory will replace those from remote sources. This only works with string keys. It's too expensive to do a toString on every key. Auxiliaries will do their best to handle simple expressions. For instance, the JDBC disk cache will convert * to % and . to _- Parameters:
pattern
-- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data matching the pattern.
- Throws:
IOException
-
getMatchingWithEventLogging
protected final Map<K,ICacheElement<K, getMatchingWithEventLoggingV>> (String pattern) throws IOException Gets matching items from the cache based on the given pattern.- Parameters:
pattern
-- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data matching the pattern.
- Throws:
IOException
-
processGetMatching
Implementation of getMatching.- Parameters:
pattern
-- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data matching the pattern.
- Throws:
IOException
-
remove
Removes the item from the cache. Wraps the remove in event logs.- Parameters:
key
-- Returns:
- boolean, whether or not the item was removed
- Throws:
IOException
-
removeWithEventLogging
Removes the item from the cache. Wraps the remove in event logs.- Parameters:
key
-- Returns:
- boolean, whether or not the item was removed
- Throws:
IOException
-
processRemove
Specific implementation of remove.- Parameters:
key
-- Returns:
- boolean, whether or not the item was removed
- Throws:
IOException
-
removeAll
Removes all from the region. Wraps the removeAll in event logs.- Throws:
IOException
-
removeAllWithEventLogging
Removes all from the region. Wraps the removeAll in event logs.- Throws:
IOException
-
processRemoveAll
Specific implementation of removeAll.- Throws:
IOException
-
dispose
Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie.- Throws:
IOException
-
disposeWithEventLogging
Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie. Wraps the removeAll in event logs.- Throws:
IOException
-
processDispose
Specific implementation of dispose.- Throws:
IOException
-