reverting back last change
authorCherian Mathew <c.mathew@bgbm.org>
Fri, 12 Jun 2015 10:48:34 +0000 (12:48 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Fri, 12 Jun 2015 10:48:34 +0000 (12:48 +0200)
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/cache/CdmCacher.java

index d931cc25d6d0d1e410021519e546512bc19411a7..2641fd1fa324cc2f1adddb6f6be82e3870f90544 100644 (file)
@@ -40,6 +40,10 @@ public abstract class CdmCacher implements ICdmUuidCacher {
      *
      */
     private void init() {
+        if(getDefaultCache() == null) {
+            // Create default cache
+            getDefaultCacheManager().addCache(new Cache(getDefaultCacheConfiguration()));
+        }
         setup();
     }
 
@@ -73,20 +77,16 @@ public abstract class CdmCacher implements ICdmUuidCacher {
         .statistics(true);
 
     }
+    
+    
 
     /**
      * Returns the default cache
      *
      * @return
      */
-    public Cache getDefaultCache() {
-        Cache defaultCache = getDefaultCacheManager().getCache(DEFAULT_CACHE_NAME);
-        if(defaultCache == null) {
-            // Create default cache
-            defaultCache = new Cache(getDefaultCacheConfiguration());
-            getDefaultCacheManager().addCache(defaultCache);
-        }
-        return defaultCache;
+    public static Cache getDefaultCache() {
+        return getDefaultCacheManager().getCache(DEFAULT_CACHE_NAME);
     }