|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ehcache.core.Ehcache<K,V>
public class Ehcache<K,V>
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.ehcache.Cache |
|---|
Cache.Entry<K,V> |
| Field Summary | |
|---|---|
protected org.slf4j.Logger |
logger
|
| Constructor Summary | |
|---|---|
Ehcache(CacheConfiguration<K,V> configuration,
Store<K,V> store,
CacheEventDispatcher<K,V> eventDispatcher,
org.slf4j.Logger logger)
|
|
Ehcache(CacheConfiguration<K,V> configuration,
Store<K,V> store,
CacheLoaderWriter<? super K,V> cacheLoaderWriter,
CacheEventDispatcher<K,V> eventDispatcher,
org.slf4j.Logger logger)
|
|
| Method Summary | |
|---|---|
void |
addHook(LifeCycled hook)
|
void |
clear()
Removes all mapping currently present in the Cache without invoking the CacheLoaderWriter or any
registered CacheEventListener instances
This is not an atomic operation and can potentially be very expensive |
void |
close()
Releases all data held in this UserManagedCache. |
boolean |
containsKey(K key)
Checks whether a mapping for the given key is present, without retrieving the associated value |
V |
get(K key)
Retrieve the value currently mapped to the provided key |
java.util.Map<K,V> |
getAll(java.util.Set<? extends K> keys)
Retrieves all values associated with the given keys. |
java.util.Map<BulkOps,org.terracotta.statistics.jsr166e.LongAdder> |
getBulkMethodEntries()
|
CacheLoaderWriter<? super K,V> |
getCacheLoaderWriter()
|
Jsr107Cache<K,V> |
getJsr107Cache()
|
CacheRuntimeConfiguration<K,V> |
getRuntimeConfiguration()
Exposes the CacheRuntimeConfiguration associated with this Cache instance. |
Status |
getStatus()
Returns the current Status for this CacheManager |
void |
init()
Attempts at having this UserManagedCache go to Status.AVAILABLE. |
java.util.Iterator<Cache.Entry<K,V>> |
iterator()
|
void |
put(K key,
V value)
Associates the provided value to the given key |
void |
putAll(java.util.Map<? extends K,? extends V> entries)
Associates all the provided key:value pairs. |
V |
putIfAbsent(K key,
V value)
If the provided key is not associated with a value, then associate it with the provided value. |
void |
remove(K key)
Removes the value, if any, associated with the provided key |
boolean |
remove(K key,
V value)
If the provided key is associated with the provided value then remove the entry. |
void |
removeAll(java.util.Set<? extends K> keys)
Removes any associates for the given keys. |
V |
replace(K key,
V value)
If the provided key is associated with a value, then replace that value with the provided value. |
boolean |
replace(K key,
V oldValue,
V newValue)
If the provided key is associated with oldValue, then replace that value with newValue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.slf4j.Logger logger
| Constructor Detail |
|---|
public Ehcache(CacheConfiguration<K,V> configuration,
Store<K,V> store,
CacheEventDispatcher<K,V> eventDispatcher,
org.slf4j.Logger logger)
public Ehcache(CacheConfiguration<K,V> configuration,
Store<K,V> store,
CacheLoaderWriter<? super K,V> cacheLoaderWriter,
CacheEventDispatcher<K,V> eventDispatcher,
org.slf4j.Logger logger)
| Method Detail |
|---|
public java.util.Map<BulkOps,org.terracotta.statistics.jsr166e.LongAdder> getBulkMethodEntries()
public V get(K key)
throws CacheLoadingException
Cache
get in interface Cache<K,V>key - the key to query the value for
CacheLoadingException - if the CacheLoaderWriter
associated with this cache was invoked and threw an Exception
public void put(K key,
V value)
throws CacheWritingException
Cache
put in interface Cache<K,V>key - the key, may not be nullvalue - the value, may not be null
CacheWritingException - if the CacheLoaderWriter
associated with this cache threw an Exception
while writing the value for the given key to underlying system of record.public boolean containsKey(K key)
Cache
containsKey in interface Cache<K,V>key - the key
public void remove(K key)
throws CacheWritingException
Cache
remove in interface Cache<K,V>key - the key to remove the value for
CacheWritingException - if the CacheLoaderWriter associated
with this cache threw an Exception while removing the value for the
given key from the underlying system of record.public void clear()
CacheCacheLoaderWriter or any
registered CacheEventListener instances
This is not an atomic operation and can potentially be very expensive
clear in interface Cache<K,V>public java.util.Iterator<Cache.Entry<K,V>> iterator()
iterator in interface java.lang.Iterable<Cache.Entry<K,V>>
public java.util.Map<K,V> getAll(java.util.Set<? extends K> keys)
throws BulkCacheLoadingException
Cache
getAll in interface Cache<K,V>keys - keys to query for
null if the key was not mapped
BulkCacheLoadingException - if loading some or all values failed
public void putAll(java.util.Map<? extends K,? extends V> entries)
throws BulkCacheWritingException
Cache
putAll in interface Cache<K,V>entries - key:value pairs to associate
BulkCacheWritingException - if the CacheLoaderWriter
associated with this cache threw an Exception
while writing given key:value pairs to underlying system of record.
public void removeAll(java.util.Set<? extends K> keys)
throws BulkCacheWritingException
Cache
removeAll in interface Cache<K,V>keys - keys to remove values for
BulkCacheWritingException - if the CacheLoaderWriter
associated with this cache threw an Exception
while removing mappings for given keys from underlying system of record.
public V putIfAbsent(K key,
V value)
throws CacheWritingException
Cache
putIfAbsent in interface Cache<K,V>key - the key to be associated withvalue - the value to associate
null if none
CacheWritingException - if the CacheLoaderWriter
associated with this cache threw an Exception
while writing the value for the given key to underlying system of record.
public boolean remove(K key,
V value)
throws CacheWritingException
Cache
remove in interface Cache<K,V>key - the key to removevalue - the value to check against
true if the entry was removed
CacheWritingException - if the CacheLoaderWriter
associated with this cache threw an Exception while removing the given key:value mapping
public V replace(K key,
V value)
throws CacheLoadingException,
CacheWritingException
Cache
replace in interface Cache<K,V>key - the key to be associated withvalue - the value to associate
null if none
CacheLoadingException - if the CacheLoaderWriter
associated with this cache was invoked and threw an Exception while loading
the value for the key
CacheWritingException - if the CacheLoaderWriter
associated with this cache was invoked and threw an Exception
while replacing value for given key on underlying system of record.
public boolean replace(K key,
V oldValue,
V newValue)
throws CacheLoadingException,
CacheWritingException
CacheoldValue, then replace that value with newValue.
replace in interface Cache<K,V>key - the key to be associated witholdValue - the value to check againstnewValue - the value to associate
true if the value was replaced
CacheLoadingException - if the CacheLoaderWriter
associated with this cache was invoked and threw an Exception while loading
the value for the key
CacheWritingException - if the CacheLoaderWriter
associated with this cache was invoked and threw an Exception
while replacing value for given key on underlying system of record.public CacheRuntimeConfiguration<K,V> getRuntimeConfiguration()
CacheCacheRuntimeConfiguration associated with this Cache instance.
getRuntimeConfiguration in interface Cache<K,V>public void init()
Status.AVAILABLE.
Should this throw, while the UserManagedCache isn't yet Status.AVAILABLE, it will try to go back
to Status.UNINITIALIZED properly.
init in interface UserManagedCache<K,V>public void close()
UserManagedCache
Should this throw, while the UserManagedCache isn't yet Status.UNINITIALIZED, it will keep on
trying to go to Status.UNINITIALIZED properly.
close in interface UserManagedCache<K,V>public Status getStatus()
UserManagedCacheStatus for this CacheManager
getStatus in interface UserManagedCache<K,V>Statuspublic void addHook(LifeCycled hook)
public Jsr107Cache<K,V> getJsr107Cache()
public CacheLoaderWriter<? super K,V> getCacheLoaderWriter()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||