-
1. Re: Get bean reference on a non EJB aware context
nickarls May 4, 2010 8:13 AM (in response to cjalmeida)There is a Java services based BeanManagerAware superclass in weld-extensions under construction that has a getBeanManager(). I also recall seeing the famous
three-liner
for getting the reference somewhere in extensions but I can't seem to find it now. It will be there sooner or later, anyway so you'll be able to do something likegetBeanManager().getReference(Foo.class);
etc
-
2. Re: Get bean reference on a non EJB aware context
cjalmeida May 4, 2010 7:16 PM (in response to cjalmeida)The static helper is probably a better idea since you need to extend nothing. Having to extend BeanManagerAware might pose some restriction on integrating frameworks that also uses extensions.
-
3. Re: Get bean reference on a non EJB aware context
nickarls May 4, 2010 8:27 PM (in response to cjalmeida)That was one design option but I think Pete wanted it to be as ugly as possible so it wouldn't be used that much ;-) There was also something with static and classloaders, can't remember now. It might of course be subject to change since it's just a minor implementation detail.