Class AbstractCachedFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.AbstractCachedFetcher
-
- All Implemented Interfaces:
CachedFetcher
- Direct Known Subclasses:
CachedChebiFetcher
,CachedEuroPubmedCentralFetcher
,CachedOlsFetcher
,CachedUniprotProteinFetcher
,CachedUniprotTaxonomyFetcher
,CachedUnisaveClient
public abstract class AbstractCachedFetcher extends Object implements CachedFetcher
Abstract class for fetchers- Since:
09/09/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EHCACHE_CONFIG_FILE
ConstantEHCACHE_CONFIG_FILE="/service.ehcache.xml"
-
Constructor Summary
Constructors Constructor Description AbstractCachedFetcher(String cacheName)
Constructor for AbstractCachedFetcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCache()
clearCache.Object
getFromCache(String key)
Fetch an element from the cache with a given keyvoid
initialiseCache()
initialiseCache.void
initialiseCache(String settingsFile)
Initialises the cache with the settings in the file at the location.void
shutDownCache()
shutDownCache.void
storeInCache(String key, Object data)
Stores a given object in the cache with a key
-
-
-
Field Detail
-
EHCACHE_CONFIG_FILE
public static final String EHCACHE_CONFIG_FILE
ConstantEHCACHE_CONFIG_FILE="/service.ehcache.xml"
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialiseCache
public void initialiseCache()
initialiseCache.
- Specified by:
initialiseCache
in interfaceCachedFetcher
-
initialiseCache
public void initialiseCache(String settingsFile)
Initialises the cache with the settings in the file at the location.- Specified by:
initialiseCache
in interfaceCachedFetcher
- Parameters:
settingsFile
- The path of a file with the settings for an EHCache
-
getFromCache
public Object getFromCache(String key)
Fetch an element from the cache with a given key- Specified by:
getFromCache
in interfaceCachedFetcher
- Parameters:
key
- aString
object.- Returns:
- a
Object
object.
-
storeInCache
public void storeInCache(String key, Object data)
Stores a given object in the cache with a key- Specified by:
storeInCache
in interfaceCachedFetcher
- Parameters:
key
- aString
object.data
- aObject
object.
-
clearCache
public void clearCache()
clearCache.
- Specified by:
clearCache
in interfaceCachedFetcher
-
shutDownCache
public void shutDownCache()
shutDownCache.
- Specified by:
shutDownCache
in interfaceCachedFetcher
-
-