Package com.google.inject.internal
Class ProvisionListenerCallbackStore
java.lang.Object
com.google.inject.internal.ProvisionListenerCallbackStore
ProvisionListenerStackCallback
for each key.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
A struct that holds key & binding but uses just key for equality/hashcode. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.cache.LoadingCache<ProvisionListenerCallbackStore.KeyBinding,
ProvisionListenerStackCallback<?>> private static final com.google.common.collect.ImmutableSet<Key<?>>
private final com.google.common.collect.ImmutableList<ProvisionListenerBinding>
-
Constructor Summary
ConstructorsConstructorDescriptionProvisionListenerCallbackStore
(List<ProvisionListenerBinding> listenerBindings) -
Method Summary
Modifier and TypeMethodDescriptionprivate <T> ProvisionListenerStackCallback<T>
Creates a newProvisionListenerStackCallback
with the correct listeners for the key.Returns a newProvisionListenerStackCallback
for the key ornull
if there are no listeners(package private) boolean
Purges a key from the cache.
-
Field Details
-
INTERNAL_BINDINGS
-
listenerBindings
-
cache
private final com.google.common.cache.LoadingCache<ProvisionListenerCallbackStore.KeyBinding,ProvisionListenerStackCallback<?>> cache
-
-
Constructor Details
-
ProvisionListenerCallbackStore
ProvisionListenerCallbackStore(List<ProvisionListenerBinding> listenerBindings)
-
-
Method Details
-
get
Returns a newProvisionListenerStackCallback
for the key ornull
if there are no listeners -
remove
Purges a key from the cache. Use this only if the type is not actually valid for binding and needs to be purged. (See issue 319 and ImplicitBindingTest#testCircularJitBindingsLeaveNoResidue and #testInstancesRequestingProvidersForThemselvesWithChildInjectors for examples of when this is necessary.)Returns true if the type was stored in the cache, false otherwise.
-
create
Creates a newProvisionListenerStackCallback
with the correct listeners for the key.
-