org.nuxeo.ecm.webengine.app.impl
Class SuperKeyedRegistry<K,V>
java.lang.Object
org.nuxeo.ecm.webengine.app.impl.SuperKeyedRegistry<K,V>
- Direct Known Subclasses:
- ClassRegistry, TypeRegistry
public abstract class SuperKeyedRegistry<K,V>
- extends java.lang.Object
A registry which inherits values from super keys.
The super key relation is defined by the derived classes by overriding getSuperKey(Object)
method.
The registry is thread safe and is optimized for lookups.
A concurrent cache is dynamically updated when a value is retrieved from a super entry.
The cache is removed each time a modification is made on the registry using put(Object, Object)
or remove(Object)
methods. Thus, for maximum performance you need to avoid modifying the registry
after lookups were done:
at application startup build the registry, at runtime perform lookups, at shutdown remove entries.
The root key is passed in the constructor and is used to stop looking in super entries.
- Author:
- Bogdan Stefanescu
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SuperKeyedRegistry
public SuperKeyedRegistry(K root)
put
public void put(K key,
V value)
remove
public V remove(K key)
get
public V get(K key)
Copyright © 2010 Nuxeo SAS. All Rights Reserved.