Package dev.voidframework.cache.engine
Class MemoryCacheEngine
java.lang.Object
dev.voidframework.cache.engine.MemoryCacheEngine
- All Implemented Interfaces:
CacheEngine
In-memory cache implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryCacheEngine(com.typesafe.config.Config configuration) Build a new instance. -
Method Summary
-
Constructor Details
-
MemoryCacheEngine
@Inject public MemoryCacheEngine(com.typesafe.config.Config configuration) Build a new instance.- Parameters:
configuration- The application configuration
-
-
Method Details
-
get
Description copied from interface:CacheEngineRetrieves a value from cache.- Specified by:
getin interfaceCacheEngine- Parameters:
cacheKey- The key- Returns:
- The value, otherwise,
null
-
set
Description copied from interface:CacheEngineSets a value to the cache.- Specified by:
setin interfaceCacheEngine- Parameters:
cacheKey- The keyvalue- The valuetimeToLive- Retention time (in seconds)
-
remove
Description copied from interface:CacheEngineRemoves a value from cache.- Specified by:
removein interfaceCacheEngine- Parameters:
cacheKey- The key
-