2009/4/2 Bob Lee <[email protected]>: > On Wed, Apr 1, 2009 at 11:02 PM, James Strachan <[email protected]> > wrote: >> >> Yeah - either works for me. I would say post injection hooks are very >> rare. I can currently only think of 2 possible implementations >> (@PostConstruct and supporting Spring' InitializingBean). Also they >> tend to be mutually exclusive to any particular injection annotation - >> eg @PostConstruct could be used with @Resource, @PersistentContext or >> @Autowired (from spring). So pretty much all InjectionListener >> implementations i can imagine would only implement one of the methods. >> >> Also i think the former might be a little bit more efficient; trading >> a new List lazily created which is appended to the other at class >> inspection time versus avoiding a double iterate & invocation of lots >> of empty methods (though hotspot would no doubt speed that up to e >> barely noticable :-). > > Good points. > >> >> Don't mind though. Do you want a patch? > > Sure!
Done... http://code.google.com/p/google-guice/issues/detail?id=351 I went with the former solution for now. We might wanna rename Encounter.register() to registerListener() or registerInjectionListener() or something as the other method is currently registerPostInjectListener() but I'll leave that up to you guys to pick nicer names if you like. There's a test case in InjectableTypeListenerTest.testPostInjectListenersAreProcessedInOrder() that asserts that when listeners are registered out of order; the post inject listeners are fired last. -- 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 -~----------~----~----~----~------~----~------~--~---
