felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1149620 - in /felix/trunk/framework/src/main: java/org/apache/felix/framework/ExtensionManager.java resources/default.properties
Date Fri, 22 Jul 2011 14:33:25 GMT
Author: rickhall
Date: Fri Jul 22 14:33:22 2011
New Revision: 1149620

URL: http://svn.apache.org/viewvc?rev=1149620&view=rev
Log:
Implement generic capabilities for the system bundle. (FELIX_3502)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
    felix/trunk/framework/src/main/resources/default.properties

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java?rev=1149620&r1=1149619&r2=1149620&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java Fri
Jul 22 14:33:22 2011
@@ -181,23 +181,42 @@ class ExtensionManager extends URLStream
         // We must construct the system bundle's export metadata.
         // Get configuration property that specifies which class path
         // packages should be exported by the system bundle.
-        String syspkgs = (String) m_configMap.get(FelixConstants.FRAMEWORK_SYSTEMPACKAGES);
+        String syspkgs =
+            (String) m_configMap.get(FelixConstants.FRAMEWORK_SYSTEMPACKAGES);
         // If no system packages were specified, load our default value.
         syspkgs = (syspkgs == null)
             ? Util.getDefaultProperty(logger, Constants.FRAMEWORK_SYSTEMPACKAGES)
             : syspkgs;
         syspkgs = (syspkgs == null) ? "" : syspkgs;
         // If any extra packages are specified, then append them.
-        String extra = (String) m_configMap.get(FelixConstants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
-        syspkgs = (extra == null) ? syspkgs : syspkgs + "," + extra;
+        String pkgextra =
+            (String) m_configMap.get(FelixConstants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
+        syspkgs = (pkgextra == null) ? syspkgs : syspkgs + "," + pkgextra;
         m_headerMap.put(FelixConstants.BUNDLE_MANIFESTVERSION, "2");
         m_headerMap.put(FelixConstants.EXPORT_PACKAGE, syspkgs);
+
+        // The system bundle alsp provides framework generic capabilities
+        // as well as arbitrary user-defined generic capabilities. We must
+        // construct the system bundle's capabilitie metadata. Get the
+        // configuration property that specifies which capabilities should
+        // be provided by the system bundle.
+        String syscaps =
+            (String) m_configMap.get(FelixConstants.FRAMEWORK_SYSTEMCAPABILITIES);
+        // If no system capabilities were specified, load our default value.
+        syscaps = (syscaps == null)
+            ? Util.getDefaultProperty(logger, Constants.FRAMEWORK_SYSTEMCAPABILITIES)
+            : syscaps;
+        syscaps = (syscaps == null) ? "" : syscaps;
+        // If any extra capabilities are specified, then append them.
+        String capextra =
+            (String) m_configMap.get(FelixConstants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA);
+        syscaps = (capextra == null) ? syscaps : syscaps + "," + capextra;
+        m_headerMap.put(FelixConstants.PROVIDE_CAPABILITY, syscaps);
         try
         {
             ManifestParser mp = new ManifestParser(
                 m_logger, m_configMap, m_systemBundleRevision, m_headerMap);
-            List<BundleCapability> caps = aliasSymbolicName(mp.getCapabilities());
-            setCapabilities(caps);
+            setCapabilities(mp.getCapabilities());
         }
         catch (Exception ex)
         {

Modified: felix/trunk/framework/src/main/resources/default.properties
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/resources/default.properties?rev=1149620&r1=1149619&r2=1149620&view=diff
==============================================================================
--- felix/trunk/framework/src/main/resources/default.properties (original)
+++ felix/trunk/framework/src/main/resources/default.properties Fri Jul 22 14:33:22 2011
@@ -18,6 +18,25 @@
 #
 # Framework config properties.
 #
+
+# New-style generic execution environment capabilities.
+org.osgi.framework.system.capabilities= \
+ ${dollar}{eecap-${dollar}{java.specification.version}}
+
+eecap-1.7= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2,1.3,1.4,1.5,1.6,1.7"
+eecap-1.6= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2,1.3,1.4,1.5,1.6"
+eecap-1.5= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2,1.3,1.4,1.5"
+eecap-1.4= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2,1.3,1.4"
+eecap-1.3= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2,1.3"
+eecap-1.2= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.2"
+
+# Deprecated old-style execution environment properties.
 org.osgi.framework.executionenvironment= \
  ${dollar}{ee-${dollar}{java.specification.version}}
 
@@ -27,7 +46,9 @@ ee-1.6=JavaSE-1.6,J2SE-1.5,J2SE-1.4,J2SE
 ee-1.5=J2SE-1.5,J2SE-1.4,J2SE-1.3,OSGi/Minimum-1.2,OSGi/Minimum-1.1,OSGi/Minimum-1.0
 ee-1.4=J2SE-1.4,J2SE-1.3,OSGi/Minimum-1.2,OSGi/Minimum-1.1,OSGi/Minimum-1.0
 ee-1.3=J2SE-1.3,OSGi/Minimum-1.1,OSGi/Minimum-1.0
+ee-1.2=J2SE-1.2,OSGi/Minimum-1.1,OSGi/Minimum-1.0
 
+# Default packages exported by system bundle.
 org.osgi.framework.system.packages=org.osgi.framework; version=1.6.0, \
  org.osgi.framework.launch; version=1.0.0, \
  org.osgi.framework.wiring; version=1.0.0, \



Mime
View raw message