On 4 Apr 2014, at 15:31, Jochen Wiedmann <[email protected]> wrote:

> 
> Hi,
> 
> I've got a module, which registers a TypeListener with the following code:
> 
>     @Override
>     public <I> void hear(final TypeLiteral<I> type, final TypeEncounter<I> 
> encounter) {
>         System.err.println("PostConstructModule.hear: " + type.getRawType());
>         encounter.register(new InjectionListener<I>() {
>             @Override
>             public void afterInjection(final I pInjectee) {
>                 System.err.println("PostConstructModule.afterInjection: " + 
> pInjectee.getClass());
>                 noteInjectee(pInjectee);
>             }
>         });
>     }
> 
> Now, I would expect that for any line in System.err with 
> "PostConstructModule.hear" I'd get a corresponding line with 
> "PostConstructModule.afterInjection".
> However, in at least one case that's not so. Am I missing something, or does 
> that sound like a bug?

TypeListeners are executed during module processing (ie. when the injector is 
created)

InjectionListeners are executed when instances are injected, which could be 
during or after creation of the injector (depending on your application).

So it could happen if a type is bound, but never gets injected  -  could you 
share more details of what you expect vs. what you see?

> Thanks,
> 
> Jochen
>  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-guice.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.

Reply via email to