Package org.eclipse.sisu.inject
Class BeanCache<Q extends Annotation,T>
java.lang.Object
org.eclipse.sisu.inject.BeanCache<Q,T>
Atomic cache mapping
Bindings to BeanEntrys; optimized for common case of single entries.
Uses == instead of equals to compare Bindings because we want referential equality.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Objectprivate static final AtomicReferenceFieldUpdater<BeanCache, Object> private booleanprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbindings()Retrieves theBindingreferences currently associated withBeanEntrys.Atomically creates a newBeanEntryfor the givenBindingreference.private static MapcreateMap(LazyBeanEntry one, LazyBeanEntry two) flush()Removes theBeanEntryassociated with the givenBindingreference.
-
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 newBeanEntryfor the givenBindingreference.- Parameters:
qualifier- The qualifierbinding- The bindingrank- The assigned rank- Returns:
- Associated bean entry
-
flush
- Returns:
- Read-only snapshot of the cache
-
bindings
Retrieves theBindingreferences currently associated withBeanEntrys.- Returns:
- Associated bindings
-
remove
Removes theBeanEntryassociated with the givenBindingreference.- Parameters:
binding- The binding- Returns:
- Associated bean entry
-
createMap
-