KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > cache > CacheManagerFactory


1 package info.magnolia.cms.cache;
2
3 /**
4  * A Factory for a singleton <code>CacheManager</code> object. Creates a <code>ManageableCacheManager</code>
5  * wrapping a <code>ThreadedCacheManager</code> and stores it in its cacheManager instance variable. Supposed to be
6  * later replaced with a more sophisticated, configurable method like e.g. dependency injection using the Spring
7  * Framework.
8  * @author Andreas Brenk
9  * @author Fabrizio Giustina
10  * @since 3.0
11  */

12 public class CacheManagerFactory {
13
14     private static CacheManager cacheManager;
15
16     public static synchronized CacheManager getCacheManager() {
17         if (cacheManager == null) {
18             cacheManager = new ManageableCacheManager(new DefaultCacheManager());
19         }
20
21         return cacheManager;
22     }
23 }
24
Popular Tags