Package org.eclipse.sisu.inject
Class DefaultBeanLocator
java.lang.Object
org.eclipse.sisu.inject.DefaultBeanLocator
- All Implemented Interfaces:
BeanLocator,MutableBeanLocator
Default
MutableBeanLocator that locates qualified beans across a dynamic group of BindingPublishers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(BindingPublisher publisher) Adds the given rankedBindingPublisherand distributes itsBindings.voidclear()Removes all knownBindingPublishers and theirBindings.locate(com.google.inject.Key key) Finds bean implementations that match the given qualified bindingKey.Snapshot of currently registeredBindingPublishers.booleanremove(BindingPublisher publisher) Removes the givenBindingPublisherand itsBindings.voidTracks bean implementations that match the given qualified bindingKey.
-
Constructor Details
-
DefaultBeanLocator
public DefaultBeanLocator()
-
-
Method Details
-
locate
Description copied from interface:BeanLocatorFinds bean implementations that match the given qualified bindingKey.- Specified by:
locatein interfaceBeanLocator- Parameters:
key- The qualified key- Returns:
- Sequence of bean entries that match the given key
-
watch
Description copied from interface:BeanLocatorTracks bean implementations that match the given qualified bindingKey.Uses the
Mediatorpattern to send events to an arbitrary watcher object.- Specified by:
watchin interfaceBeanLocator- Parameters:
key- The qualified keymediator- The event mediatorwatcher- The bean watcher
-
add
Description copied from interface:MutableBeanLocatorAdds the given rankedBindingPublisherand distributes itsBindings.- Specified by:
addin interfaceMutableBeanLocator- Parameters:
publisher- The new publisher- Returns:
trueif the publisher was added; otherwisefalse
-
remove
Description copied from interface:MutableBeanLocatorRemoves the givenBindingPublisherand itsBindings.- Specified by:
removein interfaceMutableBeanLocator- Parameters:
publisher- The old publisher- Returns:
trueif the publisher was removed; otherwisefalse
-
publishers
Description copied from interface:MutableBeanLocatorSnapshot of currently registeredBindingPublishers.- Specified by:
publishersin interfaceMutableBeanLocator- Returns:
- The registered
BindingPublishers
-
clear
public void clear()Description copied from interface:MutableBeanLocatorRemoves all knownBindingPublishers and theirBindings.- Specified by:
clearin interfaceMutableBeanLocator
-