Class DefaultBeanLocator

java.lang.Object
org.eclipse.sisu.inject.DefaultBeanLocator
All Implemented Interfaces:
BeanLocator, MutableBeanLocator

public final class DefaultBeanLocator extends Object implements MutableBeanLocator
Default MutableBeanLocator that locates qualified beans across a dynamic group of BindingPublishers.
  • Constructor Details

    • DefaultBeanLocator

      public DefaultBeanLocator()
  • Method Details

    • setBeanEntryPredicateSupplier

      public void setBeanEntryPredicateSupplier(Supplier<Predicate> predicateSupplier)
      Sets the predicate supplier for bean entry filtering, may be null, when no filtering is applied.
    • locate

      public 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, 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 boolean add(BindingPublisher publisher)
      Description copied from interface: MutableBeanLocator
      Adds the given ranked BindingPublisher and distributes its Bindings.
      Specified by:
      add in interface MutableBeanLocator
      Parameters:
      publisher - The new publisher
      Returns:
      true if the publisher was added; otherwise false
    • remove

      public boolean remove(BindingPublisher publisher)
      Description copied from interface: MutableBeanLocator
      Removes the given BindingPublisher and its Bindings.
      Specified by:
      remove in interface MutableBeanLocator
      Parameters:
      publisher - The old publisher
      Returns:
      true if the publisher was removed; otherwise false
    • publishers

      public Iterable<BindingPublisher> publishers()
      Description copied from interface: MutableBeanLocator
      Snapshot of currently registered BindingPublishers.
      Specified by:
      publishers in interface MutableBeanLocator
      Returns:
      The registered BindingPublishers
    • clear

      public void clear()
      Description copied from interface: MutableBeanLocator
      Removes all known BindingPublishers and their Bindings.
      Specified by:
      clear in interface MutableBeanLocator