Class InjectorJitBindingData

    • Field Detail

      • jitBindings

        private final java.util.Map<Key<?>,​BindingImpl<?>> jitBindings
        Just-in-time binding cache. Guarded by lock.
      • failedJitBindings

        private final java.util.Set<Key<?>> failedJitBindings
        Cache of Keys that we were unable to create JIT bindings for, so we don't keep trying. Guarded by lock.
      • lock

        private final java.lang.Object lock
        This lock is needed for threadsafe InjectorJitBindingData accesses. It corresponds to this InjectorJitBindingData's highest ancestor.
    • Constructor Detail

    • Method Detail

      • getJitBindings

        java.util.Map<Key<?>,​BindingImpl<?>> getJitBindings()
      • putJitBinding

        void putJitBinding​(Key<?> key,
                           BindingImpl<?> binding)
      • removeJitBinding

        void removeJitBinding​(Key<?> key)
      • isFailedJitBinding

        boolean isFailedJitBinding​(Key<?> key)
      • addFailedJitBinding

        void addFailedJitBinding​(Key<?> key)
      • banKey

        void banKey​(Key<?> key,
                    InjectorBindingData injectorBindingData,
                    java.lang.Object source)
        Forbids the corresponding injector and its ancestors from creating a binding to key. Child injectors ban their bound keys on their parent injectors to prevent just-in-time bindings on the parent injector that would conflict, and pass along their InjectorBindingData to control the banned key's lifetime.
      • banKeyInParent

        void banKeyInParent​(Key<?> key,
                            InjectorBindingData injectorBindingData,
                            java.lang.Object source)
        Similar to banKey(Key, InjectorBindingData, Object) but we only begin banning the binding at the parent level. This is used to prevent JIT bindings in the parent injector from overriding explicit bindings declared in a child injector.
      • isBannedKey

        boolean isBannedKey​(Key<?> key)
        Returns true if key is forbidden from being bound in the injector corresponding to this data object. This indicates that one of the injector's children has bound the key.
      • getSourcesForBannedKey

        java.util.Set<java.lang.Object> getSourcesForBannedKey​(Key<?> key)
        Returns the source of a banned key.
      • lock

        java.lang.Object lock()