Package org.eclipse.sisu.inject
Class WatchedBeans<Q extends java.lang.annotation.Annotation,T,W>
- java.lang.Object
-
- org.eclipse.sisu.inject.WatchedBeans<Q,T,W>
-
- All Implemented Interfaces:
BindingSubscriber<T>
final class WatchedBeans<Q extends java.lang.annotation.Annotation,T,W> extends java.lang.Object implements BindingSubscriber<T>
Provides dynamicBeanEntry
notifications by tracking qualifiedBinding
s.- See Also:
BeanLocator.watch(Key, Mediator, Object)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(com.google.inject.Binding<T> binding, int rank)
Adds the given rankedBinding
to this subscriber.java.lang.Iterable<com.google.inject.Binding<T>>
bindings()
Snapshot of currently subscribedBinding
s.private java.lang.String
detail(java.lang.Object watcher)
void
remove(com.google.inject.Binding<T> binding)
Removes the givenBinding
from this subscriber.com.google.inject.TypeLiteral<T>
type()
Returns the type ofBinding
s that are of interest.
-
-
-
Field Detail
-
key
private final com.google.inject.Key<T> key
-
strategy
private final QualifyingStrategy strategy
-
watcherRef
private final java.lang.ref.Reference<W> watcherRef
-
-
Method Detail
-
type
public com.google.inject.TypeLiteral<T> type()
Description copied from interface:BindingSubscriber
Returns the type ofBinding
s that are of interest.- Specified by:
type
in interfaceBindingSubscriber<Q extends java.lang.annotation.Annotation>
- Returns:
- The literal type
-
add
public void add(com.google.inject.Binding<T> binding, int rank)
Description copied from interface:BindingSubscriber
Adds the given rankedBinding
to this subscriber.- Specified by:
add
in interfaceBindingSubscriber<Q extends java.lang.annotation.Annotation>
- Parameters:
binding
- The new bindingrank
- The assigned rank
-
remove
public void remove(com.google.inject.Binding<T> binding)
Description copied from interface:BindingSubscriber
Removes the givenBinding
from this subscriber.- Specified by:
remove
in interfaceBindingSubscriber<Q extends java.lang.annotation.Annotation>
- Parameters:
binding
- The old binding
-
bindings
public java.lang.Iterable<com.google.inject.Binding<T>> bindings()
Description copied from interface:BindingSubscriber
Snapshot of currently subscribedBinding
s.- Specified by:
bindings
in interfaceBindingSubscriber<Q extends java.lang.annotation.Annotation>
- Returns:
- The subscribed
Binding
s
-
detail
private java.lang.String detail(java.lang.Object watcher)
-
-