Author: angelo.vandersijpt at luminis.eu
Date: Fri Oct  8 16:36:02 2010
New Revision: 141

Log:
AMDATU-91 Moved configuration out of the projects, and to a separate bundle, 
removing fileinstall as a configuration tool. Also, removed some properties 
from the felix config, which can be handled through ConfigAdmin.

Added:
   trunk/platform-bundles/filebased-configuration/
   trunk/platform-bundles/filebased-configuration/pom.xml
   trunk/platform-bundles/filebased-configuration/src/
   trunk/platform-bundles/filebased-configuration/src/main/
   trunk/platform-bundles/filebased-configuration/src/main/java/
   trunk/platform-bundles/filebased-configuration/src/main/java/org/
   trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/
   
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/
   
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/filebased/
   
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/filebased/Activator.java
   
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/filebased/Configurator.java
   trunk/platform-bundles/filebased-configuration/src/main/resources/
   trunk/platform-bundles/filebased-configuration/src/main/resources/conf/
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.example.course.gadget.cfg
      - copied, changed from r140, 
/trunk/example-bundles/course-gadget/src/main/resources/conf/org.amdatu.example.course.gadget.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.example.course.service.cfg
      - copied, changed from r140, 
/trunk/example-bundles/course-service/src/main/resources/conf/org.amdatu.example.course.service.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.example.friends.gadget.cfg
      - copied, changed from r140, 
/trunk/example-bundles/friends-gadget/src/main/resources/conf/org.amdatu.example.friends.gadget.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.gadget.login.service.cfg
      - copied, changed from r140, 
/trunk/gadget-bundles/login-gadget/src/main/resources/conf/org.amdatu.gadget.login.service.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.gadget.sparqlendpoint.cfg
      - copied, changed from r140, 
/trunk/gadget-bundles/sparqlendpoint-gadget/src/main/resources/conf/org.amdatu.gadget.sparqlendpoint.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.cassandra.application.cfg
      - copied, changed from r140, 
/trunk/platform-bundles/cassandra-application/src/main/resources/conf/org.amdatu.platform.cassandra.application.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.configtemplatemanager.cfg
      - copied, changed from r140, 
/trunk/platform-bundles/config-template-manager/src/main/resources/conf/org.amdatu.platform.configtemplatemanager.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
      - copied, changed from r140, 
/trunk/platform-bundles/loghandler/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.ops4j.pax.web.cfg
Removed:
   
trunk/example-bundles/course-gadget/src/main/resources/conf/org.amdatu.example.course.gadget.cfg
   
trunk/example-bundles/course-service/src/main/resources/conf/org.amdatu.example.course.service.cfg
   
trunk/example-bundles/friends-gadget/src/main/resources/conf/org.amdatu.example.friends.gadget.cfg
   
trunk/gadget-bundles/login-gadget/src/main/resources/conf/org.amdatu.gadget.login.service.cfg
   
trunk/gadget-bundles/sparqlendpoint-gadget/src/main/resources/conf/org.amdatu.gadget.sparqlendpoint.cfg
   
trunk/platform-bundles/cassandra-application/src/main/resources/conf/org.amdatu.platform.cassandra.application.cfg
   
trunk/platform-bundles/config-template-manager/src/main/resources/conf/org.amdatu.platform.configtemplatemanager.cfg
   
trunk/platform-bundles/loghandler/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
Modified:
   
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
   trunk/platform-bundles/pom.xml
   trunk/pom.xml
   trunk/src/main/resources/conf/felix-config.properties

Added: trunk/platform-bundles/filebased-configuration/pom.xml
==============================================================================
--- (empty file)
+++ trunk/platform-bundles/filebased-configuration/pom.xml      Fri Oct  8 
16:36:02 2010
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>org.amdatu.platform-bundles</artifactId>
+        <groupId>org.amdatu</groupId>
+        <version>0.0.4</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.amdatu.platform</groupId>
+    <artifactId>filebased-configuration</artifactId>
+    <packaging>bundle</packaging>
+    <name>Amdatu Support - File Based Configuration</name>
+
+    <build>
+        <finalName>${groupId}.${artifactId}-${platform.version}</finalName>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <excludes>
+                    <exclude>conf/*.*</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>conf/*.*</include>
+                </includes>
+            </resource>
+        </resources>
+        
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        
<Bundle-Activator>org.amdatu.configuration.filebased.Activator</Bundle-Activator>
+                        
<Bundle-SymbolicName>org.amdatu.configuration.filebased</Bundle-SymbolicName>
+                        
<Private-Package>org.amdatu.configuration.filebased</Private-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <copy 
file="${project.build.directory}/${project.build.finalName}.jar" 
todir="${root.directory}/platform-bundles" overwrite="true" />
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

Added: 
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/filebased/Activator.java
==============================================================================
--- (empty file)
+++ 
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/filebased/Activator.java
      Fri Oct  8 16:36:02 2010
@@ -0,0 +1,29 @@
+package org.amdatu.configuration.filebased;
+
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.log.LogService;
+
+
+public class Activator extends DependencyActivatorBase {
+
+    public void init(BundleContext context, DependencyManager manager)
+        throws Exception {
+        manager.add(createComponent()
+            .setImplementation(Configurator.class)
+            .add(createServiceDependency()
+                .setService(LogService.class)
+                .setRequired(false))
+            .add(createServiceDependency()
+                .setService(ConfigurationAdmin.class)
+                .setRequired(true)));
+    }
+
+    public void destroy(BundleContext context, DependencyManager manager)
+        throws Exception {
+        // do nothing
+    }
+
+}
\ No newline at end of file

Added: 
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/filebased/Configurator.java
==============================================================================
--- (empty file)
+++ 
trunk/platform-bundles/filebased-configuration/src/main/java/org/amdatu/configuration/filebased/Configurator.java
   Fri Oct  8 16:36:02 2010
@@ -0,0 +1,235 @@
+package org.amdatu.configuration.filebased;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.log.LogService;
+
+/**
+ * The meat of this configurator has been borrowed from the Apache ACE 
configurator.
+ * It only configures on startup, and will not remove configurations when 
stopped.
+ */
+public class Configurator {
+
+    private static final String DELIM_START = "${";
+    private static final String DELIM_STOP = "}";
+    private static final String FACTORY_INSTANCE_KEY = "factory.instance.pid";
+
+    private volatile LogService m_log;                  /* injected by 
dependency manager */
+    private volatile ConfigurationAdmin m_configAdmin;  /* injected by 
dependency manager */
+    private volatile BundleContext m_context;           /* injected by 
dependency manager */
+
+    public void start() {
+        // Find all entries in our 'conf' directory.
+        Enumeration entries = m_context.getBundle().findEntries("conf", 
"*.cfg", true);
+        while (entries.hasMoreElements()) {
+            URL entry = (URL) entries.nextElement();
+            try {
+                String path = entry.getFile();
+                // First, strip of the '/conf/' and the '.cfg'
+                path = path.substring(6, path.length() - 4);
+
+                String factoryPid = null;
+                // Is there a '/' left? Then this must be a factory pid.
+                if (path.lastIndexOf("/") != -1) {
+                    factoryPid = path.substring(0, path.lastIndexOf("/"));
+                }
+
+                // Find the pid
+                String pid = path.substring(path.lastIndexOf("/") + 1);
+
+                processConfig(entry, pid, factoryPid == "" ? null : 
factoryPid);
+            }
+            catch (Exception e) {
+                m_log.log(LogService.LOG_ERROR, "Could not use config", e);
+            }
+        }
+    }
+
+    /**
+     * Sets the Configuration and calls update() to do the actual 
configuration on the ManagedService.
+     */
+    private void processConfig(URL config, String pid, String factoryPid) {
+        InputStream in = null;
+        try {
+            in = config.openStream();
+            Properties properties = new Properties();
+            properties.load(in);
+            properties = substVars(properties);
+            configure(pid, factoryPid, properties);
+        }
+        catch (IOException ex) {
+            m_log.log(LogService.LOG_ERROR, "Unable to read configuration 
from: " + config.toString(), ex);
+        }
+        finally {
+            if (in != null) {
+                try {
+                    in.close();
+                }
+                catch (Exception ex) {
+                    // Not much we can do
+                }
+            }
+        }
+    }
+
+    private void configure(String pid, String factoryPid, Properties 
properties) {
+        try {
+            Configuration config = getConfiguration(pid, factoryPid);
+            if (factoryPid != null) {
+                properties.put(FACTORY_INSTANCE_KEY, factoryPid + "_" + pid);
+            }
+            config.update(properties);
+            m_log.log(LogService.LOG_DEBUG, "Updated configuration for pid '" 
+ pid + "' (" + properties +")");
+        }
+        catch (IOException ex) {
+            m_log.log(LogService.LOG_ERROR, "Unable to update configuration 
for pid '" + pid + "'", ex);
+        }
+    }
+
+    private Configuration getConfiguration(String pid, String factoryPid) 
throws IOException {
+        if (factoryPid != null) {
+            Configuration[] configs = null;
+            try {
+                configs = m_configAdmin.listConfigurations("(" + 
FACTORY_INSTANCE_KEY + "=" + factoryPid + "_" + pid + ")");
+            }
+            catch (InvalidSyntaxException e) {
+                m_log.log(LogService.LOG_ERROR, "Exception during lookup of 
configuration of managed service factory instance '" + pid + "'", e);
+            }
+            if ((configs == null) || (configs.length == 0)) {
+                return m_configAdmin.createFactoryConfiguration(factoryPid, 
null);
+            }
+            else {
+                return configs[0];
+            }
+        }
+        else {
+            return m_configAdmin.getConfiguration(pid, null);
+        }
+    }
+
+    /**
+     * Performs variable substitution for a complete set of properties
+     *
+     * @see #substVars(String, String, java.util.Map, java.util.Properties)
+     * @param properties Set of properties to apply substitution on.
+     * @return Same set of properties with all variables substituted.
+     */
+    private Properties substVars(Properties properties) {
+        for (Enumeration propertyKeys = properties.propertyNames(); 
propertyKeys.hasMoreElements(); ) {
+            String name = (String) propertyKeys.nextElement();
+            String value = properties.getProperty(name);
+            properties.setProperty(name, substVars(value, name, null, 
properties));
+        }
+        return properties;
+    }
+
+    /**
+     * <p>
+     * This method performs property variable substitution on the specified 
value. If the specified value contains the syntax
+     * <tt>${&lt;prop-name&gt;}</tt>, where <tt>&lt;prop-name&gt;</tt> refers 
to either a configuration property or a
+     * system property, then the corresponding property value is substituted 
for the variable placeholder. Multiple variable
+     * placeholders may exist in the specified value as well as nested 
variable placeholders, which are substituted from inner
+     * most to outer most. Configuration properties override system properties.
+     * </p>
+     *
+     * @param val The string on which to perform property substitution.
+     * @param currentKey The key of the property being evaluated used to 
detect cycles.
+     * @param cycleMap Map of variable references used to detect nested cycles.
+     * @param configProps Set of configuration properties.
+     * @return The value of the specified string after system property 
substitution.
+     * @throws IllegalArgumentException If there was a syntax error in the 
property placeholder syntax or a recursive variable
+     *         reference.
+     */
+    private String substVars(String val, String currentKey, Map cycleMap, 
Properties configProps) throws IllegalArgumentException {
+        // If there is currently no cycle map, then create
+        // one for detecting cycles for this invocation.
+        if (cycleMap == null) {
+            cycleMap = new HashMap();
+        }
+
+        // Put the current key in the cycle map.
+        cycleMap.put(currentKey, currentKey);
+
+        // Assume we have a value that is something like:
+        // "leading ${foo.${bar}} middle ${baz} trailing"
+
+        // Find the first ending '}' variable delimiter, which
+        // will correspond to the first deepest nested variable
+        // placeholder.
+        int stopDelim = val.indexOf(DELIM_STOP);
+
+        // Find the matching starting "${" variable delimiter
+        // by looping until we find a start delimiter that is
+        // greater than the stop delimiter we have found.
+        int startDelim = val.indexOf(DELIM_START);
+        while (stopDelim >= 0) {
+            int idx = val.indexOf(DELIM_START, startDelim + 
DELIM_START.length());
+            if ((idx < 0) || (idx > stopDelim)) {
+                break;
+            }
+            else if (idx < stopDelim) {
+                startDelim = idx;
+            }
+        }
+
+        // If we do not have a start or stop delimiter, then just
+        // return the existing value.
+        if ((startDelim < 0) && (stopDelim < 0)) {
+            return val;
+        }
+        // At this point, we found a stop delimiter without a start,
+        // so throw an exception.
+        else if (((startDelim < 0) || (startDelim > stopDelim)) && (stopDelim 
>= 0)) {
+            throw new IllegalArgumentException("stop delimiter with no start 
delimiter: " + val);
+        }
+
+        // At this point, we have found a variable placeholder so
+        // we must perform a variable substitution on it.
+        // Using the start and stop delimiter indices, extract
+        // the first, deepest nested variable placeholder.
+        String variable = val.substring(startDelim + DELIM_START.length(), 
stopDelim);
+
+        // Verify that this is not a recursive variable reference.
+        if (cycleMap.get(variable) != null) {
+            throw new IllegalArgumentException("recursive variable reference: 
" + variable);
+        }
+
+        // Get the value of the deepest nested variable placeholder.
+        // Try to configuration properties first.
+        String substValue = (configProps != null) ? 
configProps.getProperty(variable, null) : null;
+        if (substValue == null) {
+            // Ignore unknown property values.
+            substValue = m_context.getProperty(variable);
+            if (substValue == null) {
+                substValue = "";
+            }
+        }
+
+        // Remove the found variable from the cycle map, since
+        // it may appear more than once in the value and we don't
+        // want such situations to appear as a recursive reference.
+        cycleMap.remove(variable);
+
+        // Append the leading characters, the substituted value of
+        // the variable, and the trailing characters to get the new
+        // value.
+        val = val.substring(0, startDelim) + substValue + 
val.substring(stopDelim + DELIM_STOP.length(), val.length());
+
+        // Now perform substitution again, since there could still
+        // be substitutions to make.
+        val = substVars(val, currentKey, cycleMap, configProps);
+
+        // Return the value.
+        return val;
+    }
+}
\ No newline at end of file

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.example.course.gadget.cfg
 (from r140, 
/trunk/example-bundles/course-gadget/src/main/resources/conf/org.amdatu.example.course.gadget.cfg)
==============================================================================

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.example.course.service.cfg
 (from r140, 
/trunk/example-bundles/course-service/src/main/resources/conf/org.amdatu.example.course.service.cfg)
==============================================================================

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.example.friends.gadget.cfg
 (from r140, 
/trunk/example-bundles/friends-gadget/src/main/resources/conf/org.amdatu.example.friends.gadget.cfg)
==============================================================================

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.gadget.login.service.cfg
 (from r140, 
/trunk/gadget-bundles/login-gadget/src/main/resources/conf/org.amdatu.gadget.login.service.cfg)
==============================================================================

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.gadget.sparqlendpoint.cfg
 (from r140, 
/trunk/gadget-bundles/sparqlendpoint-gadget/src/main/resources/conf/org.amdatu.gadget.sparqlendpoint.cfg)
==============================================================================

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.cassandra.application.cfg
 (from r140, 
/trunk/platform-bundles/cassandra-application/src/main/resources/conf/org.amdatu.platform.cassandra.application.cfg)
==============================================================================

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.configtemplatemanager.cfg
 (from r140, 
/trunk/platform-bundles/config-template-manager/src/main/resources/conf/org.amdatu.platform.configtemplatemanager.cfg)
==============================================================================

Copied: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
 (from r140, 
/trunk/platform-bundles/loghandler/src/main/resources/conf/org.amdatu.platform.loghandler.cfg)
==============================================================================

Added: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.ops4j.pax.web.cfg
==============================================================================
--- (empty file)
+++ 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.ops4j.pax.web.cfg
        Fri Oct  8 16:36:02 2010
@@ -0,0 +1,18 @@
+# Skype runs on port 80, Oracle db on 8080. Therefore use this 'arbitrary' port
+# Provides properties for the HTTP service (Felix HTTP Bundle or Pax Web)
+org.osgi.service.http.hostname=${server.hostname}
+org.osgi.service.http.port=${server.port}
+org.osgi.service.http.port.secure=${server.port.secure}
+org.apache.felix.http.jettyEnabled=false
+org.apache.felix.log.storeDebug=true
+
+# Properties from HttpContextImpl
+org.osgi.service.http.enabled=true
+org.apache.felix.http.debug=false
+org.osgi.service.http.secure.enabled=false
+javax.servlet.context.tempdir=work/tmp/web
+org.ops4j.pax.web.session.timeout=30
+org.ops4j.pax.web.listening.addresses=0.0.0.0
+org.ops4j.pax.web.session.cookie=JSESSIONID
+org.ops4j.pax.web.session.url=jsessionid
+org.ops4j.pax.web.worker.name=null

Modified: 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
==============================================================================
--- 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
       (original)
+++ 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
       Fri Oct  8 16:36:02 2010
@@ -82,9 +82,6 @@
      * The init() method is invoked by the Felix dependency manager.
      */
     public void init() {
-        // Initialize configuation entries
-        initializeConfiguration();
-
         if (m_component.getServiceProperties() != null) {
             m_bundleId = (Long) 
m_component.getServiceProperties().get(BUNDLEID_PROP);
             m_resourceId = (String) 
m_component.getServiceProperties().get(RESOURCEID_PROP);
@@ -171,47 +168,6 @@
     }
 
     /**
-     * Initializes the configuration properties for the Pax Web HTTP service.
-     */
-    @SuppressWarnings("unchecked")
-    private void initializeConfiguration() {
-        Configuration config;
-        try {
-            // Retrieve configuration of another bundle (Pax Web in our case) 
by adding additional null argument
-            // TODO: when the port number is changed, Pax Web immediately 
picks up this change and will not listen
-            // anymore to he old port. Existing resources will need to be 
registered again with this context to
-            // be available in the new http service instance. So this service 
needs to listen to changes in
-            // config admin and act upon.
-            config = 
m_configurationAdmin.getConfiguration(ResourceProvider.CONFIGURATION_PID, null);
-            Dictionary properties = config.getProperties();
-            if (properties == null) {
-                // Properties not yet set, initialize the defaults
-                properties = new Hashtable();
-                properties.put("org.osgi.service.http.hostname", 
m_bundleContext
-                        .getProperty("org.osgi.service.http.hostname"));
-                properties.put("org.osgi.service.http.port", 
m_bundleContext.getProperty("org.osgi.service.http.port"));
-                properties.put("org.osgi.service.http.port.secure", 
m_bundleContext
-                        .getProperty("org.osgi.service.http.port.secure"));
-                properties.put("org.osgi.service.http.enabled", "true");
-                properties.put("org.apache.felix.http.debug", "false");
-                properties.put("org.osgi.service.http.secure.enabled", 
"false");
-                properties.put("javax.servlet.context.tempdir", 
"work/tmp/web");
-                properties.put("org.ops4j.pax.web.session.timeout", "30");
-                properties.put("org.ops4j.pax.web.listening.addresses", 
"0.0.0.0");
-                properties.put("org.ops4j.pax.web.session.cookie", 
"JSESSIONID");
-                properties.put("org.ops4j.pax.web.session.url", "jsessionid");
-                properties.put("org.ops4j.pax.web.worker.name", "null");
-                config.update(properties);
-                m_logService.log(LogService.LOG_DEBUG, "Http context 
configuration properties initialized.");
-            }
-
-        } catch (IOException e) {
-            m_logService.log(LogService.LOG_ERROR, "Configuration properties 
for '"
-                    + ResourceProvider.CONFIGURATION_PID + "' could not be 
initialized.");
-        }
-    }
-
-    /**
      * Returns the bundle context of the bundle for which this HTTP Context 
was registered. Important to note that this
      * is not the same bundle context as the bundle that holds the HTTP 
Context service.
      * @return the bundle context of the bundle for which this HTTP Context 
was registered

Modified: trunk/platform-bundles/pom.xml
==============================================================================
--- trunk/platform-bundles/pom.xml      (original)
+++ trunk/platform-bundles/pom.xml      Fri Oct  8 16:36:02 2010
@@ -25,7 +25,8 @@
                <module>tenant-service</module>
                <module>useradmin-cassandra-store</module>
                <module>wink-application</module>
-       </modules>
+        <module>filebased-configuration</module>
+    </modules>
        
        <build>
                <pluginManagement>

Modified: trunk/pom.xml
==============================================================================
--- trunk/pom.xml       (original)
+++ trunk/pom.xml       Fri Oct  8 16:36:02 2010
@@ -175,14 +175,6 @@
                        <scope>runtime</scope>
                </dependency>           
                
-               <!-- File install bundle -->
-               <dependency>
-                       <groupId>org.apache.felix</groupId>
-                       <artifactId>org.apache.felix.fileinstall</artifactId>
-                       
<version>${org.apache.felix.file.install.version}</version>
-                       <scope>runtime</scope>
-               </dependency>           
-                                               
                <!-- Use Pax Web as HTTP service implementation -->
                <dependency>
                        <groupId>org.ops4j.pax.web</groupId>

Modified: trunk/src/main/resources/conf/felix-config.properties
==============================================================================
--- trunk/src/main/resources/conf/felix-config.properties       (original)
+++ trunk/src/main/resources/conf/felix-config.properties       Fri Oct  8 
16:36:02 2010
@@ -76,6 +76,7 @@
 # to install and start when the framework starts. The ending numerical
 # component is the target start level. Any number of these properties
 # may be specified for different start levels.
+felix.auto.start.2=reference:file:platform-bundles/org.amdatu.platform.filebased-configuration-0.0.4.jar
 
felix.auto.start.5=reference:file:platform-bundles/org.amdatu.platform.shindig-application-0.0.4.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-application-0.0.4.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-listener-0.0.4.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-persistencemanager-0.0.4.jar
 reference:file:platform-bundles/org.amdatu.platform.loghandler-0.0.4.jar 
reference:file:platform-bundles/org.amdatu.platform.profile-service-0.0.4.jar 
reference:file:platform-bundles/org.amdatu.platform.tenant-service-0.0.4.jar 
reference:file:platform-bundles/org.amdatu.platform.authorization-0.0.4.jar 
reference:file:platform-bundles/org.amdatu.platform.httpcontext-0.0.4.jar 
reference:file:platform-bundles/org.amdatu.platform.wink-application-0.0.4.jar 
reference:file:platform-bundles/org.amdatu.platform.sesame-application-0.0.4.jar
 
reference:file:platform-bundles/org.amdatu.platform.config-template-manager-0.0.4.jar
 
reference:file:platform-bundles/org.amdatu.platform.useradmin-cassandra-store-0.0.4.jar
 
felix.auto.start.10=reference:file:application-bundles/org.amdatu.application.dashboard-0.0.4.jar
 
reference:file:application-bundles/org.amdatu.application.gadgetmanagement-0.0.4.jar
 
felix.auto.start.20=reference:file:gadget-bundles/org.amdatu.gadget.sparqlendpoint-0.0.4.jar
 reference:file:gadget-bundles/org.amdatu.gadget.login-0.0.4.jar
@@ -85,7 +86,7 @@
 org.osgi.framework.startlevel.beginning=30
 
 # Sets the start level of newly installed bundles.
-felix.startlevel.bundle=40 
+felix.startlevel.bundle=40
 
 # Felix installs a stream and content handler factories by default,
 # uncomment the following line to not install them.
@@ -95,19 +96,6 @@
 # by default, uncomment the following line to disable it.
 #felix.shutdown.hook=false
 
-#
-# Bundle config properties.
-#
-
-# Skype runs on port 80, Oracle db on 8080. Therefore use this 'arbitrary' port
-# Provides properties for the HTTP service (Felix HTTP Bundle or Pax Web)
-org.osgi.service.http.hostname=${server.hostname}
-org.osgi.service.http.port=${server.port}
-org.osgi.service.http.port.secure=${server.port.secure}
-org.apache.felix.http.jettyEnabled=false
-org.apache.felix.http.debug=true
-org.apache.felix.log.storeDebug=true
-
 # Config of file install
 felix.fileinstall.poll=3000
 felix.fileinstall.dir=${deploy.directory.name}

Reply via email to