Community

Implementing a non-flat deployment for Weld Integration

reply from Ales Justin in JBoss Microcontainer Development POJO Server - View the full discussion
Yes. If there is an accessible (i.e. classes can be loaded from it) library jar with META-INF/beans.xml, then Weld expects you to return it as part of the BDA graph of the Deployment.

OK, this then rules out my lazy approach. :-)

 

But I would still do this on_demand, when (but just before) the first CDI/Weld deployment is deployed.

That would be the default behavior, but it could be made optional to do this at boot time instead.

The loadBeanDeploymentArchive method solely exists for the case that someone adds a bean based on a class which isn't present in the BDA graph via a CDI lifecycle listener. For every bean defined in such a way, Weld calls loadBeanDeploymentArchive, expecting the correct BDA to be returned.

 

IOW this is a kinda a two stage process - firstly the BDAs which are defined declaratively (META-INF/beans.xml) are handed to Weld, and then BDAs which are defined programatically are loaded by Weld (via loadBeanDeploymentArchive).

So, if I understand this correctly, BDAs created via "loadBeanDeploymentArchive" don't require beans.xml?

Simply add the class' owner jar as a BDA archive?

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development POJO Server at Community