Package org.eclipse.sisu.inject
Class BeanCache<Q extends Annotation,T>
java.lang.Object
org.eclipse.sisu.inject.BeanCache<Q,T>
Atomic cache mapping
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object
private static final AtomicReferenceFieldUpdater
<BeanCache, Object> private boolean
private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbindings()
Retrieves theBinding
references currently associated withBeanEntry
s.Atomically creates a newBeanEntry
for the givenBinding
reference.private static Map
createMap
(LazyBeanEntry one, LazyBeanEntry two) flush()
Removes theBeanEntry
associated with the givenBinding
reference.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
MAPPING_UPDATER
-
mapping
-
readCache
-
mutated
private volatile boolean mutated
-
-
Constructor Details
-
BeanCache
BeanCache()
-
-
Method Details
-
create
Atomically creates a newBeanEntry
for the givenBinding
reference.- Parameters:
qualifier
- The qualifierbinding
- The bindingrank
- The assigned rank- Returns:
- Associated bean entry
-
flush
- Returns:
- Read-only snapshot of the cache
-
bindings
Retrieves theBinding
references currently associated withBeanEntry
s.- Returns:
- Associated bindings
-
remove
Removes theBeanEntry
associated with the givenBinding
reference.- Parameters:
binding
- The binding- Returns:
- Associated bean entry
-
createMap
-