Return-Path: Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: (qmail 42670 invoked from network); 28 Jan 2011 11:00:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jan 2011 11:00:09 -0000 Received: (qmail 26875 invoked by uid 500); 28 Jan 2011 11:00:08 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 26830 invoked by uid 500); 28 Jan 2011 11:00:07 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 26815 invoked by uid 99); 28 Jan 2011 11:00:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jan 2011 11:00:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jan 2011 11:00:04 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0SAxipO018499 for ; Fri, 28 Jan 2011 10:59:44 GMT Message-ID: <25595630.264151296212383982.JavaMail.jira@thor> Date: Fri, 28 Jan 2011 05:59:43 -0500 (EST) From: "Stephane Chomat (JIRA)" To: issues@karaf.apache.org Subject: [jira] Commented: (KARAF-334) At startup, Karaf does not support urls like mvn:, obr:. In-Reply-To: <16064364.212391292842140914.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988030#action_12988030 ] Stephane Chomat commented on KARAF-334: --------------------------------------- With your comments, I propose a final version. This version works fine with the mechanism lock. For 2.2.x : https://github.com/chomats/karaf/commit/84c16ba7ad19c77ffc9e7d8445633992a92ac044 For 2.1.x: https://github.com/chomats/karaf/commit/bd11100b74c1f230140864d58d6c99766baf64a5 You decide if you want to add this feature to Karaf. > At startup, Karaf does not support urls like mvn:, obr:. > -------------------------------------------------------- > > Key: KARAF-334 > URL: https://issues.apache.org/jira/browse/KARAF-334 > Project: Karaf > Issue Type: Improvement > Components: runtime > Affects Versions: 2.1.2 > Reporter: Stephane Chomat > Assignee: Guillaume Nodet > Fix For: 2.2.0 > > Attachments: test-karaf-home.zip > > Original Estimate: 24h > Remaining Estimate: 24h > > At startup, Karafi does not support urls like mvn:, obr:. > Imagine that at level 5 you install the bundle pax-url-mvn with karaf.auto.start.5 = "file: pax-url-mvn.jar | pax-url-mvn" > and then at level 10 you install mvn:. ... With karaf.auto.start.10 = "mvn :....| ...." > At the level 6 the url handler 'mvn' is available and you can use it. > This feature does not work with Karaf > I propose this path : > diff -r f0bb11c3d77c src/main/java/org/apache/karaf/main/Main.java > --- a/src/main/java/org/apache/karaf/main/Main.java Mon Dec 20 11:05:11 2010 +0100 > +++ b/src/main/java/org/apache/karaf/main/Main.java Mon Dec 20 11:46:29 2010 +0100 > @@ -485,28 +485,20 @@ > // the start level to which the bundles are assigned is specified by > // appending a ".n" to the auto-install property name, where "n" is > // the desired start level for the list of bundles. > - autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUrls); > + autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUrls, false); > > // The auto-start property specifies a space-delimited list of > // bundle URLs to be automatically installed and started into each > // new profile; the start level to which the bundles are assigned > // is specified by appending a ".n" to the auto-start property name, > // where "n" is the desired start level for the list of bundles. > - // The following code starts bundles in two passes, first it installs > - // them, then it starts them. > - List bundlesToStart = autoInstall(PROPERTY_AUTO_START, context, sl, convertToMavenUrls); > - // Now loop through and start the installed bundles. > - for (Bundle b : bundlesToStart) { > - try { > - b.start(); > - } > - catch (Exception ex) { > - System.err.println("Auto-properties start: " + ex); > - } > - } > + // The following code starts bundles in one passes, it installs > + // and it starts them by level. > + autoInstall(PROPERTY_AUTO_START, context, sl, convertToMavenUrls, true); > + > } > > - private List autoInstall(String propertyPrefix, BundleContext context, StartLevel sl, boolean convertToMavenUrls) { > + private List autoInstall(String propertyPrefix, BundleContext context, StartLevel sl, boolean convertToMavenUrls, boolean start) { > Map autoStart = new TreeMap(); > List bundles = new ArrayList(); > for (Iterator i = configProps.keySet().iterator(); i.hasNext();) { > @@ -531,6 +523,7 @@ > } > for (Integer startLevel : autoStart.keySet()) { > StringTokenizer st = new StringTokenizer(autoStart.get(startLevel), "\" ", true); > + List bundlesLevel = new ArrayList(); > if (st.countTokens() > 0) { > String location = null; > do { > @@ -541,6 +534,7 @@ > Bundle b = context.installBundle(parts[0], new URL(parts[1]).openStream()); > sl.setBundleStartLevel(b, startLevel); > bundles.add(b); > + bundlesLevel.add(b); > } > catch (Exception ex) { > System.err.println("Auto-properties install:" + ex); > @@ -549,6 +543,15 @@ > } > while (location != null); > } > + // Now loop through and start the installed bundles. > + for (Bundle b : bundlesLevel) { > + try { > + b.start(); > + } > + catch (Exception ex) { > + System.err.println("Auto-properties start: " + ex); > + } > + } > } > return bundles; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.