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, wait
entries, get, put, putIfAbsent, remove, size
close
protected final TransientStoreConfig<V> config
protected BaseTransientStore(TransientStoreConfig<V> config)
public TransientStoreConfig<V> getConfig()
public Iterator<String> keys()
TransientStore
keys
in interface TransientStore<V>
public Iterator<V> values()
TransientStore
values
in interface TransientStore<V>
protected void fireListeners(TransientStoreEvent<?> event)
public void addListener(TransientStoreListener listener)
TransientStore
events
.
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)
TransientStore
removeListener
in interface TransientStore<V>
Copyright © 1970 The Apache Software Foundation. All rights reserved.