git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'Jalview-JS/develop' into merge_js_develop
[jalview.git]
/
src
/
jalview
/
io
/
cache
/
AppCache.java
diff --git
a/src/jalview/io/cache/AppCache.java
b/src/jalview/io/cache/AppCache.java
index
eaf6ecd
..
fdcad08
100644
(file)
--- a/
src/jalview/io/cache/AppCache.java
+++ b/
src/jalview/io/cache/AppCache.java
@@
-20,6
+20,8
@@
*/
package jalview.io.cache;
*/
package jalview.io.cache;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.bin.Cache;
import java.util.Hashtable;
import jalview.bin.Cache;
import java.util.Hashtable;
@@
-31,22
+33,27
@@
import java.util.LinkedHashSet;
* @author tcnofoegbu
*
*/
* @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<String, LinkedHashSet<String>>();
+ }
+
public static final String DEFAULT_LIMIT = "99";
public static final String CACHE_DELIMITER = ";";
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<String, LinkedHashSet<String>> cacheItems;
private static final String DEFAULT_LIMIT_KEY = ".DEFAULT_LIMIT";
private Hashtable<String, LinkedHashSet<String>> cacheItems;
- private AppCache()
- {
- cacheItems = new Hashtable<String, LinkedHashSet<String>>();
- }
/**
* Method to obtain all the cache items for a given cache key
/**
* 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
* Method for persisting cache items for a given cache key
*
* @param cacheKey