X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2Fcache%2FAppCache.java;fp=src%2Fjalview%2Fio%2Fcache%2FAppCache.java;h=fdcad082d523e7ad5f101bf92caf49f66b7ee08c;hb=586ade46bdcd05ff028a1cff82c3c527326d28ec;hp=eaf6ecd65b25423572a18958c5287a29ad1de902;hpb=adcef27f5747b4e70e89a56c3735bc3afb8ce9bf;p=jalview.git diff --git a/src/jalview/io/cache/AppCache.java b/src/jalview/io/cache/AppCache.java index eaf6ecd..fdcad08 100644 --- a/src/jalview/io/cache/AppCache.java +++ b/src/jalview/io/cache/AppCache.java @@ -20,6 +20,8 @@ */ package jalview.io.cache; +import jalview.bin.ApplicationSingletonProvider; +import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI; import jalview.bin.Cache; import java.util.Hashtable; @@ -31,22 +33,27 @@ import java.util.LinkedHashSet; * @author tcnofoegbu * */ -public class AppCache +public class AppCache implements ApplicationSingletonI { + + public static AppCache getInstance() + { + return (AppCache) ApplicationSingletonProvider.getInstance(AppCache.class); + } + + private AppCache() + { + cacheItems = new Hashtable>(); + } + public static final String DEFAULT_LIMIT = "99"; public static final String CACHE_DELIMITER = ";"; - private static AppCache instance = null; - private static final String DEFAULT_LIMIT_KEY = ".DEFAULT_LIMIT"; private Hashtable> cacheItems; - private AppCache() - { - cacheItems = new Hashtable>(); - } /** * Method to obtain all the cache items for a given cache key @@ -66,20 +73,6 @@ public class AppCache } /** - * Returns a singleton instance of AppCache - * - * @return - */ - public static AppCache getInstance() - { - if (instance == null) - { - instance = new AppCache(); - } - return instance; - } - - /** * Method for persisting cache items for a given cache key * * @param cacheKey