On Apr 1, 3:42 am, James Strachan <[email protected]> wrote:
> When I saw the getProvider() methods on Encounter I figured this was
> the way of asking for a provider from inside an InjectionListener?

When we were designing the API, the intention was to invalidate the
Encounter when hear() returned. Unfortunately, I didn't actually write
any code to do the invalidation. I'll do this! As it's written now, if
you call getProvider() on an Encounter after hear() returns, it'll
return a perpetually broken Provider. That provider will never have a
working get() method.

Can you do your getProvider() calls within hear()? That way you'll get
much better performance: InjectableType.Listener gets invoked once per
type, whereas hear() gets invoked once per instance. If you do all of
your potentially-expensive Provider lookups at type-discovery time,
things should perform reasonably.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to