public class ConcurrentServiceBinding<K,V>
- extends Object
Since Service lookup is a very hot operation and essentially it's a read only
data structure, to achieve threadsafety we can use immutability.
For our use case we just need reference equality, and the expectation is that a limited
number of elements will be contained in this custom collection (<32).
So the following structure is functionally equivalent to an Identity based ConcurrentMap,
but heavily tuned for reads, at cost of structural reorganization at writes.
The implementation is a binary tree basing the comparison order on the identityHashCode
of each key.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void clear()
public void put(K key,
public V get(K key)
protected int hashKey(K key)
public Iterable<V> values()
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.