Jens Augustsson wrote on Mar 28, 2008 04:34 PM:
Injection references at method invocation time is of course excellent, but I often also would like to inject references to Seam components, or some object from a Seam contexts, at component instantiation time.
Currently I do this programatically in my @Create method by using Components.getInstance() and Contexts.getSessionContext().
Is there any way to do this declaratively? Using annotations, not XML? Like @InAtInstantiation?
Generally, it's not a good idea.
Thanks for the response,
But Seam support XML based injection at instantiation time using components.xml, why not using Annotations?
I use it e.g for component configuration - is there any technical reason for why Seam should inject every reference at method invocation time or do you have other suggestions of how to handle configuration?
Yes, there are technical reasons, check the forum and source code for references to disinjection (it's because of the use of proxies).
I don't see how you can configure using annotations?