Package one.microstream.cache.types
Interface Cache<K,V>
- Type Parameters:
K
- the key typeV
- the value type
- All Superinterfaces:
AutoCloseable
,javax.cache.Cache<K,V>
,Closeable
,Iterable<javax.cache.Cache.Entry<K,V>>
,Unwrappable
- All Known Implementing Classes:
Cache.Default
public interface Cache<K,V> extends javax.cache.Cache<K,V>, Unwrappable
JSR-107 compliant
Cache
.-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Cache.Default<K,V>
Nested classes/interfaces inherited from interface javax.cache.Cache
javax.cache.Cache.Entry<K extends Object,V extends Object>
Nested classes/interfaces inherited from interface one.microstream.cache.types.Unwrappable
Unwrappable.Static
-
Method Summary
Modifier and Type Method Description void
evict(Iterable<KeyValue<Object,CachedValue>> entriesToEvict)
Evicts given entries from this cache.CacheManager
getCacheManager()
CacheConfiguration<K,V>
getConfiguration()
Returns theCacheConfiguration
which was used to create this cache.static <K, V> Cache<K,V>
New(String name, CacheManager manager, CacheConfiguration<K,V> configuration)
default void
putAll(Map<? extends K,? extends V> map)
Adds all entries to this cache.default void
putAll(Map<? extends K,? extends V> map, boolean replaceExistingValues)
Adds all entries to this cache.void
putAll(Map<? extends K,? extends V> map, boolean replaceExistingValues, boolean useWriteThrough)
Adds all entries to this cache.void
setManagementEnabled(boolean enabled)
Enables or disables the management bean of this cache.void
setStatisticsEnabled(boolean enabled)
Enables or disables statistics gathering.long
size()
Returns the amount of entries in this cache.default <T> T
unwrap(Class<T> clazz)
Methods inherited from interface javax.cache.Cache
clear, close, containsKey, deregisterCacheEntryListener, get, getAll, getAndPut, getAndRemove, getAndReplace, getConfiguration, getName, invoke, invokeAll, isClosed, iterator, loadAll, put, putIfAbsent, registerCacheEntryListener, remove, remove, removeAll, removeAll, replace, replace
-
Method Details
-
getCacheManager
CacheManager getCacheManager() -
getConfiguration
CacheConfiguration<K,V> getConfiguration()Returns theCacheConfiguration
which was used to create this cache. -
size
long size()Returns the amount of entries in this cache.- Returns:
- this cache's size
-
putAll
Adds all entries to this cache.Short for
putAll(map, true)
- Specified by:
putAll
in interfacejavax.cache.Cache<K,V>
- See Also:
putAll(Map, boolean)
-
putAll
Adds all entries to this cache.Short for
putAll(map, replaceExistingValues, true)
- See Also:
putAll(Map, boolean, boolean)
-
putAll
void putAll(Map<? extends K,? extends V> map, boolean replaceExistingValues, boolean useWriteThrough)Adds all entries to this cache.- Parameters:
map
- entries to addreplaceExistingValues
- if values with same keys should be replacesuseWriteThrough
- enable write through mode for this operation
-
setManagementEnabled
void setManagementEnabled(boolean enabled)Enables or disables the management bean of this cache. -
setStatisticsEnabled
void setStatisticsEnabled(boolean enabled)Enables or disables statistics gathering. -
evict
Evicts given entries from this cache. -
unwrap
- Specified by:
unwrap
in interfacejavax.cache.Cache<K,V>
- Specified by:
unwrap
in interfaceUnwrappable
-
New
static <K, V> Cache<K,V> New(String name, CacheManager manager, CacheConfiguration<K,V> configuration)
-