updated coding rules.
[utils] / support / general / src / main / java / org / wamblee / cache / EhCache.java
index 6a631866c109f405a0e47d10231da478ff006c01..1d9da8a2bcbf79c0eade4855cf2775589736f242 100644 (file)
@@ -41,12 +41,12 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
     /**
      * EH Cache manager.
      */
-    private CacheManager _manager;
+    private CacheManager manager;
 
     /**
      * EH cache.
      */
-    private Cache _cache;
+    private Cache cache;
 
     /**
      * Constructs a cache based on EHCache.
@@ -63,15 +63,15 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
             throws IOException, CacheException {
         InputStream is = aResource.getInputStream();
         try {
-               _manager = new CacheManager(is);
-            _cache = _manager.getCache(aCacheName);
-            if (_cache == null) {
+               manager = new CacheManager(is);
+            cache = manager.getCache(aCacheName);
+            if (cache == null) {
                 LOGGER.warn("Creating cache '" + aCacheName
                         + "' because it is not configured");
-                _manager.addCache(aCacheName);
-                _cache = _manager.getCache(aCacheName);
+                manager.addCache(aCacheName);
+                cache = manager.getCache(aCacheName);
             }
-            assert _cache != null;
+            assert cache != null;
         } finally {
             is.close();
         }
@@ -84,7 +84,7 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
      * @see org.wamblee.cache.Cache#put(KeyType, ValueType)
      */
     public void put(KeyType aKey, ValueType aValue) {
-        _cache.put(new Element(aKey, aValue));
+        cache.put(new Element(aKey, aValue));
     }
 
     /*
@@ -94,7 +94,7 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
      */
     public ValueType get(KeyType aKey) {
         try {
-            Element element = _cache.get(aKey);
+            Element element = cache.get(aKey);
             if (element == null) {
                 return null;
             }
@@ -110,7 +110,7 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
      * @see org.wamblee.cache.Cache#remove(KeyType)
      */
     public void remove(KeyType aKey) {
-        _cache.remove(aKey);
+        cache.remove(aKey);
     }
 
     /*
@@ -119,6 +119,6 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
      * @see org.wamblee.cache.Cache#clear()
      */
     public void clear() {
-        _cache.removeAll();
+        cache.removeAll();
     }
 }