Package com.google.inject.internal
Class WeakKeySet
java.lang.Object
com.google.inject.internal.WeakKeySet
Minimal set that doesn't hold strong references to the contained keys.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.cache.Cache
<InjectorBindingData, Set<WeakKeySet.KeyAndSource>> Tracks child injector lifetimes and evicts banned keys/sources after the child injector is garbage collected.private final Object
This is already locked externally on add and getSources but we need it to handle clean up in the evictionCache's RemovalListener. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Key<?> key, InjectorBindingData state, Object source) private void
cleanupOnRemoval
(com.google.common.cache.RemovalNotification<InjectorBindingData, Set<WeakKeySet.KeyAndSource>> notification) boolean
getSources
(Key<?> key)
-
Field Details
-
backingMap
-
lock
This is already locked externally on add and getSources but we need it to handle clean up in the evictionCache's RemovalListener. -
evictionCache
private final com.google.common.cache.Cache<InjectorBindingData,Set<WeakKeySet.KeyAndSource>> evictionCacheTracks child injector lifetimes and evicts banned keys/sources after the child injector is garbage collected.
-
-
Constructor Details
-
WeakKeySet
WeakKeySet(Object lock)
-
-
Method Details
-
cleanupOnRemoval
private void cleanupOnRemoval(com.google.common.cache.RemovalNotification<InjectorBindingData, Set<WeakKeySet.KeyAndSource>> notification) -
add
-
contains
-
getSources
-