Package com.openhtmltopdf.extend.impl
Class FSDefaultCacheStore
- java.lang.Object
-
- com.openhtmltopdf.extend.impl.FSDefaultCacheStore
-
- All Implemented Interfaces:
FSCacheEx<String,FSCacheValue>
public class FSDefaultCacheStore extends Object implements FSCacheEx<String,FSCacheValue>
A simple default cache implementation, mainly for testing. For production you will probably want to wrap Guava's cache implementation or something similar. This implementation does not use synchronisation beyond using aConcurrentHashMapinternally. Specifically, theget(String, Callable)may call the loader multiple times if called in close succession.
-
-
Constructor Summary
Constructors Constructor Description FSDefaultCacheStore()
-
Method Summary
Modifier and Type Method Description FSCacheValueget(String key)FSCacheValueget(String key, Callable<? extends FSCacheValue> loader)voidput(String key, FSCacheValue value)
-
-
-
Method Detail
-
put
public void put(String key, FSCacheValue value)
- Specified by:
putin interfaceFSCacheEx<String,FSCacheValue>
-
get
public FSCacheValue get(String key, Callable<? extends FSCacheValue> loader)
- Specified by:
getin interfaceFSCacheEx<String,FSCacheValue>
-
get
public FSCacheValue get(String key)
- Specified by:
getin interfaceFSCacheEx<String,FSCacheValue>
-
-