[webbeans-dev] Injection over Lookup

Ales Justin ales.justin at gmail.com
Sat Jan 24 04:07:19 EST 2009


Injecting it how?

Currently the entry point is ServletContext,
which holds MC's Kernel and DeploymentUnit as its attribute.

The WB pieces that reside in WB app are not (yet) 'connected' to MC 
directly.
Only the custom WB deployers are.
See wb-int/jbossas/ and its vdf package for more details.

WRT to autowiring, I agree, there is no need to do lookup by name,
a class would be enough - as long as there is only one matching instance.

Andrew Lee Rubinger wrote:
> Hey guys:
> 
> Is there a reason we're doing stuff like:
> 
> JBossEjb.lookupEjbReferenceResolver(controller).resolveEjb(topLevelDeploymentUnit, 
> new EjbReference(beanName, beanInterface, mappedName))
> 
> ...instead of injecting the reference resolver?
> 
> http://anonsvn.jboss.org/repos/jbossas/projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbResolver.java 
> 
> 
> There are a few other examples where this type of lookup is used.  Given 
> only one implementing class per interface, you can even rely upon MC to 
> do the autowiring.
> 
> S,
> ALR
> 



More information about the weld-dev mailing list