Class CoherenceCache
java.lang.Object
com.oracle.coherence.spring.cache.CoherenceCache
- All Implemented Interfaces:
Cache
Coherence-specific implementation of
Cache
that defines common cache operations.- Since:
- 3.0
- Author:
- Gunnar Hillert
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.cache.Cache
Cache.ValueRetrievalException, Cache.ValueWrapper
-
Constructor Summary
ConstructorDescriptionCoherenceCache
(com.tangosol.net.NamedCache<Object, Object> cache, CoherenceCacheConfiguration cacheConfiguration) Construct the CoherenceCache. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
<T> T
<T> T
Return the value to which this cache maps the specified key.Return the usedCoherenceCacheConfiguration
.getName()
void
int
size()
Returns the number of key-value mappings of the underlyingNamedCache
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.cache.Cache
evictIfPresent, invalidate, putIfAbsent
-
Constructor Details
-
CoherenceCache
public CoherenceCache(com.tangosol.net.NamedCache<Object, Object> cache, CoherenceCacheConfiguration cacheConfiguration) Construct the CoherenceCache.- Parameters:
cache
- must not be nullcacheConfiguration
- must not be null
-
-
Method Details
-
clear
public void clear() -
evict
-
get
-
get
-
get
Return the value to which this cache maps the specified key. If the key does not exist in the cache, the method will obtain that value using the provided valueLoader. In that case, the key will be locked, unlessCoherenceCacheConfiguration.isUseLocks()
returns false.- Specified by:
get
in interfaceCache
- Type Parameters:
T
- type of the return value.- Parameters:
key
- might be null. SeeMap.get(Object)
.valueLoader
- must not be null.- Returns:
- the value from the cache.
-
getName
-
getNativeCache
- Specified by:
getNativeCache
in interfaceCache
-
put
-
size
public int size()Returns the number of key-value mappings of the underlyingNamedCache
.- Returns:
- the number of key-value mappings in this map
-
getCacheConfiguration
Return the usedCoherenceCacheConfiguration
.- Returns:
- never returns
null
.
-