Package uk.gov.gchq.gaffer.cache.impl
Class HashMapCacheService
- java.lang.Object
-
- uk.gov.gchq.gaffer.cache.impl.HashMapCacheService
-
- All Implemented Interfaces:
ICacheService
public class HashMapCacheService extends Object implements ICacheService
Simple implementation of theICacheService
interface which uses aHashMapCache
as the cache implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static String
JAVA_SERIALISATION_CACHE
static String
STATIC_CACHE
-
Constructor Summary
Constructors Constructor Description HashMapCacheService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
ICache<K,V>getCache(String cacheName)
Get the named cache from the cache service.void
initialise(Properties properties)
Initialise the cache service based on the suppliedProperties
object.void
shutdown()
Shutdown the cache service.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.gov.gchq.gaffer.cache.ICacheService
clearCache, getAllKeysFromCache, getAllValuesFromCache, getFromCache, putInCache, putSafeInCache, removeFromCache, sizeOfCache
-
-
-
-
Field Detail
-
STATIC_CACHE
public static final String STATIC_CACHE
- See Also:
- Constant Field Values
-
JAVA_SERIALISATION_CACHE
public static final String JAVA_SERIALISATION_CACHE
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialise
public void initialise(Properties properties)
Description copied from interface:ICacheService
Initialise the cache service based on the suppliedProperties
object.- Specified by:
initialise
in interfaceICacheService
- Parameters:
properties
- the Properties object to apply to the cache service
-
shutdown
public void shutdown()
Description copied from interface:ICacheService
Shutdown the cache service.- Specified by:
shutdown
in interfaceICacheService
-
getCache
public <K,V> ICache<K,V> getCache(String cacheName)
Description copied from interface:ICacheService
Get the named cache from the cache service.- Specified by:
getCache
in interfaceICacheService
- Type Parameters:
K
- The object type that acts as the key for the cacheV
- The value that is stored in the cache- Parameters:
cacheName
- the name of the cache to retrieve- Returns:
- the requested cache object
-
-