geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manugeo...@apache.org
Subject svn commit: r744878 - in /geronimo/server/branches/2.1: 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 10:20:59 GMT
Author: manugeorge
Date: Mon Feb 16 10:20:58 2009
New Revision: 744878

URL: http://svn.apache.org/viewvc?rev=744878&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/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
    geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=744878&r1=744877&r2=744878&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Mon Feb 16 10:20:58 2009
@@ -192,6 +192,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.
@@ -225,7 +230,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);
 
@@ -584,6 +589,15 @@
         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();
         if (abstractName != null) {

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=744878&r1=744877&r2=744878&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Mon Feb 16 10:20:58 2009
@@ -32,6 +32,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 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);
@@ -1346,6 +1348,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;
 
     static {

Modified: geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=744878&r1=744877&r2=744878&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
(original)
+++ geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
Mon Feb 16 10:20:58 2009
@@ -166,7 +166,7 @@
                 configurationManager.uninstallConfiguration(configId);
                 message(actionResponse, null, "Uninstalled application<br /><br
/>"+configId+"<br /><br />");
             } else if (RESTART_ACTION.equals(action)) {
-                LifecycleResults lcresult = configurationManager.reloadConfiguration(configId);
+                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                 message(actionResponse, lcresult, "Restarted application<br /><br
/>");
             } else {
                 message(actionResponse, null, "Invalid value for changeState: " + action
+ "<br /><br />");



Mime
View raw message