Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java @ 171:7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
gnv-artifacts/trunk@208 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 09 Oct 2009 07:54:48 +0000 |
parents | bb45c5097cb6 |
children | 9a828e5a2390 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java Fri Oct 09 07:49:47 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java Fri Oct 09 07:54:48 2009 +0000 @@ -10,7 +10,7 @@ /** * @author Tim Englich <tim.englich@intevation.de> - * + * */ public class CacheFactory { @@ -18,10 +18,9 @@ * the logger, used to log exceptions and additonaly information */ private static Logger log = Logger.getLogger(CacheFactory.class); - + private final static String CACHENAME = "artifactdata"; - /** * The singleton Instance of this Factory. */ @@ -41,31 +40,35 @@ /** * This Method provides an singleton Instance of this Class. + * * @return an singleton Instance of this Class */ - public static CacheFactory getInstance(){ - if (instance == null){ + public static CacheFactory getInstance() { + if (instance == null) { instance = new CacheFactory(); } return instance; } - - + /** * Getting the ConnectionPool + * * @return the ConnectionPool */ - public Cache getCache(){ + public Cache getCache() { return this.cacheManager.getCache(CACHENAME); } /** - * Initializes the ConnectionPool. - * Should only be called once on system startup - * @param properties the Properties for the Individual Configuration of the ConnectionPool + * Initializes the ConnectionPool. Should only be called once on system + * startup + * + * @param properties + * the Properties for the Individual Configuration of the + * ConnectionPool */ - public void initializeCache(String configurationFileName){ - if (cacheManager == null){ + public void initializeCache(String configurationFileName) { + if (cacheManager == null) { cacheManager = new CacheManager(configurationFileName); cacheManager.addCache(CACHENAME); } @@ -73,9 +76,10 @@ /** * Checks if the ConnectionPool has already been initialized. + * * @return true if the ConnectionPool is initialized. */ - public boolean isInitialized(){ + public boolean isInitialized() { return this.cacheManager != null; }