-
1. Re: Weld integration into JEE environment
mkouba Nov 18, 2014 6:41 AM (in response to emilyj)Hi,
what's the target Java EE environment? In fact, I'm not really sure what the sentence means. I suspect it's outdated.
The other question is how to obtain an contextualInstance?
Could you provide more information? E.g. when and where?
-
2. Re: Weld integration into JEE environment
emilyj Nov 18, 2014 7:06 AM (in response to mkouba)I am trying to put Weld in WebSphere Application Server. If I don't need to implement BeanStore, my contextualInstance question is irrelevant any more.
Carry on this thread... I have a problem with injection
I have a servlet class, which declares @Inject to bean A, which then declares @Inject to bean B. I am aware of that I need to process the EE injection. I managed to inject A to my servlet. However, the injection bean B to bean A did not happen. Is there anything I need to do to make this happen? I thought Weld bootstrap process will have this injection wired up. I might be wrong. Is this any methods I need to call to kick start the injections?
Thanks
-
3. Re: Weld integration into JEE environment
mkouba Nov 18, 2014 7:29 AM (in response to emilyj)It depends on the bean scope. If A is normal scoped (e.g. @RequestScoped) a client proxy is injected into the servlet and the bean instance is not created (and injected) unless A is really used. The same applies to B. What are the scopes of A and B? And how do you monitor the injection - @PostConstruct callback?
-
4. Re: Weld integration into JEE environment
emilyj Nov 18, 2014 9:20 AM (in response to mkouba)After debugging through, I found out the presence of InjectionServices stops Weld does the field injection for managed beans as I have not fully implemented InjectionServices as yet. The InjectionService is a required service in EE environment. I am not sure the difference between EE environment and EE_INJECT environment. Which one is more appropriate to an Application Server environment?
-
5. Re: Weld integration into JEE environment
mkouba Nov 18, 2014 9:46 AM (in response to emilyj)I am not sure the difference between EE environment and EE_INJECT environment. Which one is more appropriate to an Application Server environment?
Both environments are appropriate. The difference is in who is performing the EE-style injection. Environments.EE - the container/integrator performs the injection (Weld invokes an InjectionServices callback and provides some injection context). Environments.EE_INJECT - Weld performs EE-style injection (i.e. calls individual injection services to obtain the resource reference).