Package org.eclipse.sisu.inject
Class BeanCache<Q extends Annotation,T>
- All Implemented Interfaces:
Serializable
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
Fields -
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.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 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
-