automatic schema update done by configuring the localsessionfactory for
[utils] / support / src / main / java / org / wamblee / cache / EhCache.java
index ca11ab3f72c71f13aa92341afb6f5ba13fd064e2..ffbbab4baf850ebcfa0a7e4d13594e4f9bb35870 100644 (file)
@@ -24,6 +24,8 @@ 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;
@@ -61,7 +63,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 +119,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();
     }
 }