Community

Implementing a non-flat deployment for Weld Integration

reply from Flavia Rainone in JBoss Microcontainer Development POJO Server - View the full discussion

Pete Muir wrote:


I've been thinking about correctness all this time. If somebody places a jar in lib and expects that the beans are created upfront when AS starts, then this would not work using your approach.

Ok, I think we've got crossed wires. You can't deploy a library jar in some "context" outside a deployment. The beans don't get created or anything outside the context of a deployment.

 

Another way to think of it is that a library in default/lib with a beans.xml in it works just like a library in WEB-INF/lib.

In that case, why the lazy approach wouldn't work?

 

From what I can see, if it works just like a library in WEB-INF/lib, it means that we will need to provide a BDA for a lib jar only when Weld requests for one through loadBeanDeploymentArchive, right?

 

Or, if I'm wrong, do you mean that a BDA for every lib jar with a META-INF/beans.xml should be provided as direct or indirect result of BeanDeploymentArchive.getBeanDeploymentArchives() for every BDA in a Deployment?

Explaining better, given commos/lib/mylib.jar with the following structure:

mylib.jar

  |_

      META-INF/beans.xml

  |_

     whatever classes in here

 

Say we create a BDA upfront, let's call it MY_LIB_BDA, and add this BDA to DefalutDomain Classpath. No deployment is created upfront.

 

Now, say my-ejb.jar with a META-INF/beans.xml file is deployed to deploy dir. We create a Deployment for it, of course, and we create a BDA for it as well. This BDA, called MY_EJB_BDA, belongs to Default Domain Classpath. So, when Weld invokes MY_EJB_BDA.getBDAs(), it should , directly on indirectly (i.e., by walking on the BDA graph structure), reach MY_LIB_BDA?

 

This is different from the lazy approach in which you are not required to call loadBeanDeploymentArchive in order to obtain MY_LIB_BDA.

 

Is that what Weld requires us to do?

 

Pete Muir wrote:

 

Flavia Rainone wrote:

 

Ales Justin wrote:

 

Why the rush? :-)

If you ask me, I would do it lazily aka on_demand.

 

Scanning the whole common/lib is gonna be slow,

and imo, people should not be using libs to deploy Weld components -- simply put them in deploy/.

 

Or why would you do it upfront?

Because the Java EE/CDI specs require it.

 

 

BTW, I've read the spec sometime ago. Of course I don't remember all the details so, if you think rereading some specific part of it might be useful, let me know.

Reply to this message by going to Community

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