final class WatchedBeans<Q extends java.lang.annotation.Annotation,T,W> extends java.lang.Object implements BindingSubscriber<T>
BeanEntry notifications by tracking qualified Bindings.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
Bindings. |
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
Bindings 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()
BindingSubscriberBindings that are of interest.type in interface BindingSubscriber<T>public void add(com.google.inject.Binding<T> binding, int rank)
BindingSubscriberBinding to this subscriber.add in interface BindingSubscriber<T>binding - The new bindingrank - The assigned rankpublic void remove(com.google.inject.Binding<T> binding)
BindingSubscriberBinding from this subscriber.remove in interface BindingSubscriber<T>binding - The old bindingpublic java.lang.Iterable<com.google.inject.Binding<T>> bindings()
BindingSubscriberBindings.bindings in interface BindingSubscriber<T>Bindingsprivate java.lang.String detail(java.lang.Object watcher)