<!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;">
    On demand resolution
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/adrian%40jboss.org">Adrian Brock</a> in <i>JBoss Microcontainer Development</i> - <a href="http://community.jboss.org/message/534591#534591">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>Ales Justin wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p><span>I created a test for DynamicImport-Package to check whether </span><a class="jive-link-external-small" href="https://jira.jboss.org/jira/browse/JBCL-131" target="_blank">https://jira.jboss.org/jira/browse/JBCL-131</a><span> is actually working at the OSGi layer.</span></p></blockquote><p>I fail to see how dynamic import and JBCL-131 are related?</p><p>JBCL-131 is an impl of OSGi' lazy bundle activation -- e.g. only invoke BundleActivator if some class from that bundle needs to be loaded.</p></blockquote><p>Well actually JBCL-131 is about lazy resolve, not lazy start.</p><p>It's not working because it hasn't been enabled.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I've committed the following patch which makes it work using Ales's DeploymentMetaData</p><p>(I've not done anything with lazy start).</p><p>I don't know if that is the correct place for it?</p><p>Another question is whether you always want to enable lazy resolve for OSGi, even if the user specifies something else?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>P.S. There's no point re-opening issues in closed releases. You need to raise new issues.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>/core/src/main/java/org/jboss/osgi/framework/deployers<br/>$ svn diff<br/>Index: AbstractClassLoadingDeployer.java<br/>===================================================================<br/>--- AbstractClassLoadingDeployer.java&#160;&#160;&#160; (revision 103238)<br/>+++ AbstractClassLoadingDeployer.java&#160;&#160;&#160; (working copy)<br/>@@ -29,6 +29,7 @@<br/> import org.jboss.classloading.spi.metadata.CapabilitiesMetaData;<br/> import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;<br/> import org.jboss.classloading.spi.metadata.RequirementsMetaData;<br/>+import org.jboss.deployers.plugins.classloading.DeploymentMetaData;<br/> import org.jboss.deployers.spi.DeploymentException;<br/> import org.jboss.deployers.spi.deployer.DeploymentStages;<br/> import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;<br/>@@ -61,7 +62,10 @@<br/>&#160;&#160;&#160; {<br/>&#160;&#160;&#160;&#160;&#160;&#160; super(OSGiMetaData.class);<br/>&#160;&#160;&#160;&#160;&#160;&#160; addInput(AbstractBundleState.class);<br/>-&#160;&#160;&#160;&#160;&#160; setOutput(ClassLoadingMetaData.class);<br/>+&#160;&#160;&#160;&#160;&#160; addInput(ClassLoadingMetaData.class);<br/>+&#160;&#160;&#160;&#160;&#160; addInput(DeploymentMetaData.class);<br/>+&#160;&#160;&#160;&#160;&#160; addOutput(ClassLoadingMetaData.class);<br/>+&#160;&#160;&#160;&#160;&#160; addOutput(DeploymentMetaData.class);<br/>&#160;&#160;&#160;&#160;&#160;&#160; setStage(DeploymentStages.POST_PARSE);<br/>&#160;&#160;&#160;&#160;&#160;&#160; setTopLevelOnly(true);<br/>&#160;&#160;&#160; }<br/>@@ -79,6 +83,13 @@<br/>&#160;&#160;&#160; @Override<br/>&#160;&#160;&#160; public void deploy(DeploymentUnit unit, OSGiMetaData osgiMetaData) throws DeploymentException<br/>&#160;&#160;&#160; {<br/>+&#160;&#160;&#160;&#160;&#160; if (unit.isAttachmentPresent(DeploymentMetaData.class) == false)<br/>+&#160;&#160;&#160;&#160;&#160; {<br/>+&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DeploymentMetaData deploymentMetaData = new DeploymentMetaData();<br/>+&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; deploymentMetaData.setLazyResolve(true);<br/>+&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; unit.addAttachment(DeploymentMetaData.class, deploymentMetaData);<br/>+&#160;&#160;&#160;&#160;&#160; }<br/>+&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160; if (unit.isAttachmentPresent(ClassLoadingMetaData.class))<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;</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/534591#534591">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Microcontainer Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2115">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>