Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 56154 invoked from network); 12 Jun 2009 12:32:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jun 2009 12:32:13 -0000 Received: (qmail 64082 invoked by uid 500); 12 Jun 2009 12:32:24 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 64012 invoked by uid 500); 12 Jun 2009 12:32:24 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 63998 invoked by uid 99); 12 Jun 2009 12:32:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 12:32:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 12:32:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EBF28238886C; Fri, 12 Jun 2009 12:31:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r784096 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintExtender.java Date: Fri, 12 Jun 2009 12:31:58 -0000 To: scm@geronimo.apache.org From: gnodet@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090612123158.EBF28238886C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gnodet Date: Fri Jun 12 12:31:58 2009 New Revision: 784096 URL: http://svn.apache.org/viewvc?rev=784096&view=rev Log: Check lazy bundles when the extender is started Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintExtender.java Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintExtender.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintExtender.java?rev=784096&r1=784095&r2=784096&view=diff ============================================================================== --- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintExtender.java (original) +++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintExtender.java Fri Jun 12 12:31:58 2009 @@ -37,6 +37,7 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.BundleEvent; import org.osgi.framework.SynchronousBundleListener; +import org.osgi.framework.Constants; import org.osgi.service.blueprint.container.BlueprintContainer; import org.osgi.service.blueprint.container.BlueprintEvent; import org.slf4j.Logger; @@ -71,9 +72,15 @@ Bundle[] bundles = context.getBundles(); for (Bundle b : bundles) { - // TODO: need to check lazy bundles in STARTING state + // If the bundle is active, check it if (b.getState() == Bundle.ACTIVE) { checkBundle(b); + // Also check bundles in the starting state with a lazy activation policy + } else if (b.getState() == Bundle.STARTING) { + String activationPolicyHeader = (String) b.getHeaders().get(Constants.BUNDLE_ACTIVATIONPOLICY); + if (activationPolicyHeader != null && activationPolicyHeader.startsWith(Constants.ACTIVATION_LAZY)) { + checkBundle(b); + } } } LOGGER.debug("Blueprint extender started"); @@ -123,8 +130,7 @@ LOGGER.debug("Scanning bundle {} for blueprint application", bundle.getSymbolicName()); try { List urls = new ArrayList(); - Dictionary headers = bundle.getHeaders(); - String blueprintHeader = (String) headers.get(BlueprintConstants.BUNDLE_BLUEPRINT_HEADER); + String blueprintHeader = (String) bundle.getHeaders().get(BlueprintConstants.BUNDLE_BLUEPRINT_HEADER); if (blueprintHeader == null) { blueprintHeader = "OSGI-INF/blueprint/"; }