Yes avoid ComponentContext.inject() at all costs. It is really bad.
The problem with ComponentContext.inject(), besides that it is a bad
programming pattern, is that it doesn't know which spring context you
are in. So ComponentContext.inject() will inject only beans that are
defined in the "core"
Wow, this was really helpful! I was able to get my extension set up and thing
seem to be injecting just fine.
--
Chris Suich
chris.su...@netapp.com
NetApp Software Engineer
Data Center Platforms – Cloud Solutions
Citrix, Cisco & Red Hat
On Oct 24, 2013, at 5:00 PM, Darren Shepherd
wrote:
> L
Let me clarify some terms first, this might be confusing. There is
instantiation and then there is initialization. Instantiation is
calling the constructor. Initialization is calling the
@PostConstruct. Beyond that there is what I've been calling
"CloudStack Extended Lifecycle," This for bean
So, I kind of figured it out…
In the past, I was creating my DataStoreLifeCycle with
ComponentContext.inject() and it had some members which were @Injecte(d) -
those were the guys that were failing to be instantiated. When I switched to
simply @Inject my DataStoreLifeCycle into my DataStoreProv
Darren,
I’m switching my plugin over to use the new modularized Spring stuff you just
merged and there is something I’m still battling with. I have other beans that
were previously instantiated before my DataStoreProvider which get injected
into the provider, lifecycle, etc. So, those beans nee