(no commit message)
[utils] / support / src / org / wamblee / cache / EhCache.java
index 4f56cd3a0fd74dc203c5aa91da49989a8b8b6dc8..b870f3256bdff154fed39c3fee534479a427ffab 100644 (file)
@@ -35,23 +35,25 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
         implements org.wamblee.cache.Cache<KeyType, ValueType> {
 
     private static final Logger LOGGER = Logger.getLogger(EhCache.class);
-    
+
     /**
-     * EH Cache manager. 
+     * EH Cache manager.
      */
     private CacheManager _manager;
 
     /**
-     * EH cache. 
+     * EH cache.
      */
     private Cache _cache;
 
     /**
-     * Constructs a cache based on EHCache. 
-     * @param aResource Resource containing the configuration file for 
-     *    EHCache. 
-     * @param aCacheName Name of the cache to use. If a cache with this name does 
-     *    not exist, one is created based on default settings. 
+     * Constructs a cache based on EHCache.
+     * 
+     * @param aResource
+     *            Resource containing the configuration file for EHCache.
+     * @param aCacheName
+     *            Name of the cache to use. If a cache with this name does not
+     *            exist, one is created based on default settings.
      * @throws IOException
      * @throws CacheException
      */
@@ -62,11 +64,12 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
             _manager = CacheManager.create();
             _cache = _manager.getCache(aCacheName);
             if (_cache == null) {
-                LOGGER.warn("Creating cache '" + aCacheName + "' because it is not configured");;
+                LOGGER.warn("Creating cache '" + aCacheName
+                        + "' because it is not configured");
                 _manager.addCache(aCacheName);
                 _cache = _manager.getCache(aCacheName);
             }
-            assert _cache != null; 
+            assert _cache != null;
         } finally {
             is.close();
         }
@@ -89,11 +92,11 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
      */
     public ValueType get(KeyType aKey) {
         try {
-            Element element =  _cache.get(aKey);
-            if ( element == null ) { 
-                return null; 
+            Element element = _cache.get(aKey);
+            if (element == null) {
+                return null;
             }
-            return (ValueType)element.getValue();
+            return (ValueType) element.getValue();
         } catch (CacheException e) {
             throw new RuntimeException("Cache problem key = '" + aKey + "'", e);
         }