Class EhCacheImpl
- java.lang.Object
-
- org.apache.directory.fortress.core.util.cache.EhCacheImpl
-
- All Implemented Interfaces:
Cache
public class EhCacheImpl extends Object implements Cache
This class provides cache functionality from Ehcache provider.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
clear(Object key)
Clear a cache entry for a given name.net.sf.ehcache.search.Query
createQuery()
Create a search query builder for the cache.void
flush()
Remove all entries from this cache.Object
get(Object key)
Given a key name, return the corresponding value.<T> net.sf.ehcache.search.Attribute<T>
getSearchAttribute(String attributeName)
Retrieve the Cache attributevoid
put(Object key, Object value)
Add a new entry to the cache.
-
-
-
Method Detail
-
get
public Object get(Object key) throws org.apache.directory.fortress.core.util.cache.CacheException
Given a key name, return the corresponding value.
-
put
public void put(Object key, Object value) throws org.apache.directory.fortress.core.util.cache.CacheException
Add a new entry to the cache.
-
clear
public boolean clear(Object key) throws org.apache.directory.fortress.core.util.cache.CacheException
Clear a cache entry for a given name.- Specified by:
clear
in interfaceCache
- Parameters:
key
- name that entry is stored as.- Returns:
- boolean value will be false if entry not found and true if entry was found and removed.
- Throws:
org.apache.directory.fortress.core.util.cache.CacheException
- in the event ehcache throws an exception it will be wrapped.
-
flush
public void flush() throws org.apache.directory.fortress.core.util.cache.CacheException
Remove all entries from this cache.
-
getSearchAttribute
public <T> net.sf.ehcache.search.Attribute<T> getSearchAttribute(String attributeName) throws org.apache.directory.fortress.core.util.cache.CacheException
Retrieve the Cache attribute- Specified by:
getSearchAttribute
in interfaceCache
- Type Parameters:
T
- the type of search attribute- Parameters:
attributeName
- the name of search attribute- Returns:
- the search attribute
- Throws:
org.apache.directory.fortress.core.util.cache.CacheException
- in the event ehcache throws an exception it will be wrapped.
-
createQuery
public net.sf.ehcache.search.Query createQuery()
Create a search query builder for the cache.- Specified by:
createQuery
in interfaceCache
- Returns:
- a new Query builder
-
clear
public void clear()
-
-