Class NullCache
java.lang.Object
org.pipservices3.components.cache.NullCache
- All Implemented Interfaces:
ICache
public class NullCache extends Object implements ICache
Dummy cache implementation that doesn't do anything.
It can be used in testing or in situations when cache is required but shall be disabled.
- See Also:
ICache
-
Constructor Summary
Constructors Constructor Description NullCache()
Creates instance of null cache component. -
Method Summary
Modifier and Type Method Description void
remove(String correlationId, String key)
Removes a value from the cache by its key.Object
retrieve(String correlationId, String key)
Retrieves cached value from the cache using its key.Object
store(String correlationId, String key, Object value, long timeToLive)
Stores value in the cache with expiration time.
-
Constructor Details
-
NullCache
public NullCache()Creates instance of null cache component.
-
-
Method Details
-
retrieve
Retrieves cached value from the cache using its key. If value is missing in the cache or expired it returns null. -
store
Stores value in the cache with expiration time. -
remove
Removes a value from the cache by its key.
-