final class BeanCache<Q extends java.lang.annotation.Annotation,T>
extends java.util.concurrent.atomic.AtomicReference<java.lang.Object>
Binding
s to BeanEntry
s; optimized for common case of single entries.
Uses ==
instead of equals
to compare Binding
s because we want referential equality.
Modifier and Type | Field and Description |
---|---|
private boolean |
mutated |
private java.util.Map<com.google.inject.Binding<T>,BeanEntry<Q,T>> |
readCache |
private static long |
serialVersionUID |
Constructor and Description |
---|
BeanCache() |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<com.google.inject.Binding<T>> |
bindings()
Retrieves the
Binding references currently associated with BeanEntry s. |
BeanEntry<Q,T> |
create(Q qualifier,
com.google.inject.Binding<T> binding,
int rank)
Atomically creates a new
BeanEntry for the given Binding reference. |
private static java.util.Map |
createMap(LazyBeanEntry one,
LazyBeanEntry two) |
java.util.Map<com.google.inject.Binding<T>,BeanEntry<Q,T>> |
flush() |
BeanEntry<Q,T> |
remove(com.google.inject.Binding<T> binding)
Removes the
BeanEntry associated with the given Binding reference. |
private static final long serialVersionUID
private java.util.Map<com.google.inject.Binding<T>,BeanEntry<Q extends java.lang.annotation.Annotation,T>> readCache
private volatile boolean mutated
public BeanEntry<Q,T> create(Q qualifier, com.google.inject.Binding<T> binding, int rank)
BeanEntry
for the given Binding
reference.qualifier
- The qualifierbinding
- The bindingrank
- The assigned rankpublic java.util.Map<com.google.inject.Binding<T>,BeanEntry<Q,T>> flush()
public java.lang.Iterable<com.google.inject.Binding<T>> bindings()
Binding
references currently associated with BeanEntry
s.public BeanEntry<Q,T> remove(com.google.inject.Binding<T> binding)
BeanEntry
associated with the given Binding
reference.binding
- The bindingprivate static java.util.Map createMap(LazyBeanEntry one, LazyBeanEntry two)