Class DefaultBeanLocator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(com.google.inject.Injector injector, int rank)
      Adds the given ranked Injector and distributes its Bindings.
      boolean add​(BindingPublisher publisher)
      Adds the given ranked BindingPublisher and distributes its Bindings.
      void clear()
      Removes all known BindingPublishers and their Bindings.
      java.lang.Iterable<BeanEntry> locate​(com.google.inject.Key key)
      Finds bean implementations that match the given qualified binding Key.
      java.lang.Iterable<BindingPublisher> publishers()
      Snapshot of currently registered BindingPublishers.
      void remove​(com.google.inject.Injector injector)
      Removes the given Injector and its Bindings.
      boolean remove​(BindingPublisher publisher)
      Removes the given BindingPublisher and its Bindings.
      void watch​(com.google.inject.Key key, Mediator mediator, java.lang.Object watcher)
      Tracks bean implementations that match the given qualified binding Key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultBeanLocator

        public DefaultBeanLocator()
    • Method Detail

      • locate

        public java.lang.Iterable<BeanEntry> locate​(com.google.inject.Key key)
        Description copied from interface: BeanLocator
        Finds bean implementations that match the given qualified binding Key.
        Specified by:
        locate in interface BeanLocator
        Parameters:
        key - The qualified key
        Returns:
        Sequence of bean entries that match the given key
      • watch

        public void watch​(com.google.inject.Key key,
                          Mediator mediator,
                          java.lang.Object watcher)
        Description copied from interface: BeanLocator
        Tracks bean implementations that match the given qualified binding Key.

        Uses the Mediator pattern to send events to an arbitrary watcher object.

        Specified by:
        watch in interface BeanLocator
        Parameters:
        key - The qualified key
        mediator - The event mediator
        watcher - The bean watcher
      • add

        public void add​(com.google.inject.Injector injector,
                        int rank)
        Description copied from interface: MutableBeanLocator
        Adds the given ranked Injector and distributes its Bindings. Marked as deprecated because most clients should not call this method; any injector with an instance binding to a BeanLocator is automatically added to that locator as part of the bootstrapping process.
        Specified by:
        add in interface MutableBeanLocator
        Parameters:
        injector - The new injector
        rank - The assigned rank; should reflect the injector's RankingFunction.maxRank()
      • remove

        public void remove​(com.google.inject.Injector injector)
        Description copied from interface: MutableBeanLocator
        Removes the given Injector and its Bindings.
        Specified by:
        remove in interface MutableBeanLocator
        Parameters:
        injector - The old injector