public abstract class BaseTransientStore<V> extends Object implements TransientStore<V>
| Modifier and Type | Field and Description |
|---|---|
protected TransientStoreConfig<V> |
config |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseTransientStore(TransientStoreConfig<V> config) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TransientStoreListener listener)
Adds a listener that observes store
events. |
protected void |
fireListeners(TransientStoreEvent<?> event) |
TransientStoreConfig<V> |
getConfig() |
Iterator<String> |
keys()
Returns an iterator of keys.
|
void |
removeListener(TransientStoreListener listener)
Removes the given listener from this store if exists, has no effect otherwise.
|
Iterator<V> |
values()
Returns an iterator of values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitentries, get, put, putIfAbsent, remove, sizecloseprotected final TransientStoreConfig<V> config
protected BaseTransientStore(TransientStoreConfig<V> config)
public TransientStoreConfig<V> getConfig()
public Iterator<String> keys()
TransientStorekeys in interface TransientStore<V>public Iterator<V> values()
TransientStorevalues in interface TransientStore<V>protected void fireListeners(TransientStoreEvent<?> event)
public void addListener(TransientStoreListener listener)
TransientStoreevents.
Note that
i) Calling this method with the same listener instance more than once has no effect.
ii) Listeners are not necessarily invoked from the calling thread. Consumer should consider thread safety issues.
iii) Subclasses might hold a strong reference to the listener. It is important that consumer
removes its listener once it is done observing events.addListener in interface TransientStore<V>TransientStore.removeListener(TransientStoreListener)public void removeListener(TransientStoreListener listener)
TransientStoreremoveListener in interface TransientStore<V>Copyright © 2021 The Apache Software Foundation. All rights reserved.