You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by dj...@apache.org on 2011/04/19 20:42:31 UTC

svn commit: r1095164 - in /karaf/trunk: assemblies/features/standard/src/main/feature/ features/core/src/main/java/org/apache/karaf/features/ features/core/src/main/java/org/apache/karaf/features/internal/ features/core/src/main/java/org/apache/karaf/f...

Author: djencks
Date: Tue Apr 19 18:42:31 2011
New Revision: 1095164

URL: http://svn.apache.org/viewvc?rev=1095164&view=rev
Log:
KARAF-576, KARAF-424 Remove BundleInfo.setStartLevel method.  Fix default bundl start value to true so features start automatically

Modified:
    karaf/trunk/assemblies/features/standard/src/main/feature/feature.xml
    karaf/trunk/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java
    karaf/trunk/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java
    karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
    karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
    karaf/trunk/features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0.xsd
    karaf/trunk/tooling/karaf-maven-plugin/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0-ordered.xsd

Modified: karaf/trunk/assemblies/features/standard/src/main/feature/feature.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/assemblies/features/standard/src/main/feature/feature.xml?rev=1095164&r1=1095163&r2=1095164&view=diff
==============================================================================
--- karaf/trunk/assemblies/features/standard/src/main/feature/feature.xml (original)
+++ karaf/trunk/assemblies/features/standard/src/main/feature/feature.xml Tue Apr 19 18:42:31 2011
@@ -145,21 +145,21 @@
         <bundle>mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/${project.version}</bundle>
 		<bundle>mvn:org.apache.felix/org.apache.felix.webconsole.plugins.event/${felix.eventadmin-plugin.version}</bundle>
     </feature>
-    <feature name="ssh" version="${project.version}">
+    <feature name="ssh" version="${project.version}" start-level='30'>
         <config name="org.apache.karaf.shell">
             sshPort=8101
             sshHost=0.0.0.0
             sshRealm=karaf
             hostKey=${karaf.base}/etc/host.key
         </config>
-        <bundle start-level='30' start='true'>mvn:org.apache.mina/mina-core/${mina.version}</bundle>
-        <bundle start-level='30' start='true'>mvn:org.apache.sshd/sshd-core/${sshd.version}</bundle>
-        <bundle start-level='30' start='true'>mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/${project.version}</bundle>
+        <bundle>mvn:org.apache.mina/mina-core/${mina.version}</bundle>
+        <bundle>mvn:org.apache.sshd/sshd-core/${sshd.version}</bundle>
+        <bundle>mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/${project.version}</bundle>
     </feature>
-    <feature name="management" version="${project.version}">
-        <bundle start-level='30' start='true'>mvn:org.apache.karaf/org.apache.karaf.management/${project.version}</bundle>
-        <bundle start-level='30' start='true'>mvn:org.apache.aries.jmx/org.apache.aries.jmx/${aries.jmx.version}</bundle>
-        <bundle start-level='30' start='true'>mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint/${aries.jmx.version}</bundle>
+    <feature name="management" version="${project.version}" start-level='30'>
+        <bundle>mvn:org.apache.karaf/org.apache.karaf.management/${project.version}</bundle>
+        <bundle>mvn:org.apache.aries.jmx/org.apache.aries.jmx/${aries.jmx.version}</bundle>
+        <bundle>mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint/${aries.jmx.version}</bundle>
     </feature>
     <feature name="eventadmin" version="${project.version}">
 		<bundle start-level='30'>mvn:org.apache.felix/org.apache.felix.eventadmin/${felix.eventadmin.version}</bundle>

Modified: karaf/trunk/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java
URL: http://svn.apache.org/viewvc/karaf/trunk/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java?rev=1095164&r1=1095163&r2=1095164&view=diff
==============================================================================
--- karaf/trunk/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java (original)
+++ karaf/trunk/features/core/src/main/java/org/apache/karaf/features/BundleInfo.java Tue Apr 19 18:42:31 2011
@@ -25,8 +25,6 @@ public interface BundleInfo {
 	
     int getStartLevel();
     
-    void setStartLevel(Integer sl);
-    
     boolean isStart();
 
     boolean isDependency();

Modified: karaf/trunk/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java
URL: http://svn.apache.org/viewvc/karaf/trunk/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java?rev=1095164&r1=1095163&r2=1095164&view=diff
==============================================================================
--- karaf/trunk/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java (original)
+++ karaf/trunk/features/core/src/main/java/org/apache/karaf/features/FeaturesService.java Tue Apr 19 18:42:31 2011
@@ -30,8 +30,7 @@ public interface FeaturesService {
         PrintBundlesToRefresh,
         NoAutoRefreshBundles,
         ContinueBatchOnFailure,
-        Verbose ,
-        ForceStart
+        Verbose
     }
 
     /**

Modified: karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
URL: http://svn.apache.org/viewvc/karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java?rev=1095164&r1=1095163&r2=1095164&view=diff
==============================================================================
--- karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java (original)
+++ karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java Tue Apr 19 18:42:31 2011
@@ -345,7 +345,7 @@ public class FeaturesServiceImpl impleme
                     	// do no start bundles when user request it
                     	Long bundleId = b.getBundleId();
                     	BundleInfo bundleInfo = state.bundleInfos.get(bundleId);
-                        if (bundleInfo == null || bundleInfo.isStart() ||options.contains(FeaturesService.Option.ForceStart)) {
+                        if (bundleInfo == null || bundleInfo.isStart()) {
 	                        try {
 	                            b.start();
 	                        } catch (BundleException be) {
@@ -471,13 +471,7 @@ public class FeaturesServiceImpl impleme
         }
         Set<Long> bundles = new TreeSet<Long>();
         for (BundleInfo bInfo : resolve(feature)) {
-        	int sl = feature.getStartLevel();
-        	if (sl > 0 && bInfo.getStartLevel() == 0) {
-        		//there's no start-level specified for a bundle
-        		//so use the possible one from host feature
-        		bInfo.setStartLevel(sl);
-        	}
-            Bundle b = installBundleIfNeeded(state, bInfo, verbose);
+            Bundle b = installBundleIfNeeded(state, bInfo, feature.getStartLevel(), verbose);
             bundles.add(b.getBundleId());
             state.bundleInfos.put(b.getBundleId(), bInfo);
         }
@@ -644,7 +638,7 @@ public class FeaturesServiceImpl impleme
         return result;
     }
 
-    protected Bundle installBundleIfNeeded(InstallationState state, BundleInfo bundleInfo, boolean verbose) throws IOException, BundleException {
+    protected Bundle installBundleIfNeeded(InstallationState state, BundleInfo bundleInfo, int defaultStartLevel, boolean verbose) throws IOException, BundleException {
         InputStream is;
         String bundleLocation = bundleInfo.getLocation();
         LOGGER.debug("Checking " + bundleLocation);
@@ -694,6 +688,8 @@ public class FeaturesServiceImpl impleme
             int ibsl = bundleInfo.getStartLevel();
             if (ibsl > 0) {
                 getStartLevel().setBundleStartLevel(b, ibsl);
+            } else if (defaultStartLevel > 0) {
+                getStartLevel().setBundleStartLevel(b, defaultStartLevel);
             }
 
             state.bundles.add(b);
@@ -966,7 +962,7 @@ public class FeaturesServiceImpl impleme
                         }
                     }
                     try {
-                        installFeatures(features, EnumSet.of(Option.NoCleanIfFailure, Option.ContinueBatchOnFailure, Option.ForceStart));
+                        installFeatures(features, EnumSet.of(Option.NoCleanIfFailure, Option.ContinueBatchOnFailure));
                     } catch (Exception e) {
                         LOGGER.error("Error installing boot features", e);
                     }

Modified: karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java
URL: http://svn.apache.org/viewvc/karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java?rev=1095164&r1=1095163&r2=1095164&view=diff
==============================================================================
--- karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java (original)
+++ karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/model/Bundle.java Tue Apr 19 18:42:31 2011
@@ -133,7 +133,7 @@ public class Bundle implements BundleInf
      *     
      */
     public boolean isStart() {
-        return start == null? false: start;
+        return start == null? true: start;
     }
 
     /**

Modified: karaf/trunk/features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0.xsd
URL: http://svn.apache.org/viewvc/karaf/trunk/features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0.xsd?rev=1095164&r1=1095163&r2=1095164&view=diff
==============================================================================
--- karaf/trunk/features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0.xsd (original)
+++ karaf/trunk/features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0.xsd Tue Apr 19 18:42:31 2011
@@ -112,10 +112,10 @@ Bundle start level set to OSGi framework
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
-                <xs:attribute name="start" type="xs:boolean">
+                <xs:attribute name="start" type="xs:boolean" default="true">
                     <xs:annotation>
                         <xs:documentation><![CDATA[
-This switch allow you to leave bundle in resolved state.
+This switch allow you to leave bundle in resolved state rather than the default active state.
                         ]]>
                         </xs:documentation>
                     </xs:annotation>

Modified: karaf/trunk/tooling/karaf-maven-plugin/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0-ordered.xsd
URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/karaf-maven-plugin/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0-ordered.xsd?rev=1095164&r1=1095163&r2=1095164&view=diff
==============================================================================
--- karaf/trunk/tooling/karaf-maven-plugin/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0-ordered.xsd (original)
+++ karaf/trunk/tooling/karaf-maven-plugin/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0-ordered.xsd Tue Apr 19 18:42:31 2011
@@ -105,10 +105,10 @@ Bundle start level set to OSGi framework
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
-                <xs:attribute name="start" type="xs:boolean">
+                <xs:attribute name="start" type="xs:boolean" default="true">
                     <xs:annotation>
                         <xs:documentation><![CDATA[
-This switch allow you to leave bundle in resolved state.
+This switch allow you to leave bundle in resolved state rather than the default active state.
                         ]]>
                         </xs:documentation>
                     </xs:annotation>