2009/4/1 James Strachan <[email protected]>:
> 2009/4/1 [email protected] <[email protected]>:
>>
>> 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.
>
> I've just done that. I still get the same exception though. (See below).

Sorry I was being thick :) Its working fine now!

I had to split the steps up; getting a reference to the Provider - and
then using the Provider. Obvious really :) Looking up the provider in
hear() - then using it again inside the InjectionListener works a
treat!

Thanks guys! @Resource injection looks like its working fine. Just
tidying up the code a bit & trying to get lifecycle stuff working...

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

--~--~---------~--~----~------------~-------~--~----~
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