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 BindingPublisher
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(BindingPublisher publisher) Adds the given rankedBindingPublisher
and distributes itsBinding
s.void
clear()
Removes all knownBindingPublisher
s and theirBinding
s.locate
(com.google.inject.Key key) Finds bean implementations that match the given qualified bindingKey
.Snapshot of currently registeredBindingPublisher
s.boolean
remove
(BindingPublisher publisher) Removes the givenBindingPublisher
and itsBinding
s.void
Tracks bean implementations that match the given qualified bindingKey
.
-
Constructor Details
-
DefaultBeanLocator
public DefaultBeanLocator()
-
-
Method Details
-
locate
Description copied from interface:BeanLocator
Finds bean implementations that match the given qualified bindingKey
.- Specified by:
locate
in interfaceBeanLocator
- Parameters:
key
- The qualified key- Returns:
- Sequence of bean entries that match the given key
-
watch
Description copied from interface:BeanLocator
Tracks bean implementations that match the given qualified bindingKey
.Uses the
Mediator
pattern to send events to an arbitrary watcher object.- Specified by:
watch
in interfaceBeanLocator
- Parameters:
key
- The qualified keymediator
- The event mediatorwatcher
- The bean watcher
-
add
Description copied from interface:MutableBeanLocator
Adds the given rankedBindingPublisher
and distributes itsBinding
s.- Specified by:
add
in interfaceMutableBeanLocator
- Parameters:
publisher
- The new publisher- Returns:
true
if the publisher was added; otherwisefalse
-
remove
Description copied from interface:MutableBeanLocator
Removes the givenBindingPublisher
and itsBinding
s.- Specified by:
remove
in interfaceMutableBeanLocator
- Parameters:
publisher
- The old publisher- Returns:
true
if the publisher was removed; otherwisefalse
-
publishers
Description copied from interface:MutableBeanLocator
Snapshot of currently registeredBindingPublisher
s.- Specified by:
publishers
in interfaceMutableBeanLocator
- Returns:
- The registered
BindingPublisher
s
-
clear
public void clear()Description copied from interface:MutableBeanLocator
Removes all knownBindingPublisher
s and theirBinding
s.- Specified by:
clear
in interfaceMutableBeanLocator
-