public class CacheWrapper<K,V> extends Object implements Cache<K,V>
Constructor and Description |
---|
CacheWrapper(Cache<K,V> cache) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
long |
getCacheHits()
Returns the number of cache hits.
|
long |
getCacheMisses()
Returns the number of cache misses.
|
int |
getCacheSize()
Returns the size of the cache contents in bytes.
|
long |
getMaxCacheSize()
Returns the maximum size of the cache in bytes.
|
long |
getMaxLifetime()
Returns the maximum number of milliseconds that any object can live
in cache.
|
String |
getName()
Returns the name of the cache.
|
Cache<K,V> |
getWrappedCache() |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(Object key) |
void |
setMaxCacheSize(int maxSize)
Sets the maximum size of the cache in bytes.
|
void |
setMaxLifetime(long maxLifetime)
Sets the maximum number of milliseconds that any object can live
in cache.
|
void |
setName(String name)
Sets the name of the cache
|
void |
setWrappedCache(Cache<K,V> cache) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public String getName()
Cache
public void setName(String name)
Cache
public long getMaxCacheSize()
Cache
getMaxCacheSize
in interface Cache<K,V>
public void setMaxCacheSize(int maxSize)
Cache
Note: If using the Hazelcast clustering plugin, this will not take effect until the next time the cache is created
setMaxCacheSize
in interface Cache<K,V>
maxSize
- the maximum size of the cache in bytes.public long getMaxLifetime()
Cache
getMaxLifetime
in interface Cache<K,V>
public void setMaxLifetime(long maxLifetime)
Cache
Note: If using the Hazelcast clustering plugin, this will not take effect until the next time the cache is created
setMaxLifetime
in interface Cache<K,V>
maxLifetime
- the maximum number of milliseconds before objects are expired.public int getCacheSize()
Cache
getCacheSize
in interface Cache<K,V>
public long getCacheHits()
Cache
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheHits
in interface Cache<K,V>
public long getCacheMisses()
Cache
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheMisses
in interface Cache<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
Copyright © 2003-2008 Jive Software.