geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1096957 - in /geronimo/server/trunk: ./ framework/buildsupport/car-maven-plugin/src/main/resources/META-INF/plexus/ framework/configs/j2ee-security/ framework/configs/plugin/ framework/configs/server-security-config/ framework/features/cli...
Date Tue, 26 Apr 2011 23:20:37 GMT
Author: djencks
Date: Tue Apr 26 23:20:36 2011
New Revision: 1096957

URL: http://svn.apache.org/viewvc?rev=1096957&view=rev
Log:
Add a ConfigurationInstaller to install plugin xml substituttions and xml overrirdes.  LocalAttributeManager stores data using config admin.  Server now starts OK

Added:
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java   (with props)
Removed:
    geronimo/server/trunk/framework/features/client-system/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/geronimo-gbean-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/j2ee-security/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/jmx-security/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/jsr88-cli/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/jsr88-deploymentfactory/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/offline-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/online-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/plugin/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/rmi-naming/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/features/shutdown/src/main/history/dependencies.xml
Modified:
    geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/resources/META-INF/plexus/components.xml
    geronimo/server/trunk/framework/configs/j2ee-security/pom.xml
    geronimo/server/trunk/framework/configs/plugin/pom.xml
    geronimo/server/trunk/framework/configs/server-security-config/pom.xml
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationExtender.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/PluginAttributeStore.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/WrapperAttributeManager.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/resources/META-INF/plexus/components.xml?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/resources/META-INF/plexus/components.xml (original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/resources/META-INF/plexus/components.xml Tue Apr 26 23:20:36 2011
@@ -45,7 +45,8 @@
                             </process-resources>
                             <compile>
                                 org.apache.geronimo.buildsupport:car-maven-plugin:validate-configuration,
-                                org.apache.geronimo.buildsupport:car-maven-plugin:prepare-plan
+                                org.apache.geronimo.buildsupport:car-maven-plugin:prepare-plan,
+                                org.apache.geronimo.buildsupport:car-maven-plugin:prepare-metadata
                             </compile>
                             <package>
                                 org.apache.geronimo.buildsupport:car-maven-plugin:compile-gbean-plan,

Modified: geronimo/server/trunk/framework/configs/j2ee-security/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/j2ee-security/pom.xml?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/j2ee-security/pom.xml (original)
+++ geronimo/server/trunk/framework/configs/j2ee-security/pom.xml Tue Apr 26 23:20:36 2011
@@ -115,17 +115,17 @@
                 <configuration>
                     <category>Security</category>
                     <instance>
-                        <plugin-artifact>
-                            <config-xml-content>
-                                <gbean name="JMXService">
-                                    <attribute name="protocol">rmi</attribute>
-                                    <attribute name="host">#{ServerHostname}</attribute>
-                                    <attribute name="port">#{JMXPort + PortOffset}</attribute>
-                                    <attribute name="urlPath">/jndi/rmi://#{ServerHostname}:#{NamingPort + PortOffset}/JMXConnector</attribute>
-                                </gbean>
-                             </config-xml-content>
-                            <config-substitution key="JMXPort">9999</config-substitution>
-                        </plugin-artifact>
+                        <!--<plugin-artifact>-->
+                            <!--<config-xml-content>-->
+                                <!--<gbean name="JMXService">-->
+                                    <!--<attribute name="protocol">rmi</attribute>-->
+                                    <!--<attribute name="host">#{ServerHostname}</attribute>-->
+                                    <!--<attribute name="port">#{JMXPort + PortOffset}</attribute>-->
+                                    <!--<attribute name="urlPath">/jndi/rmi://#{ServerHostname}:#{NamingPort + PortOffset}/JMXConnector</attribute>-->
+                                <!--</gbean>-->
+                             <!--</config-xml-content>-->
+                            <!--<config-substitution key="JMXPort">9999</config-substitution>-->
+                        <!--</plugin-artifact>-->
                     </instance>
                 </configuration>
             </plugin>

Modified: geronimo/server/trunk/framework/configs/plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/plugin/pom.xml?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/plugin/pom.xml (original)
+++ geronimo/server/trunk/framework/configs/plugin/pom.xml Tue Apr 26 23:20:36 2011
@@ -117,17 +117,17 @@
                     <deployerName>org.apache.geronimo.framework/geronimo-gbean-deployer-bootstrap/${geronimoVersion}/car?j2eeType=Deployer,name=Deployer</deployerName>
                     <category>Geronimo Core</category>
                     <instance>
-                        <plugin-artifact>
-                            <config-xml-content>
-                                <gbean name="DownloadedPluginRepos">
-                                    <attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-3.0.txt</attribute>
-                                </gbean>
-                            </config-xml-content>
-                            <!--<artifact-alias key="org.apache.geronimo.framework/jsr88-cli//car">org.apache.geronimo.framework/plugin/${project.version}/car</artifact-alias>-->
-                            <!--<artifact-alias key="org.apache.geronimo.framework/jsr88-cli/${project.version}/car">org.apache.geronimo.framework/plugin/${project.version}/car</artifact-alias>-->
-                            <copy-file dest-dir="schema">schema/xsd/</copy-file>
-                            <copy-file dest-dir="var/config" relative-to="server">plugin-repositories.properties</copy-file>
-                        </plugin-artifact>
+                        <!--<plugin-artifact>-->
+                            <!--<config-xml-content>-->
+                                <!--<gbean name="DownloadedPluginRepos">-->
+                                    <!--<attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-3.0.txt</attribute>-->
+                                <!--</gbean>-->
+                            <!--</config-xml-content>-->
+                            <!--&lt;!&ndash;<artifact-alias key="org.apache.geronimo.framework/jsr88-cli//car">org.apache.geronimo.framework/plugin/${project.version}/car</artifact-alias>&ndash;&gt;-->
+                            <!--&lt;!&ndash;<artifact-alias key="org.apache.geronimo.framework/jsr88-cli/${project.version}/car">org.apache.geronimo.framework/plugin/${project.version}/car</artifact-alias>&ndash;&gt;-->
+                            <!--<copy-file dest-dir="schema">schema/xsd/</copy-file>-->
+                            <!--<copy-file dest-dir="var/config" relative-to="server">plugin-repositories.properties</copy-file>-->
+                        <!--</plugin-artifact>-->
                     </instance>
                 </configuration>
             </plugin>

Modified: geronimo/server/trunk/framework/configs/server-security-config/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/server-security-config/pom.xml?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/server-security-config/pom.xml (original)
+++ geronimo/server/trunk/framework/configs/server-security-config/pom.xml Tue Apr 26 23:20:36 2011
@@ -86,9 +86,9 @@
                 <configuration>
                     <category>Security</category>
                     <instance>
-                        <plugin-artifact>
-                            <copy-file relative-to="server" dest-dir="var/security">security/</copy-file>
-                        </plugin-artifact>
+                        <!--<plugin-artifact>-->
+                            <!--<copy-file relative-to="server" dest-dir="var/security">security/</copy-file>-->
+                        <!--</plugin-artifact>-->
                     </instance>
                 </configuration>
             </plugin>

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationExtender.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationExtender.java?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationExtender.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationExtender.java Tue Apr 26 23:20:36 2011
@@ -31,6 +31,7 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.util.IOUtils;
 import org.osgi.framework.Bundle;
@@ -56,7 +57,7 @@ public class ConfigurationExtender {
 
     private BundleTracker bt;
 
-    @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY)
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY, policy = ReferencePolicy.DYNAMIC)
     private ManageableAttributeStore manageableAttributeStore;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
@@ -98,6 +99,11 @@ public class ConfigurationExtender {
     private class ConfigurationBundleTrackerCustomizer implements BundleTrackerCustomizer {
         @Override
         public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) {
+            if (bundleEvent != null) {
+                if (bundleEvent.getType() == BundleEvent.STOPPED) {
+                    return null;
+                }
+            }
             if (bundle.getState() == Bundle.RESOLVED) {
                 return loadConfiguration(bundle);
             } else if (bundle.getState() == Bundle.ACTIVE) {
@@ -120,44 +126,7 @@ public class ConfigurationExtender {
         }
     }
 
-
-//    protected Configuration loadConfiguration(Bundle bundle) {
-//        PluginArtifactType pluginArtifact = dependencyManager.getCachedPluginMetadata(bundle);
-//        if (pluginArtifact == null) {
-//            if (BundleUtils.isResolved(bundle)) {
-//                loadedBundleIds.add(bundle.getBundleId());
-//            }
-//            return;
-//        }
-//        Set<Long> dependentBundleIds = new HashSet<Long>();
-//        for (DependencyType dependency : pluginArtifact.getDependency()) {
-//            Long dependentBundleId = dependencyManager.getBundle(dependency.toArtifact()).getBundleId();
-//            if (!loadedBundleIds.contains(dependentBundleId)) {
-//                dependentBundleIds.add(dependentBundleId);
-//            }
-//        }
-//        if (dependentBundleIds.size() > 0) {
-//            bundleIdListenerMap.put(bundle.getBundleId(), new BundleListener(bundle, dependentBundleIds));
-//            return;
-//        }
-//        _loadConfiguration(bundle);
-//        loadedBundleIds.add(bundle.getBundleId());
-//
-//        boolean bundleStatusChanged;
-//        do {
-//            bundleStatusChanged = false;
-//            for (Iterator<Map.Entry<Long, BundleListener>> it = bundleIdListenerMap.entrySet().iterator(); it.hasNext();) {
-//                Map.Entry<Long, BundleListener> entry = it.next();
-//                if (entry.getValue().bundleChanged(bundle)) {
-//                    bundleStatusChanged = true;
-//                    it.remove();
-//                }
-//            }
-//        } while (bundleStatusChanged);
-//    }
-
     private LoadConfiguration loadConfiguration(Bundle bundle) {
-//        loadedBundleIds.add(bundle.getBundleId());
         URL configSerURL = bundle.getEntry("META-INF/config.ser");
         if (configSerURL == null) {
             return null;
@@ -166,35 +135,6 @@ public class ConfigurationExtender {
         executor.execute(loader);
         configurationMap.put(bundle.getBundleId(), loader);
         return loader;
-//
-//        InputStream in = null;
-//        try {
-//            in = configSerURL.openStream();
-//            //TODO there are additional consistency checks in RepositoryConfigurationStore that we should use.
-//            ConfigurationData data = ConfigurationUtil.readConfigurationData(in);
-//            data.setBundle(bundle);
-//            Configuration configuration = new Configuration(data, manageableAttributeStore);
-//            configurationMap.put(bundle.getBundleId(), configuration);
-//            ConfigurationUtil.loadConfigurationGBeans(configuration, kernel);
-////            for (GBeanData gBeanData: configuration.getGBeans().values()) {
-////                kernel.loadGBean(gBeanData, configuration.getBundle());
-////            }
-//            return configuration;
-//
-////            configurationManager.loadConfiguration(data);
-////            bundleIdArtifactMap.put(bundle.getBundleId(), data.getId());
-//        } catch (IOException e) {
-//            logger.error("Could not read the config.ser file from bundle " + bundle.getLocation(), e);
-//        } catch (ClassNotFoundException e) {
-//            logger.error("Could not load required classes from bundle " + bundle.getLocation(), e);
-//        } catch (InvalidConfigException e) {
-//            logger.error("Could not load Configuration from bundle " + bundle.getLocation(), e);
-////        } catch (GBeanAlreadyExistsException e) {
-////            logger.error("Duplicate gbean in bundle " + bundle.getLocation(), e);
-//        } finally {
-//            IOUtils.close(in);
-//        }
-//        return null;
     }
 
     private StartConfiguration startConfiguration(Bundle bundle) {
@@ -216,45 +156,6 @@ public class ConfigurationExtender {
             executor.execute(stopConfiguration);
             configurationMap.put(bundle.getBundleId(), stopConfiguration);
         }
-//        Artifact id = getArtifact(bundle);
-//        if (id == null) {
-//            return;
-//        }
-//        ServiceReference kernelReference = null;
-//        try {
-//            kernelReference = bundleContext.getServiceReference(Kernel.class.getName());
-//            if (kernelReference == null) {
-//                return;
-//            }
-//            Kernel kernel = (Kernel) bundleContext.getService(kernelReference);
-//            AbstractName name = Configuration.getConfigurationAbstractName(id);
-//            //TODO investigate how this is called and whether just stopping/unloading the configuration gbean will
-//            //leave the configuration model in a consistent state.  We might need a shutdown flag set elsewhere to avoid
-//            //overwriting the load attribute in config.xml. This code mimics the shutdown hook in KernelConfigurationManager
-//            //see https://issues.apache.org/jira/browse/GERONIMO-4909
-//            try {
-//                kernel.stopGBean(name);
-//            } catch (Exception e) {
-//                //ignore
-//            }
-//            try {
-//                kernel.unloadGBean(name);
-//            } catch (Exception e) {
-//            }
-//            //TODO this code is more symmetrical with start, but currently sets the load attribute to false in config.xml,
-//            //which prevents restarting the server.
-//            //ConfigurationManager manager = ConfigurationUtil.getConfigurationManager(kernel);
-//            //manager.unloadConfiguration(id);
-//        } catch (InvalidConfigException e) {
-//            //
-//        } finally {
-//            if (kernelReference != null) {
-//                try {
-//                    bundleContext.ungetService(kernelReference);
-//                } catch (Exception e) {
-//                }
-//            }
-//        }
     }
 
     private void unloadConfiguration(Bundle bundle, GetConfiguration configuration) {
@@ -296,21 +197,13 @@ public class ConfigurationExtender {
                 data.setBundle(bundle);
                 Configuration configuration = new Configuration(data, manageableAttributeStore);
                 ConfigurationUtil.loadConfigurationGBeans(configuration, kernel);
-//            for (GBeanData gBeanData: configuration.getGBeans().values()) {
-//                kernel.loadGBean(gBeanData, configuration.getBundle());
-//            }
                 this.configuration = configuration;
-
-//            configurationManager.loadConfiguration(data);
-//            bundleIdArtifactMap.put(bundle.getBundleId(), data.getId());
             } catch (IOException e) {
                 logger.error("Could not read the config.ser file from bundle " + bundle.getLocation(), e);
             } catch (ClassNotFoundException e) {
                 logger.error("Could not load required classes from bundle " + bundle.getLocation(), e);
             } catch (InvalidConfigException e) {
                 logger.error("Could not load Configuration from bundle " + bundle.getLocation(), e);
-//        } catch (GBeanAlreadyExistsException e) {
-//            logger.error("Duplicate gbean in bundle " + bundle.getLocation(), e);
             } finally {
                 IOUtils.close(in);
             }

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java?rev=1096957&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java Tue Apr 26 23:20:36 2011
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.system.configuration;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.RejectedExecutionException;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.system.plugin.model.ArtifactType;
+import org.apache.geronimo.system.plugin.model.ConfigXmlContentType;
+import org.apache.geronimo.system.plugin.model.PluginArtifactType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.system.plugin.model.PluginXmlUtil;
+import org.apache.geronimo.system.plugin.model.PropertyType;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.util.tracker.BundleTracker;
+import org.osgi.util.tracker.BundleTrackerCustomizer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+@Component(metatype = true)
+public class ConfigurationInstaller {
+    private static final Logger logger = LoggerFactory.getLogger(ConfigurationInstaller.class);
+
+    private final Executor executor = Executors.newCachedThreadPool();
+
+    private BundleTracker bt;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    private PluginAttributeStore pluginAttributeStore;
+
+    public void setPluginAttributeStore(PluginAttributeStore pluginAttributeStore) {
+        this.pluginAttributeStore = pluginAttributeStore;
+    }
+
+    public void unsetPluginAttributeStore(PluginAttributeStore pluginAttributeStore) {
+        if (pluginAttributeStore == this.pluginAttributeStore) {
+            this.pluginAttributeStore = null;
+        }
+    }
+
+    @Activate
+    public void start(BundleContext bundleContext) {
+        bt = new BundleTracker(bundleContext, Bundle.INSTALLED, new ConfigurationBundleTrackerCustomizer());
+        bt.open();
+
+    }
+
+    @Deactivate
+    public void stop() {
+        bt.close();
+        bt = null;
+    }
+
+    private class ConfigurationBundleTrackerCustomizer implements BundleTrackerCustomizer {
+
+        @Override
+        public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) {
+            installConfiguration(bundle);
+            return null;
+        }
+
+        @Override
+        public void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, Object o) {
+        }
+
+        @Override
+        public void removedBundle(Bundle bundle, BundleEvent bundleEvent, Object o) {
+        }
+    }
+
+    private void installConfiguration(Bundle bundle) {
+        URL configSerURL = bundle.getEntry("META-INF/geronimo-plugin.xml");
+        if (configSerURL == null) {
+            return;
+        }
+        Installer loader = new Installer(configSerURL);
+        loader.run();
+//        try {
+//            executor.execute(loader);
+//        } catch (RejectedExecutionException e) {
+//            logger.info("could not execute in thread pool", e);
+//            loader.run();
+//        }
+
+    }
+
+    private class Installer implements Runnable {
+
+        private URL pluginXmlURL;
+
+        public Installer(URL pluginXmlURL) {
+            this.pluginXmlURL = pluginXmlURL;
+
+
+        }
+
+        private boolean equals(String server, String serverName) {
+            return server == null? serverName == null || serverName.isEmpty(): server.equals(serverName);
+        }
+
+        private Artifact toArtifact(ArtifactType moduleId) {
+            String groupId = moduleId.getGroupId();
+            String artifactId = moduleId.getArtifactId();
+            String version = moduleId.getVersion();
+            String type = moduleId.getType();
+            return new Artifact(groupId, artifactId, version, type);
+        }
+
+
+        @Override
+        public void run() {
+            try {
+                InputStream in = pluginXmlURL.openStream();
+                try {
+                    PluginType pluginType = PluginXmlUtil.loadPluginMetadata(in);
+                    PluginArtifactType pluginArtifactType = pluginType.getPluginArtifact().get(0);
+                    List<PropertyType> substitutions = pluginArtifactType.getConfigSubstitution();
+                    Map<String, String> subMap = new HashMap<String, String>();
+                    for (PropertyType propertyType: substitutions) {
+                        if (equals(propertyType.getServer(), pluginAttributeStore.getServerName())) {
+                            subMap.put(propertyType.getKey(), propertyType.getValue());
+                        }
+                    }
+                    pluginAttributeStore.addConfigSubstitutions(subMap);
+                    List<ConfigXmlContentType> xmls = pluginArtifactType.getConfigXmlContent();
+                    for (ConfigXmlContentType xml: xmls) {
+                        if (equals(xml.getServer(), pluginAttributeStore.getServerName())) {
+                            pluginAttributeStore.setModuleGBeans(toArtifact(pluginArtifactType.getModuleId()), xml.getGbean(), xml.isLoad(), xml.getCondition());
+                        }
+                    }
+                } finally {
+                    in.close();
+                }
+            } catch (Exception e) {
+                logger.info("Could not install plugin xml", e);
+            }
+        }
+    }
+
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Tue Apr 26 23:20:36 2011
@@ -16,13 +16,6 @@
  */
 package org.apache.geronimo.system.configuration;
 
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
@@ -30,22 +23,24 @@ import java.io.StringWriter;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
-import java.util.Timer;
-import java.util.TimerTask;
 
 import javax.xml.bind.JAXBException;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamException;
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Modified;
 import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GAttributeInfo;
@@ -65,8 +60,9 @@ import org.apache.geronimo.system.config
 import org.apache.geronimo.system.plugin.model.AttributesType;
 import org.apache.geronimo.system.plugin.model.GbeanType;
 import org.apache.geronimo.system.plugin.model.ModuleType;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.service.cm.ConfigurationAdmin;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.SAXException;
@@ -82,84 +78,97 @@ import org.xml.sax.SAXException;
 public class LocalAttributeManager implements PluginAttributeStore, PersistentConfigurationList {
     private static final Logger log = LoggerFactory.getLogger(LocalAttributeManager.class);
 
-    private static final String CONFIG_FILE_PROPERTY = "org.apache.geronimo.config.file";
-    private final static String SUBSTITUTIONS_FILE_PROPERTY = "org.apache.geronimo.config.substitutions.file";
     private final static String SUBSTITUTION_PREFIX_PREFIX = "org.apache.geronimo.config.substitution.prefix";
 
-    private static final String BACKUP_EXTENSION = ".bak";
-    private static final String TEMP_EXTENSION = ".working";
-    private static final int SAVE_BUFFER_MS = 5000;
+    private final JexlExpressionParser expressionParser = new JexlExpressionParser(Collections.emptyMap());
 
-//    private final ServerInfo serverInfo;
-//    private final String configFile;
-    private boolean readOnly;
-    private JexlExpressionParser expressionParser;
-
-//    private File attributeFile;
-//    private File backupFile;
-//    private File tempFile;
     private ServerOverride serverOverride;
 
-//    private Timer timer;
-//    private TimerTask currentTask;
-
     private boolean kernelFullyStarted;
 
     private String prefix;
-//    private File configSubstitutionsFile;
     private Map<String, String> localConfigSubstitutions;
-//    private String resolvedPropertiesFile;
     private final GBeanInfoFactory infoFactory = new MultiGBeanInfoFactory();
-    private static final byte[] INSTRUCTION = ("# Put variables and their substitution values in this file. \n"
-            + "# They will be used when processing the corresponding config.xml. \n"
-            + "# Values in this file can be overridden by environment variables and system properties \n"
-            + "# by prefixing the property name with 'org.apache.geronimo.config.substitution.' \n"
-            + "# For example, an entry such as hostName=localhost \n"
-            + "# can be overridden by an environment variable or system property org.apache.geronimo.config.substitution.hostName=foo \n"
-            + "# When running multiple instances of Geronimo choose a PortOffset value such that none of the ports conflict. \n"
-            + "# For example, try PortOffset=10 \n").getBytes();
-    private org.osgi.service.cm.Configuration configuration;
-
-    @Property()
     static final String OVERRIDES_KEY = ".overrides";
+
     @Property(value = "org.apache.geronimo.config.substitution.")
     static final String PREFIX_KEY = ".configSubstitutionsPrefix";
+
     @Property(boolValue = false)
     static final String READ_ONLY_KEY = "readOnly";
+    private boolean readOnly;
 
+    @Property(value = "default")
+    static final String SERVER_NAME_KEY = "serverName";
+    private String serverName;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    private ConfigurationAdmin configurationAdmin;
+
+    public void setConfigurationAdmin(ConfigurationAdmin configurationAdmin) {
+        this.configurationAdmin = configurationAdmin;
+    }
+
+    public void unsetConfigurationAdmin(ConfigurationAdmin configurationAdmin) {
+        if (configurationAdmin == this.configurationAdmin) {
+            this.configurationAdmin = null;
+        }
+    }
+
+    private org.osgi.service.cm.Configuration configuration;
 
-//    public LocalAttributeManager(String configFile, String configSubstitutionsFileName, String configSubstitutionsPrefix, boolean readOnly, ServerInfo serverInfo) {
-//        this.configFile = System.getProperty(CONFIG_FILE_PROPERTY, configFile);
-//        resolvedPropertiesFile = System.getProperty(SUBSTITUTIONS_FILE_PROPERTY, configSubstitutionsFileName);
-//        configSubstitutionsFile = resolvedPropertiesFile == null? null: serverInfo.resolveServer(resolvedPropertiesFile);
-//        localConfigSubstitutions = loadConfigSubstitutions(configSubstitutionsFile);
-//        prefix = System.getProperty(SUBSTITUTION_PREFIX_PREFIX, configSubstitutionsPrefix);
-//        Map<String, Object> configSubstitutions = loadAllConfigSubstitutions(localConfigSubstitutions, prefix);
-//        expressionParser = new JexlExpressionParser(configSubstitutions);
-//        this.readOnly = readOnly;
-//        this.serverInfo = serverInfo;
-//        serverOverride = new ServerOverride();
-//
-//        log.debug("setting configSubstitutionsFile to: {}", configSubstitutionsFile);
-//
-//        infoFactory = newGBeanInfoFactory();
-//    }
 
     @Activate
-    public void activate(org.osgi.service.cm.Configuration configuration) throws IOException {
-        this.configuration = configuration;
-        Dictionary dictionary = configuration.getProperties();
-        String overrides = (String) dictionary.remove(OVERRIDES_KEY);
-        String configSubstitutionsPrefix = (String) dictionary.remove(PREFIX_KEY);
-        readOnly = (Boolean) dictionary.get(READ_ONLY_KEY);
-        localConfigSubstitutions = loadConfigSubstitutions(dictionary);
+    public void activate(Map<String, Object> properties) throws IOException {
+        readOnly = (Boolean) properties.get(READ_ONLY_KEY);
+        serverName = (String) properties.get(SERVER_NAME_KEY);
+        String configSubstitutionsPrefix = (String) properties.remove(PREFIX_KEY);
+        String servicePid = (String) properties.get(Constants.SERVICE_PID);
+        this.configuration = configurationAdmin.getConfiguration(servicePid);
+
+        Dictionary<Object, Object> d = getConfigurationProperties();
+        String overrides = (String) d.get(OVERRIDES_KEY);
+        localConfigSubstitutions = loadConfigSubstitutions(d);
         prefix = System.getProperty(SUBSTITUTION_PREFIX_PREFIX, configSubstitutionsPrefix);
         Map<String, Object> configSubstitutions = loadAllConfigSubstitutions(localConfigSubstitutions, prefix);
-        expressionParser = new JexlExpressionParser(configSubstitutions);
+        expressionParser.setVariables(configSubstitutions);
 
         load(overrides);
     }
 
+
+    /**
+     * DS modified method.  This is called back every time the config admin Configuration is updated, but asynchronously.
+     *
+     * @param properties DS properties (which include configuration properties)
+     * @throws IOException
+     */
+    @Modified
+    public void modified(Map<String, Object> properties) throws IOException {
+//        readOnly = (Boolean) properties.get(READ_ONLY_KEY);
+//        serverName = (String) properties.get(SERVER_NAME_KEY);
+//        String configSubstitutionsPrefix = (String) properties.remove(PREFIX_KEY);
+//        String servicePid = (String) properties.get(Constants.SERVICE_PID);
+//        this.configuration = configurationAdmin.getConfiguration(servicePid);
+//
+//        Dictionary<Object, Object> d = getConfigurationProperties();
+//        String overrides = (String) d.get(OVERRIDES_KEY);
+//        localConfigSubstitutions = loadConfigSubstitutions(d);
+//        prefix = System.getProperty(SUBSTITUTION_PREFIX_PREFIX, configSubstitutionsPrefix);
+//        Map<String, Object> configSubstitutions = loadAllConfigSubstitutions(localConfigSubstitutions, prefix);
+//        expressionParser.setVariables(configSubstitutions);
+//
+//        load(overrides);
+    }
+
+    private Dictionary<Object, Object> getConfigurationProperties() {
+        Dictionary<Object, Object> d = configuration.getProperties();
+        if (d == null) {
+            d = new Hashtable<Object, Object>();
+        }
+        return d;
+    }
+
     public boolean isReadOnly() {
         return readOnly;
     }
@@ -244,7 +253,7 @@ public class LocalAttributeManager imple
         return gbean.applyOverrides(data, configName, gbeanName, bundle);
     }
 
-    public void setModuleGBeans(Artifact moduleName, List<GbeanType> gbeans, boolean load, String condition) throws InvalidGBeanException {
+    public synchronized void setModuleGBeans(Artifact moduleName, List<GbeanType> gbeans, boolean load, String condition) throws InvalidGBeanException {
         if (readOnly) {
             return;
         }
@@ -271,11 +280,16 @@ public class LocalAttributeManager imple
         return expressionParser.parse(in);
     }
 
-    public void addConfigSubstitutions(Map<String, String> properties) {
+    @Override
+    public String getServerName() {
+        return serverName;
+    }
+
+    public synchronized void addConfigSubstitutions(Map<String, String> properties) {
         localConfigSubstitutions.putAll(properties);
-        Map<String, Object> configSubstutions = loadAllConfigSubstitutions(localConfigSubstitutions, prefix);
-        storeConfigSubstitutions(configuration, localConfigSubstitutions);
-        expressionParser.setVariables(configSubstutions);
+        Map<String, Object> configSubstitutions = loadAllConfigSubstitutions(localConfigSubstitutions, prefix);
+        expressionParser.setVariables(configSubstitutions);
+        attributeChanged();
     }
 
     public synchronized void setValue(Artifact configurationName, AbstractName gbeanName, GAttributeInfo attribute, Object value, Bundle bundle) {
@@ -395,49 +409,24 @@ public class LocalAttributeManager imple
         if (readOnly) {
             return;
         }
-//        ensureParentDirectory();
-//        if (!tempFile.exists() && !tempFile.createNewFile()) {
-//            throw new IOException("Unable to create manageable attribute working file for save " + tempFile.getAbsolutePath());
-//        }
-//        if (!tempFile.canWrite()) {
-//            throw new IOException("Unable to write to manageable attribute working file for save " + tempFile.getAbsolutePath());
-//        }
 
         // write the new configuration to the temp file
         String overrides = saveXml(serverOverride);
         if (overrides == null) {
             throw new IOException("Could not save serverOverride: " + serverOverride);
         }
-        Dictionary d = configuration.getProperties();
+        Dictionary<Object, Object> d = getConfigurationProperties();
+        for (Map.Entry<String, String> entry: localConfigSubstitutions.entrySet()) {
+            d.put("." + entry.getKey(), entry.getValue());
+        }
         d.put(OVERRIDES_KEY, overrides);
         configuration.update(d);
 
-//        // delete the current backup file
-//        if (backupFile.exists()) {
-//            if (!backupFile.delete()) {
-//                throw new IOException("Unable to delete old backup file in order to back up current manageable attribute working file for save");
-//            }
-//        }
-//
-//        // rename the existing configuration file to the backup file
-//        if (attributeFile.exists()) {
-//            if (!attributeFile.renameTo(backupFile)) {
-//                throw new IOException("Unable to rename " + attributeFile.getAbsolutePath() + " to " + backupFile.getAbsolutePath() + " in order to back up manageable attribute save file");
-//            }
-//        }
-//
-//        // rename the temp file the the configuration file
-//        if (!tempFile.renameTo(attributeFile)) {
-//            throw new IOException(
-//                    "EXTREMELY CRITICAL!  Unable to move manageable attributes working file to proper file name!  Configuration will revert to defaults unless this is manually corrected!  (could not rename " + tempFile.getAbsolutePath() + " to " + attributeFile.getAbsolutePath() + ")");
-//        }
     }
 
     void write(Writer writer) throws XMLStreamException, JAXBException,
             IOException {
-        AttributesType attributes = serverOverride.writeXml();
-        AttributesXmlUtil.writeAttributes(attributes, writer);
-        writer.flush();
+        write(serverOverride, writer);
     }
 
     private static String saveXml(ServerOverride serverOverride) {
@@ -579,24 +568,6 @@ public class LocalAttributeManager imple
         } catch (IOException e) {
             log.error("could not save serverOverrides", e);
         }
-//        if (currentTask != null) {
-//            currentTask.cancel();
-//        }
-//        if (timer != null) {
-//            currentTask = new TimerTask() {
-//
-//                public void run() {
-//                    try {
-//                        LocalAttributeManager.this.save();
-//                    } catch (IOException e) {
-//                        log.error("IOException occurred while saving attributes", e);
-//                    } catch (Throwable t) {
-//                        log.error("Error occurred during execution of attributeChanged TimerTask", t);
-//                    }
-//                }
-//            };
-//            timer.schedule(currentTask, SAVE_BUFFER_MS);
-//        }
     }
 
     private static Map<String, Object> loadAllConfigSubstitutions(Map<String, String> configSubstitutions, String prefix) {
@@ -607,56 +578,35 @@ public class LocalAttributeManager imple
         addGeronimoSubstitutions(vars, System.getenv(), prefix);
         //properties file is least significant
         if (configSubstitutions != null) {
-            addGeronimoSubstitutions(vars, configSubstitutions, ".");
+            addGeronimoSubstitutions(vars, configSubstitutions, "");
         }
         ParserUtils.addDefaultVariables(vars);
         return vars;
     }
 
-//    private static Properties loadConfigSubstitutions(File configSubstitutionsFile) {
-//        Properties properties = new Properties();
-//        if (configSubstitutionsFile != null) {
-//            if (!configSubstitutionsFile.exists()) {
-//                //write out empty file with instructions as a hint to users.
-//                storeConfigSubstitutions(configSubstitutionsFile, properties);
-//            } else {
-//                try {
-//                    FileInputStream in = new FileInputStream(configSubstitutionsFile);
-//                    try {
-//                        properties.load(in);
-//                    } finally {
-//                        in.close();
-//                    }
-//                } catch (Exception e) {
-//                    log.error("Caught exception {} trying to read properties file {}", e, configSubstitutionsFile.getAbsolutePath());
-//                }
-//            }
-//        }
-//        return properties;
-//    }
-    private static Map<String, String> loadConfigSubstitutions(Dictionary<?, ?> dictionary) {
+    private static Map<String, String> loadConfigSubstitutions(Dictionary dictionary) {
         Map<String, String> properties = new HashMap<String, String>();
-        for (Enumeration<?> e = dictionary.keys(); e.hasMoreElements(); ) {
+        for (Enumeration e = dictionary.keys(); e.hasMoreElements();) {
             String key = (String) e.nextElement();
-            if (key.startsWith(".")) {
-                String value = (String) dictionary.get(key);
-                properties.put(key.substring(1), value);
+            Object value = dictionary.get(key);
+            if (key.startsWith(".") && !key.equals(OVERRIDES_KEY) && value instanceof String) {
+                properties.put(key.substring(1) , (String) value);
             }
         }
         return properties;
     }
 
-    private static void storeConfigSubstitutions(org.osgi.service.cm.Configuration configuration, Map<String, String> properties) {
-        Dictionary<Object, Object> d = configuration.getProperties();
-        for (Map.Entry<String, String> entry: properties.entrySet()) {
-            d.put("." + entry.getKey(), entry.getValue());
-        }
-        try {
-            configuration.update(d);
-        } catch (IOException e) {
-            log.error("Caught exception {} trying to update Configuration dictionary", e);
-        }
-    }
+//    private synchronized void storeConfigSubstitutions(Map<String, String> properties) {
+//        Dictionary<Object, Object> d = getConfigurationProperties();
+//        for (Map.Entry<String, String> entry: properties.entrySet()) {
+//            d.put("." + entry.getKey(), entry.getValue());
+//        }
+//        try {
+//            configuration.update(d);
+//        } catch (IOException e) {
+//            log.error("Caught exception {} trying to update Configuration dictionary", e);
+//        }
+//    }
 
     private static void addGeronimoSubstitutions(Map<String, Object> vars, Map<?, ?> props, String prefix) {
         if (prefix != null) {

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/PluginAttributeStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/PluginAttributeStore.java?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/PluginAttributeStore.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/PluginAttributeStore.java Tue Apr 26 23:20:36 2011
@@ -44,4 +44,6 @@ public interface PluginAttributeStore ex
     boolean isModuleInstalled(Artifact artifact);
 
     String substitute(final String in);
+
+    String getServerName();
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/WrapperAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/WrapperAttributeManager.java?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/WrapperAttributeManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/WrapperAttributeManager.java Tue Apr 26 23:20:36 2011
@@ -74,6 +74,11 @@ public class WrapperAttributeManager ext
         return get().substitute(in);
     }
 
+    @Override
+    public String getServerName() {
+        return get().getServerName();
+    }
+
     public void addGBean(Artifact configurationName, GBeanData gbeanData, Bundle bundle) {
         get().addGBean(configurationName, gbeanData, bundle);
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java Tue Apr 26 23:20:36 2011
@@ -23,6 +23,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.LinkedHashSet;
@@ -44,15 +45,16 @@ import org.apache.geronimo.kernel.Naming
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.osgi.MockBundle;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
 
 /**
  * @version $Rev$ $Date$
  */
 public class LocalAttributeManagerTest extends TestCase {
-    private static final String basedir = System.getProperties().getProperty("basedir", ".");
+//    private static final String basedir = System.getProperties().getProperty("basedir", ".");
 
     private LocalAttributeManager localAttributeManager;
     private Artifact configurationName;
@@ -248,7 +250,10 @@ public class LocalAttributeManagerTest e
     protected void setUp() throws Exception {
         super.setUp();
         localAttributeManager = new LocalAttributeManager();
-        Configuration  configuration = new Configuration() {
+        final Map<String, Object> props = new HashMap<String, Object>();
+        props.put(LocalAttributeManager.READ_ONLY_KEY, false);
+        props.put(LocalAttributeManager.PREFIX_KEY, "org.apache.geronimo.config.substitution.");
+        final Configuration  configuration = new Configuration() {
 
             private Hashtable<String, Object> dictionary = new Hashtable<String, Object>();
 
@@ -260,9 +265,7 @@ public class LocalAttributeManagerTest e
             @Override
             public Dictionary getProperties() {
                 Hashtable<String, Object> d = new Hashtable<String, Object>();
-                d.putAll(dictionary);
-                d.put(LocalAttributeManager.READ_ONLY_KEY, false);
-                d.put(LocalAttributeManager.PREFIX_KEY, "org.apache.geronimo.config.substitution.");
+                d.putAll(props);
                 return d;
             }
 
@@ -294,7 +297,35 @@ public class LocalAttributeManagerTest e
                 return null;
             }
         };
-        localAttributeManager.activate(configuration);
+        ConfigurationAdmin ca = new ConfigurationAdmin() {
+
+            @Override
+            public Configuration createFactoryConfiguration(String s) throws IOException {
+                return null;
+            }
+
+            @Override
+            public Configuration createFactoryConfiguration(String s, String s1) throws IOException {
+                return null;
+            }
+
+            @Override
+            public Configuration getConfiguration(String s, String s1) throws IOException {
+                return null;
+            }
+
+            @Override
+            public Configuration getConfiguration(String s) throws IOException {
+                return configuration;
+            }
+
+            @Override
+            public Configuration[] listConfigurations(String s) throws IOException, InvalidSyntaxException {
+                return new Configuration[0];
+            }
+        };
+        localAttributeManager.setConfigurationAdmin(ca);
+        localAttributeManager.activate(props);
 
         configurationName = Artifact.create("configuration/name/1/car");
         ObjectName objectName = ObjectName.getInstance(":name=gbean,parent="+configurationName+",foo=bar");

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?rev=1096957&r1=1096956&r2=1096957&view=diff
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Tue Apr 26 23:20:36 2011
@@ -456,12 +456,12 @@
             <dependency>
                 <groupId>org.apache.geronimo.components</groupId>
                 <artifactId>geronimo-jaspi</artifactId>
-                <version>1.1.1</version>
+                <version>1.1.2-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.geronimo.components</groupId>
                 <artifactId>geronimo-jaspi</artifactId>
-                <version>1.1.1</version>
+                <version>1.1.2-SNAPSHOT</version>
                 <classifier>tests</classifier>
             </dependency>
 
@@ -2198,6 +2198,12 @@
                     </dependencies>
                 </plugin>
 
+                <plugin>
+                    <groupId>org.apache.karaf.tooling</groupId>
+                    <artifactId>karaf-maven-plugin</artifactId>
+                    <version>${karaf.version}</version>
+                    <extensions>true</extensions>
+                </plugin>
 
                 <!-- INTERNAL -->
 
@@ -2392,6 +2398,10 @@
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>org.apache.karaf.tooling</groupId>
+                <artifactId>karaf-maven-plugin</artifactId>
+            </plugin>
         </plugins>
     </build>
 



Mime
View raw message