geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manugeo...@apache.org
Subject svn commit: r744828 - in /geronimo/server/trunk: framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/
Date Mon, 16 Feb 2009 07:23:27 GMT
Author: manugeorge
Date: Mon Feb 16 07:23:27 2009
New Revision: 744828

URL: http://svn.apache.org/viewvc?rev=744828&view=rev
Log:
GERONIMO-4369:The new attribute values are overwrote while restarting the DB pool connector:Configuration
Manager will now apply overrides on restart

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=744828&r1=744827&r2=744828&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Mon Feb 16 07:23:27 2009
@@ -200,6 +200,11 @@
      * The parent of this configuration;
      */
     private Configuration parent = null;
+    
+    /**
+     * Manageable Attribute Store containing overrides to this configuration.
+     */
+    private ManageableAttributeStore attributeStore = null;
 
     /**
      * Only used to allow declaration as a reference.
@@ -234,7 +239,7 @@
         this.configurationResolver = configurationResolver;
         this.classPath = new LinkedHashSet<String>(configurationData.getClassPath());
         this.naming = configurationData.getNaming();
-
+        this.attributeStore = attributeStore;
         this.id = environment.getConfigId();
         abstractName = getConfigurationAbstractName(id);
 
@@ -588,6 +593,15 @@
     public Configuration getEnclosingConfiguration() {
         return parent;
     }
+    
+    /**
+     * Gets the manageable attribute store for this configuration.
+     * This is used in the configuration manager to apply overrides
+     * @return
+     */
+    ManageableAttributeStore getManageableAttributeStore(){
+    	return attributeStore;
+    }
 
     public synchronized AbstractName addGBean(String name, GBeanData gbean) throws GBeanAlreadyExistsException
{
         AbstractName abstractName = gbean.getAbstractName();

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=744828&r1=744827&r2=744828&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Mon Feb 16 07:23:27 2009
@@ -32,6 +32,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.management.State;
@@ -659,6 +660,7 @@
             // try to start the configuation
             try {
                 Configuration configuration = getConfiguration(configurationId);
+                applyOverrides(configuration);
                 monitor.starting(configurationId);
                 start(configuration);
                 monitor.succeeded(configurationId);
@@ -1345,6 +1347,20 @@
         }
         return map;
     }
+    
+    /**
+     * Used to apply overrides to a configuration's gbeans. 
+     * The overrides are applied before configuration restart.
+     * @throws InvalidConfigException
+     */
+    private void applyOverrides(Configuration configuration) throws InvalidConfigException{
+    	ClassLoader configurationClassLoader = configuration.getConfigurationClassLoader();
+        Collection<GBeanData> gbeans = configuration.getConfigurationData().getGBeans(configurationClassLoader);
+        if (configuration.getManageableAttributeStore() != null) {
+        	configuration.getManageableAttributeStore().applyOverrides(configuration.getId(),
gbeans, 
+        			configurationClassLoader);
+        }
+    }
 
     public static final GBeanInfo GBEAN_INFO;
 

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=744828&r1=744827&r2=744828&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
Mon Feb 16 07:23:27 2009
@@ -165,7 +165,7 @@
                 configurationManager.uninstallConfiguration(configId);
                 addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg04")
+ "<br />" + configId);
             } else if (RESTART_ACTION.equals(action)) {
-                LifecycleResults lcresult = configurationManager.reloadConfiguration(configId);
+                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                 addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg03")
+ printResults(lcresult.getStarted()));
             } else {
                 addWarningMessage(actionRequest, getLocalizedString(actionRequest, "warnMsg01")
+ action + "<br />");



Mime
View raw message