Package growthbook.sdk.java.sandbox
Class InMemoryCachingManagerImpl
java.lang.Object
growthbook.sdk.java.sandbox.InMemoryCachingManagerImpl
- All Implemented Interfaces:
GbCacheManager
Simple process-lifetime in-memory cache manager.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns when the cached value was last updated, in epoch milliseconds.voidsaveContent(String key, String data)
-
Constructor Details
-
InMemoryCachingManagerImpl
public InMemoryCachingManagerImpl()
-
-
Method Details
-
saveContent
- Specified by:
saveContentin interfaceGbCacheManager
-
loadCache
- Specified by:
loadCachein interfaceGbCacheManager
-
getLastUpdatedMillis
Description copied from interface:GbCacheManagerReturns when the cached value was last updated, in epoch milliseconds.The optional background feature refresh interval uses this timestamp to decide whether cached features are fresh enough to skip a network refresh. Custom cache implementations may return
nullwhen timestamp tracking is unsupported or when the key does not exist; in that case the SDK treats cache freshness as unknown and performs the network refresh. Implementations should throwFeatureCacheExceptionfor real cache access failures.- Specified by:
getLastUpdatedMillisin interfaceGbCacheManager
-
clearCache
public void clearCache()- Specified by:
clearCachein interfaceGbCacheManager
-