Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.webengine.app.impl
Class SuperKeyedRegistry<K,V>

java.lang.Object
  extended by 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

Constructor Summary
SuperKeyedRegistry(K root)
           
 
Method Summary
 V get(K key)
           
 void put(K key, V value)
           
 V remove(K key)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuperKeyedRegistry

public SuperKeyedRegistry(K root)
Method Detail

put

public void put(K key,
                V value)

remove

public V remove(K key)

get

public V get(K key)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.