public interface ICacheAccess<K,V> extends ICacheAccessManagement
Modifier and Type | Method and Description |
---|---|
V |
get(K name)
Basic get method.
|
V |
get(K name,
Supplier<V> supplier)
Basic get method.
|
ICacheElement<K,V> |
getCacheElement(K name)
This method returns the ICacheElement<K, V> wrapper which provides access to element info and other
attributes.
|
Map<K,ICacheElement<K,V>> |
getCacheElements(Set<K> names)
Get multiple elements from the cache based on a set of cache keys.
|
IElementAttributes |
getElementAttributes(K name)
Gets the elementAttributes attribute of the ICacheAccess object
|
Map<K,V> |
getMatching(String pattern)
Retrieve matching objects from the cache region this instance provides access to.
|
Map<K,ICacheElement<K,V>> |
getMatchingCacheElements(String pattern)
Get multiple elements from the cache based on a set of cache keys.
|
void |
put(K name,
V obj)
Puts and/or overrides an element with the name in that region.
|
void |
put(K name,
V obj,
IElementAttributes attr)
Description of the Method
|
void |
putSafe(K name,
V obj)
Puts in cache if an item does not exist with the name in that region.
|
void |
remove(K name)
Remove an object for this key if one exists, else do nothing.
|
void |
resetElementAttributes(K name,
IElementAttributes attributes)
Reset the attributes on the object matching this key name.
|
clear, dispose, freeMemoryElements, getCacheAttributes, getDefaultElementAttributes, getStatistics, getStats, setCacheAttributes, setDefaultElementAttributes
V get(K name, Supplier<V> supplier)
name
- supplier
- supplier to be called if the value is not foundMap<K,V> getMatching(String pattern)
pattern
- - a key pattern for the objects storedvoid putSafe(K name, V obj) throws CacheException
name
- obj
- CacheException
void put(K name, V obj) throws CacheException
name
- obj
- CacheException
void put(K name, V obj, IElementAttributes attr) throws CacheException
name
- obj
- attr
- CacheException
ICacheElement<K,V> getCacheElement(K name)
This returns a reference to the wrapper. Any modifications will be reflected in the cache. No defensive copy is made.
This method is most useful if you want to determine things such as the how long the element has been in the cache.
The last access time in the ElementAttributes should be current.
name
- Key the object is stored asMap<K,ICacheElement<K,V>> getCacheElements(Set<K> names)
This method returns the ICacheElement<K, V> wrapper which provides access to element info and other attributes.
This returns a reference to the wrapper. Any modifications will be reflected in the cache. No defensive copy is made.
This method is most useful if you want to determine things such as the how long the element has been in the cache.
The last access time in the ElementAttributes should be current.
names
- set of Object cache keysMap<K,ICacheElement<K,V>> getMatchingCacheElements(String pattern)
This method returns the ICacheElement<K, V> wrapper which provides access to element info and other attributes.
This returns a reference to the wrapper. Any modifications will be reflected in the cache. No defensive copy is made.
This method is most useful if you want to determine things such as the how long the element has been in the cache.
The last access time in the ElementAttributes should be current.
pattern
- key search patternvoid remove(K name) throws CacheException
name
- CacheException
void resetElementAttributes(K name, IElementAttributes attributes) throws CacheException
name
- attributes
- CacheException
IElementAttributes getElementAttributes(K name) throws CacheException
name
- CacheException
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.