Class 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 the BeanLocator.
    • 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.
    • 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 a MediationListener.Mediation record containing the necessary details about a mediated watcher.
      • Methods inherited from class com.google.inject.matcher.AbstractMatcher

        and, or
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MediationListener

        public MediationListener​(com.google.inject.Binder binder)
    • Method Detail

      • mediate

        public 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.
        Parameters:
        key - The watched key
        mediator - The bean mediator
        watcherType - The watcher type
      • matches

        public boolean matches​(com.google.inject.TypeLiteral<?> type)
        Specified by:
        matches in interface com.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 interface com.google.inject.spi.TypeListener
      • afterInjection

        public void afterInjection​(java.lang.Object watcher)
        Specified by:
        afterInjection in interface com.google.inject.spi.InjectionListener<java.lang.Object>