public class GuavaCacheService extends AbstractService implements CacheService
CacheService implementation wrapping a guava Cache.| Constructor and Description |
|---|
GuavaCacheService() |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(Object key) |
<V> V |
get(Object key,
Callable<V> valueLoader) |
void |
initialize()
Performs any needed initialization when the service is first loaded.
|
void |
put(Object key,
Object value)
Stores the given object in the cache.
|
getContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitregisterEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiondisposepublic void initialize()
Service
NB: This method is not intended to be called directly. It is called by
the service framework itself (specifically by the ServiceHelper)
when initializing the service. It should not be called a second time.
initialize in interface Initializableinitialize in interface Servicepublic void put(Object key, Object value)
CacheServiceput in interface CacheServicekey - A key.value - A value.public Object get(Object key)
get in interface CacheServicekey - A keypublic <V> V get(Object key, Callable<V> valueLoader) throws ExecutionException
get in interface CacheServicekey - A keyvalueLoader - A value loader which will be used if null is returned
for the given key.ExecutionExceptionCopyright © 2015–2022 SciJava. All rights reserved.