final class WatchedBeans<Q extends java.lang.annotation.Annotation,T,W> extends java.lang.Object implements BindingSubscriber<T>
BeanEntry
notifications by tracking qualified Binding
s.BeanLocator.watch(Key, Mediator, Object)
Modifier and Type | Field and Description |
---|---|
private BeanCache<Q,T> |
beans |
private com.google.inject.Key<T> |
key |
private Mediator<Q,T,W> |
mediator |
private QualifyingStrategy |
strategy |
private java.lang.ref.Reference<W> |
watcherRef |
Constructor and Description |
---|
WatchedBeans(com.google.inject.Key<T> key,
Mediator<Q,T,W> mediator,
W watcher) |
Modifier and Type | Method and Description |
---|---|
void |
add(com.google.inject.Binding<T> binding,
int rank)
Adds the given ranked
Binding to this subscriber. |
java.lang.Iterable<com.google.inject.Binding<T>> |
bindings()
Snapshot of currently subscribed
Binding s. |
private java.lang.String |
detail(java.lang.Object watcher) |
void |
remove(com.google.inject.Binding<T> binding)
Removes the given
Binding from this subscriber. |
com.google.inject.TypeLiteral<T> |
type()
Returns the type of
Binding s that are of interest. |
private final com.google.inject.Key<T> key
private final QualifyingStrategy strategy
private final java.lang.ref.Reference<W> watcherRef
public com.google.inject.TypeLiteral<T> type()
BindingSubscriber
Binding
s that are of interest.type
in interface BindingSubscriber<T>
public void add(com.google.inject.Binding<T> binding, int rank)
BindingSubscriber
Binding
to this subscriber.add
in interface BindingSubscriber<T>
binding
- The new bindingrank
- The assigned rankpublic void remove(com.google.inject.Binding<T> binding)
BindingSubscriber
Binding
from this subscriber.remove
in interface BindingSubscriber<T>
binding
- The old bindingpublic java.lang.Iterable<com.google.inject.Binding<T>> bindings()
BindingSubscriber
Binding
s.bindings
in interface BindingSubscriber<T>
Binding
sprivate java.lang.String detail(java.lang.Object watcher)