You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/08/25 14:24:42 UTC

svn commit: r1697662 - in /sling/trunk/launchpad/base: ./ src/main/java/org/apache/sling/launchpad/base/impl/ src/main/resources/

Author: cziegeler
Date: Tue Aug 25 12:24:42 2015
New Revision: 1697662

URL: http://svn.apache.org/r1697662
Log:
SLING-4966 : Use default properties from Felix framework

Modified:
    sling/trunk/launchpad/base/pom.xml
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
    sling/trunk/launchpad/base/src/main/resources/jre-1.5.properties
    sling/trunk/launchpad/base/src/main/resources/jre-1.6.properties
    sling/trunk/launchpad/base/src/main/resources/jre-1.7.properties
    sling/trunk/launchpad/base/src/main/resources/jre-1.8.properties
    sling/trunk/launchpad/base/src/main/resources/sling.properties

Modified: sling/trunk/launchpad/base/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/pom.xml?rev=1697662&r1=1697661&r2=1697662&view=diff
==============================================================================
--- sling/trunk/launchpad/base/pom.xml (original)
+++ sling/trunk/launchpad/base/pom.xml Tue Aug 25 12:24:42 2015
@@ -101,7 +101,7 @@
                         <Export-Package>!*</Export-Package>
                         <DynamicImport-Package>*</DynamicImport-Package>
                         <Embed-Dependency>
-                            org.apache.felix.framework;inline=org/**|META-INF/**,
+                            org.apache.felix.framework;inline=org/**|META-INF/**|default.properties,
                             org.apache.felix.http.proxy;inline=org/apache/**,
                             org.apache.sling.launchpad.api;inline=org/apache/sling/launchpad/api/**
                         </Embed-Dependency>

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java?rev=1697662&r1=1697661&r2=1697662&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java (original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/SlingFelix.java Tue Aug 25 12:24:42 2015
@@ -24,8 +24,12 @@ import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.felix.framework.Felix;
+import org.apache.felix.framework.Logger;
+import org.apache.felix.framework.util.FelixConstants;
+import org.apache.felix.framework.util.Util;
 import org.apache.sling.launchpad.base.shared.Loader;
 import org.apache.sling.launchpad.base.shared.Notifiable;
 import org.osgi.framework.Bundle;
@@ -41,11 +45,34 @@ public class SlingFelix extends Felix {
     // see getBundle(Class) below
     private Method getBundleMethod;
 
-    public SlingFelix(final Notifiable notifiable, final Map<?, ?> props) throws Exception {
-        super(props);
+    public SlingFelix(final Notifiable notifiable, @SuppressWarnings("rawtypes") final Map props) throws Exception {
+        super(getPropsAndDefaultProps(props));
         this.notifiable = notifiable;
     }
 
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    private static Map getPropsAndDefaultProps(final Map props) {
+        final Logger logger = (Logger)props.get(FelixConstants.LOG_LOGGER_PROP);
+        if ( logger != null ) {
+            final Properties fullProps = new Properties();
+            final Properties defaultProps = Util.loadDefaultProperties(logger);
+            fullProps.putAll(defaultProps);
+            fullProps.putAll(props);
+
+            // replace variables
+            for(final Object name : defaultProps.keySet()) {
+                if ( !props.containsKey(name) ) {
+                    final String value = (String)fullProps.get(name);
+                    final String substValue = Util.substVars(value, name.toString(), null, fullProps);
+                    fullProps.put(name, substValue);
+                }
+            }
+
+            return fullProps;
+        }
+        return props;
+    }
+
     @Override
     public void update() throws BundleException {
         update(null);
@@ -79,6 +106,7 @@ public class SlingFelix extends Felix {
         super.stop();
     }
 
+    @Override
     public void stop(final int status) throws BundleException {
         startNotifier(false, null);
         super.stop(status);
@@ -160,6 +188,7 @@ public class SlingFelix extends Felix {
             }
         }
 
+        @Override
         public void run() {
 
             try {

Modified: sling/trunk/launchpad/base/src/main/resources/jre-1.5.properties
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/jre-1.5.properties?rev=1697662&r1=1697661&r2=1697662&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/jre-1.5.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/jre-1.5.properties Tue Aug 25 12:24:42 2015
@@ -20,13 +20,6 @@
 # The file contains the Java 1.5 platform packages used as system packages
 # for the current platform.
 
-# New-style generic execution environment capabilities.
-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.0,1.1,1.2,1.3,1.4,1.5"
-
-# Deprecated old-style execution environment properties.
-ee-1.5=J2SE-1.5,J2SE-1.4,J2SE-1.3,J2SE-1.2,JRE-1.1,JRE-1.0, \
- OSGi/Minimum-1.2,OSGi/Minimum-1.1,OSGi/Minimum-1.0
 
 jre-1.5= \
  javax.accessibility;uses:="javax.swing.text";version="0.0.0.1_005_J2SE", \

Modified: sling/trunk/launchpad/base/src/main/resources/jre-1.6.properties
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/jre-1.6.properties?rev=1697662&r1=1697661&r2=1697662&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/jre-1.6.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/jre-1.6.properties Tue Aug 25 12:24:42 2015
@@ -20,13 +20,6 @@
 # The file contains the Java 1.6 platform packages used as system packages
 # for the current platform.
 
-# New-style generic execution environment capabilities.
-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.0,1.1,1.2,1.3,1.4,1.5,1.6"
-
-# Deprecated old-style execution environment properties.
-ee-1.6=JavaSE-1.6,J2SE-1.5,J2SE-1.4,J2SE-1.3,J2SE-1.2, \
- JRE-1.1,JRE-1.0,OSGi/Minimum-1.2,OSGi/Minimum-1.1,OSGi/Minimum-1.0
 
 jre-1.6= \
  javax.accessibility;uses:="javax.swing.text";version="0.0.0.1_006_JavaSE", \

Modified: sling/trunk/launchpad/base/src/main/resources/jre-1.7.properties
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/jre-1.7.properties?rev=1697662&r1=1697661&r2=1697662&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/jre-1.7.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/jre-1.7.properties Tue Aug 25 12:24:42 2015
@@ -20,14 +20,7 @@
 # The file contains the Java 1.7 platform packages used as system packages
 # for the current platform.
 
-# New-style generic execution environment capabilities.
-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.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7"
 
-# Deprecated old-style execution environment properties.
-ee-1.7=JavaSE-1.7,JavaSE-1.6,J2SE-1.5,J2SE-1.4,J2SE-1.3, \
- J2SE-1.2,JRE-1.1,JRE-1.0,OSGi/Minimum-1.2,OSGi/Minimum-1.1, \
- OSGi/Minimum-1.0
 
 jre-1.7= \
  javax.accessibility;uses:="javax.swing.text";version="0.0.0.1_007_JavaSE", \

Modified: sling/trunk/launchpad/base/src/main/resources/jre-1.8.properties
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/jre-1.8.properties?rev=1697662&r1=1697661&r2=1697662&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/jre-1.8.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/jre-1.8.properties Tue Aug 25 12:24:42 2015
@@ -20,14 +20,7 @@
 # The file contains the Java 1.8 platform packages used as system packages
 # for the current platform.
 
-# New-style generic execution environment capabilities.
-eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8"
 
-# Deprecated old-style execution environment properties.
-ee-1.8=JavaSE-1.8,JavaSE-1.7,JavaSE-1.6,J2SE-1.5,J2SE-1.4,J2SE-1.3, \
- J2SE-1.2,JRE-1.1,JRE-1.0,OSGi/Minimum-1.2,OSGi/Minimum-1.1, \
- OSGi/Minimum-1.0
 
 jre-1.8= \
  javax.accessibility;uses:="javax.swing.text";version="0.0.0.1_008_JavaSE", \

Modified: sling/trunk/launchpad/base/src/main/resources/sling.properties
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/sling.properties?rev=1697662&r1=1697661&r2=1697662&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/sling.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/sling.properties Tue Aug 25 12:24:42 2015
@@ -154,16 +154,6 @@ felix.service.urlhandlers=true
 sling.include.jre = jre-${java.specification.version}.properties
 
 #
-# New-style generic execution environment capabilities.
-org.osgi.framework.system.capabilities= \
- ${eecap-${java.specification.version}}
-
-#
-# Deprecated old-style execution environment properties.
-org.osgi.framework.executionenvironment= \
- ${ee-${java.specification.version}}
-
-#
 # Framework system packages to be visible
 org.osgi.framework.system.packages= \
  ${osgi-core-packages}, \
@@ -202,7 +192,7 @@ sling.bootdelegation.ibm = com.ibm.xml.*
 #    osgi-compendium-services : OSGi Compendium Specification packages
 #
 # Note: These properties are actually prefixed with "sling." and are renamed
-#       to their correct equivalen (without the "sling." prefix) when loading
+#       to their correct equivalent (without the "sling." prefix) when loading
 #       the properties to launch the framework. This is done to be able to
 #       overwrite the values from the sling.properties file in case of an
 #       OSGi API update.