final class MediationListener
extends com.google.inject.matcher.AbstractMatcher<com.google.inject.TypeLiteral<?>>
implements com.google.inject.spi.TypeListener, com.google.inject.spi.InjectionListener<java.lang.Object>
InjectionListener
that listens for mediated watchers and registers them with the BeanLocator
.Modifier and Type | Class and Description |
---|---|
private static class |
MediationListener.Mediation<Q extends java.lang.annotation.Annotation,T,W>
Record containing all the necessary details about a mediated watcher.
|
Modifier and Type | Field and Description |
---|---|
private javax.inject.Provider<BeanLocator> |
locator |
private java.util.List<MediationListener.Mediation<?,?,?>> |
mediation |
Constructor and Description |
---|
MediationListener(com.google.inject.Binder binder) |
Modifier and Type | Method and Description |
---|---|
void |
afterInjection(java.lang.Object watcher) |
<T> void |
hear(com.google.inject.TypeLiteral<T> type,
com.google.inject.spi.TypeEncounter<T> encounter) |
boolean |
matches(com.google.inject.TypeLiteral<?> type) |
void |
mediate(com.google.inject.Key key,
Mediator mediator,
java.lang.Class watcherType)
Adds a
MediationListener.Mediation record containing the necessary details about a mediated watcher. |
private final java.util.List<MediationListener.Mediation<?,?,?>> mediation
private final javax.inject.Provider<BeanLocator> locator
public void mediate(com.google.inject.Key key, Mediator mediator, java.lang.Class watcherType)
MediationListener.Mediation
record containing the necessary details about a mediated watcher.key
- The watched keymediator
- The bean mediatorwatcherType
- The watcher typepublic boolean matches(com.google.inject.TypeLiteral<?> type)
matches
in interface com.google.inject.matcher.Matcher<com.google.inject.TypeLiteral<?>>
public <T> void hear(com.google.inject.TypeLiteral<T> type, com.google.inject.spi.TypeEncounter<T> encounter)
hear
in interface com.google.inject.spi.TypeListener
public void afterInjection(java.lang.Object watcher)
afterInjection
in interface com.google.inject.spi.InjectionListener<java.lang.Object>