import net.sf.ehcache.CacheException;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
+import net.sf.ehcache.config.Configuration;
+import net.sf.ehcache.config.ConfigurationFactory;
import org.apache.log4j.Logger;
import org.wamblee.io.InputResource;
/**
* Cache implemented on top of EhCache.
+ *
+ * @author Erik Brakkee
*/
public class EhCache<KeyType extends Serializable, ValueType extends Serializable>
implements org.wamblee.cache.Cache<KeyType, ValueType> {
throws IOException, CacheException {
InputStream is = aResource.getInputStream();
try {
- _manager = CacheManager.create(is);
+ _manager = new CacheManager(is);
_cache = _manager.getCache(aCacheName);
if (_cache == null) {
LOGGER.warn("Creating cache '" + aCacheName
* @see org.wamblee.cache.Cache#clear()
*/
public void clear() {
- try {
- _cache.removeAll();
- } catch (IOException e) {
- throw new RuntimeException("Problem removing items from cache", e);
- }
+ _cache.removeAll();
}
}