<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Implementing a non-flat deployment for Weld Integration
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/flavia.rainone%40jboss.com">Flavia Rainone</a> in <i>JBoss Microcontainer Development POJO Server</i> - <a href="http://community.jboss.org/message/546115#546115">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><blockquote class="jive-quote"><p>Pete Muir wrote:</p><br/><pre jivemacro="quote"><blockquote class="jive-quote"><p>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.</p></blockquote>
</pre>
<p>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.</p>
<p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p>
<p>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.</p>
</blockquote><p>In that case, why the lazy approach wouldn't work?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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?</p><p>Explaining better, given commos/lib/mylib.jar with the following structure:</p><p>mylib.jar</p><p>&#160; |_</p><p>&#160;&#160;&#160;&#160;&#160; META-INF/beans.xml</p><p>&#160; |_</p><p>&#160;&#160;&#160;&#160; whatever classes in here</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is different from the lazy approach in which you are not required to call loadBeanDeploymentArchive in order to obtain MY_LIB_BDA.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Is that what Weld requires us to do?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>Pete Muir wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>Flavia Rainone wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>Ales Justin wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Why the rush? :-)</p><p>If you ask me, I would do it lazily aka on_demand.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Scanning the whole common/lib is gonna be slow,</p><p>and imo, people should not be using libs to deploy Weld components -- simply put them in deploy/.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Or why would you do it upfront?</p></blockquote></blockquote><p>Because the Java EE/CDI specs require it.</p></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/546115#546115">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Microcontainer Development POJO Server at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2116">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>