<!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/542347#542347">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Pete and I had a face-to-face meeting where we discussed all my questions and what would be the best way to implement this.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Regarding the assumptions I wanted to validate, both are correct.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>But, regarding visibility of deployments. He told me that the best approach is to mirror the ClassLoader structure. The point is that one BDA A can see another BDA B if the module it represents, say A', can see classes from the module B', that corresponds to BDA B.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So, instead of reinventing the wheel, we should use the already existent ClassLoader structure to implement this correspondence in the BDA structure. These are the steps that Pete suggested:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1) Find Modules which are BDA's</p><p>2) List &lt;Module&gt;, List&lt;ClassLoader&gt;, Map&lt;ClassLoader, Module&gt;</p><p>3) Iterate over classes and build graph of modules</p><p>4) Module -&gt; BDA</p><p>&#160;&#160; a) Explore CL graph &amp; for each CL &amp; Module</p><p>&#160;&#160; b) Convert</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>A few examples of complex things that we would have to implement if we don't use the ClassLoader structure:</p><p>- we would have to able to see if a deployment is scoped or not, so we can define the visibility it has from other modules and to which modules it is visible</p><p>- we need to keep track of modules being deployed and undeployed, so to know when it becomes visible and when it becomes invisible</p><p>- we need to support Class-path attributes in manifest files</p><p>- we need to define when a previously defined archive is available to a archive being deployed now</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So, these features that we need to support provide the arguments as to why we should mirror the ClassLoader structure instead of implementing this from scratch.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Pete also pointed out an important behaviour that should be fixed. In a nutshell, all archives visible to a BDA are scanned. In the given scenario:</p><p>&#160; ejb.jar A reaches lib2. In lib2 we have a ClassPath reference in the manifest to lib3, which is not in the classpath of the server... it is somewhere in the filesystem. In this case, for what I understood from Pete's explanations, lib3 is going to be scanned for CDI stuff. But this shouldn't happen, so we would also need a way of differentiating lib3 from lib2. I'll stop my explanation here, as I think Pete can fill in the blanks and explain this much better :-)</p><p>Anyway, this would be a future step, as the priority is to first mirror the CL structure effectively.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So, Ales, how do you think this should be done? I think we have plenty of code in the ClassPools that do exactly that, mirror the ClassLoader structure in a way that allows us to find the classes and xml files in META-INF dirs. Maybe there is a way of reusing part of the ClassPool code to do this?</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/542347#542347">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>