Package org.eclipse.sisu.inject
Class BeanCache<Q extends Annotation,T>
- All Implemented Interfaces:
Serializable
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
Fields -
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.Methods inherited from class java.util.concurrent.atomic.AtomicReference
accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
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
-