public class CachingRegistry<K,V> extends java.lang.Object implements Registry<K,V>
Registry that uses a partitioned cache that partitions on thread
id.| Modifier and Type | Method and Description |
|---|---|
protected void |
cacheMiss(java.lang.Object key) |
void |
clear()
Clear the
Registry, resetting its state and calling Registration.cancel() for any active Registration. |
java.util.Iterator<Registration<K,? extends V>> |
iterator() |
Registration<K,V> |
register(Selector<K> sel,
V obj)
Assign the given
Selector with the given object. |
java.util.List<Registration<K,? extends V>> |
select(K key)
|
boolean |
unregister(K key)
Remove any objects matching this
key. |
public Registration<K,V> register(Selector<K> sel, V obj)
RegistrySelector with the given object.public boolean unregister(K key)
Registrykey. This will unregister all objects matching the given
key. There's no provision for removing only a specific object.unregister in interface Registry<K,V>key - The key to be matched by the Selectorspublic java.util.List<Registration<K,? extends V>> select(K key)
Registrypublic void clear()
RegistryRegistry, resetting its state and calling Registration.cancel() for any active Registration.public java.util.Iterator<Registration<K,? extends V>> iterator()
iterator in interface java.lang.Iterable<Registration<K,? extends V>>protected void cacheMiss(java.lang.Object key)