|
Openfire 3.6.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.util.cache.CacheWrapper<K,V>
public class CacheWrapper<K,V>
Acts as a proxy for a Cache implementation. The Cache implementation can be switched on the fly, which enables users to hold a reference to a CacheWrapper object, but for the underlying Cache implementation to switch from clustered to local, etc.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
CacheWrapper(Cache<K,V> cache)
|
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public CacheWrapper(Cache<K,V> cache)
Method Detail |
---|
public Cache<K,V> getWrappedCache()
public void setWrappedCache(Cache<K,V> cache)
public String getName()
Cache
getName
in interface Cache<K,V>
public void setName(String name)
Cache
setName
in interface Cache<K,V>
name
- the name of the cachepublic long getMaxCacheSize()
Cache
getMaxCacheSize
in interface Cache<K,V>
public void setMaxCacheSize(int maxSize)
Cache
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
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 int size()
size
in interface Map<K,V>
public void clear()
clear
in interface Map<K,V>
public boolean isEmpty()
isEmpty
in interface Map<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public Collection<V> values()
values
in interface Map<K,V>
public void putAll(Map<? extends K,? extends V> t)
putAll
in interface Map<K,V>
public Set<Map.Entry<K,V>> entrySet()
entrySet
in interface Map<K,V>
public Set<K> keySet()
keySet
in interface Map<K,V>
public V get(Object key)
get
in interface Map<K,V>
public V remove(Object key)
remove
in interface Map<K,V>
public V put(K key, V value)
put
in interface Map<K,V>
|
Openfire 3.6.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |