Added author to all java files with class comments.
[utils] / support / src / main / java / org / wamblee / cache / EhCache.java
index ca11ab3f72c71f13aa92341afb6f5ba13fd064e2..0df1e61f165edee1e8741536f9960cea318905ea 100644 (file)
@@ -24,12 +24,16 @@ import net.sf.ehcache.Cache;
 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> {
@@ -61,7 +65,7 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
             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
@@ -117,10 +121,6 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
      * @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();
     }
 }