public final class DefaultBeanLocator extends Object implements MutableBeanLocator
MutableBeanLocator that locates qualified beans across a dynamic group of BindingPublishers.| Constructor and Description |
|---|
DefaultBeanLocator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(BindingPublisher publisher)
Adds the given ranked
BindingPublisher and distributes its Bindings. |
void |
add(com.google.inject.Injector injector,
int rank)
Adds the given ranked
Injector and distributes its Bindings. |
void |
clear()
Removes all known
BindingPublishers and their Bindings. |
Iterable<BeanEntry> |
locate(com.google.inject.Key key)
Finds bean implementations that match the given qualified binding
Key. |
Iterable<BindingPublisher> |
publishers()
Snapshot of currently registered
BindingPublishers. |
boolean |
remove(BindingPublisher publisher)
Removes the given
BindingPublisher and its Bindings. |
void |
remove(com.google.inject.Injector injector)
Removes the given
Injector and its Bindings. |
void |
watch(com.google.inject.Key key,
Mediator mediator,
Object watcher)
Tracks bean implementations that match the given qualified binding
Key. |
public Iterable<BeanEntry> locate(com.google.inject.Key key)
BeanLocatorKey.locate in interface BeanLocatorkey - The qualified keypublic void watch(com.google.inject.Key key,
Mediator mediator,
Object watcher)
BeanLocatorKey.
Uses the Mediator pattern to send events to an arbitrary watcher object.
watch in interface BeanLocatorkey - The qualified keymediator - The event mediatorwatcher - The bean watcherpublic boolean add(BindingPublisher publisher)
MutableBeanLocatorBindingPublisher and distributes its Bindings.add in interface MutableBeanLocatorpublisher - The new publishertrue if the publisher was added; otherwise falsepublic boolean remove(BindingPublisher publisher)
MutableBeanLocatorBindingPublisher and its Bindings.remove in interface MutableBeanLocatorpublisher - The old publishertrue if the publisher was removed; otherwise falsepublic Iterable<BindingPublisher> publishers()
MutableBeanLocatorBindingPublishers.publishers in interface MutableBeanLocatorBindingPublisherspublic void clear()
MutableBeanLocatorBindingPublishers and their Bindings.clear in interface MutableBeanLocatorpublic void add(com.google.inject.Injector injector,
int rank)
MutableBeanLocatorInjector 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.add in interface MutableBeanLocatorinjector - The new injectorrank - The assigned rank; should reflect the injector's RankingFunction.maxRank()public void remove(com.google.inject.Injector injector)
MutableBeanLocatorInjector and its Bindings.remove in interface MutableBeanLocatorinjector - The old injectorCopyright © 2016. All Rights Reserved.