public class CachingRegistry<T> extends java.lang.Object implements Registry<T>
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<? extends T>> |
iterator() |
Registration<T> |
register(Selector sel,
T obj)
Assign the given
Selector with the given object. |
java.util.List<Registration<? extends T>> |
select(java.lang.Object key)
|
boolean |
unregister(java.lang.Object key)
Remove any objects matching this
key. |
public Registration<T> register(Selector sel, T obj)
RegistrySelector with the given object.public boolean unregister(java.lang.Object 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<T>key - The key to be matched by the Selectorspublic java.util.List<Registration<? extends T>> select(java.lang.Object key)
Registryselect in interface Registry<T>key - The key for the Selectors to matchList of Registrations whose Selector matches the given key.public void clear()
RegistryRegistry, resetting its state and calling Registration.cancel() for any active Registration.public java.util.Iterator<Registration<? extends T>> iterator()
iterator in interface java.lang.Iterable<Registration<? extends T>>protected void cacheMiss(java.lang.Object key)