TypeListener is not called

56 views
Skip to first unread message

Nat

unread,
Aug 24, 2015, 2:20:28 PM8/24/15
to google-guice
I found that in certain cases, TypeListener is not called even though the type is not injected staticly. I wonder what those exception cases are. So far I guess it has something to do with the use of MapBinderBinding.

Sam Berlin

unread,
Aug 30, 2015, 10:32:30 AM8/30/15
to google-guice
TypeListeners are only called when Guice creates an object (using its constructor) or injects fields into it.  If an object is returned by a @Provides method or other Provider, TypeListeners aren't notified about the that object.

You may want to use ProvisionListener instead, which will be notified whenever any type is ready to be injected.

sam

On Mon, Aug 24, 2015 at 2:20 PM Nat <nat....@gmail.com> wrote:
I found that in certain cases, TypeListener is not called even though the type is not injected staticly. I wonder what those exception cases are. So far I guess it has something to do with the use of MapBinderBinding.

--
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 google-guice...@googlegroups.com.
To post to this group, send email to google...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/0345c126-22cc-4181-a223-823d5a47a2a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages