FELIX-1693: [karaf][shell] Make "system bundles" start level configurable via properties, patch provided by Alin Dreghiciu
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@821878 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/Util.java b/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/Util.java
index 62e23b9..94071df 100644
--- a/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/Util.java
+++ b/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/Util.java
@@ -126,10 +126,17 @@
StartLevel sl = (StartLevel) bundleContext.getService(ref);
if (sl != null) {
int level = sl.getBundleStartLevel(bundle);
- if (level < 50)
- return true;
- else
- return false;
+ int sbsl = 49;
+ final String sbslProp = bundleContext.getProperty( "karaf.systemBundlesStartLevel" );
+ if (sbslProp != null) {
+ try {
+ sbsl = Integer.valueOf( sbslProp );
+ }
+ catch( Exception ignore ) {
+ // ignore
+ }
+ }
+ return level <= sbsl;
}
}
return false;