Package org.eclipse.sisu.space
Class MediationListener
- java.lang.Object
-
- com.google.inject.matcher.AbstractMatcher<com.google.inject.TypeLiteral<?>>
-
- org.eclipse.sisu.space.MediationListener
-
- All Implemented Interfaces:
com.google.inject.matcher.Matcher<com.google.inject.TypeLiteral<?>>
,com.google.inject.spi.InjectionListener<java.lang.Object>
,com.google.inject.spi.TypeListener
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 theBeanLocator
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MediationListener.Mediation<Q extends java.lang.annotation.Annotation,T,W>
Record containing all the necessary details about a mediated watcher.
-
Field Summary
Fields Modifier and Type Field Description private javax.inject.Provider<BeanLocator>
locator
private java.util.List<MediationListener.Mediation<?,?,?>>
mediation
-
Constructor Summary
Constructors Constructor Description MediationListener(com.google.inject.Binder binder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 aMediationListener.Mediation
record containing the necessary details about a mediated watcher.
-
-
-
Field Detail
-
mediation
private final java.util.List<MediationListener.Mediation<?,?,?>> mediation
-
locator
private final javax.inject.Provider<BeanLocator> locator
-
-
Method Detail
-
mediate
public void mediate(com.google.inject.Key key, Mediator mediator, java.lang.Class watcherType)
Adds aMediationListener.Mediation
record containing the necessary details about a mediated watcher.- Parameters:
key
- The watched keymediator
- The bean mediatorwatcherType
- The watcher type
-
matches
public boolean matches(com.google.inject.TypeLiteral<?> type)
- Specified by:
matches
in interfacecom.google.inject.matcher.Matcher<com.google.inject.TypeLiteral<?>>
-
hear
public <T> void hear(com.google.inject.TypeLiteral<T> type, com.google.inject.spi.TypeEncounter<T> encounter)
- Specified by:
hear
in interfacecom.google.inject.spi.TypeListener
-
afterInjection
public void afterInjection(java.lang.Object watcher)
- Specified by:
afterInjection
in interfacecom.google.inject.spi.InjectionListener<java.lang.Object>
-
-