Package org.cyclos.impl.utils
Interface LocalStorage<K,V>
-
- All Superinterfaces:
ExpirableStorage<K,V,BiPredicate<K,V>>,Storage<K,V>
public interface LocalStorage<K,V> extends ExpirableStorage<K,V,BiPredicate<K,V>>
AnExpirableStorageto be used locally. When in a cluster, each node will have its local copy. Each stored value expires after some time, according to theLocalStorageType. The difference between this andCacheis that this local storage is used to store instances which can be reused between requests, even if not serializable. When Cyclos runs in a cluster, caches evicts are broadcasted for all nodes, while in LocalStorage there's no such concept. Also, caches are configured via cyclos.properties, while local storage only has the TTL in the type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddRemoveListener(BiConsumer<K,V> listener)Adds a listener called whenever a value is removedVget(K key, Callable<V> producer)Returns the value associated with the given key, or producing a new one if none exists.-
Methods inherited from interface org.cyclos.impl.utils.ExpirableStorage
keys, removeIf
-
-