public class EhCache<KeyType extends Serializable,ValueType extends Serializable> extends Object implements Cache<KeyType,ValueType>
| Constructor and Description |
|---|
EhCache(InputResource aResource,
String aCacheName)
Constructs a cache based on EHCache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all entries from the cache.
|
ValueType |
get(KeyType aKey)
Retrieves a value from the cache.
|
void |
put(KeyType aKey,
ValueType aValue)
Adds a key-value pair to the cache.
|
void |
remove(KeyType aKey)
Removes an entry from the cache.
|
public EhCache(InputResource aResource, String aCacheName) throws IOException, net.sf.ehcache.CacheException
aResource - Resource containing the configuration file for EHCache.aCacheName - Name of the cache to use. If a cache with this name does not
exist, one is created based on default settings.IOExceptionnet.sf.ehcache.CacheExceptionpublic void put(KeyType aKey, ValueType aValue)
Cacheput in interface Cache<KeyType extends Serializable,ValueType extends Serializable>aKey - Key.aValue - Value.public ValueType get(KeyType aKey)
Cacheget in interface Cache<KeyType extends Serializable,ValueType extends Serializable>aKey - Key to retrieve.public void remove(KeyType aKey)
Cacheremove in interface Cache<KeyType extends Serializable,ValueType extends Serializable>aKey - Key to remove the entry for.public void clear()
Cacheclear in interface Cache<KeyType extends Serializable,ValueType extends Serializable>Copyright © 2025. All rights reserved.