public class DefaultCacheService extends AbstractService implements CacheService
CacheService implementation. Wraps a WeakHashMap| Constructor and Description |
|---|
DefaultCacheService() |
| 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.
|
dispose, getContext, registerEventHandlers, setContext, toStringcompareTo, getInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitregisterEventHandlerscontext, getContext, setContextgetPriority, setPrioritycompareTogetInfo, setInfodisposepublic 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.ExecutionExceptionpublic 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 Serviceinitialize in class AbstractServiceCopyright © 2009–2016 SciJava. All rights reserved.