geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r486815 - in /geronimo/server: branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ branches/1.2/modules/geronimo-kernel/src/main/java/org/apa...
Date Wed, 13 Dec 2006 19:45:11 GMT
Author: vamsic007
Date: Wed Dec 13 11:45:10 2006
New Revision: 486815

URL: http://svn.apache.org/viewvc?view=rev&rev=486815
Log:
GERONIMO-2437 Empty dirs and config.xml entries left behind after undeploy
  o Remove config.xml entry only if it is empty

Modified:
    geronimo/server/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
    geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/server/branches/1.2/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
    geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/server/branches/2.0-M1/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
    geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java

Modified: geronimo/server/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
(original)
+++ geronimo/server/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
Wed Dec 13 11:45:10 2006
@@ -90,4 +90,12 @@
      *                       they are migrated.
      */
     void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration);
+
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    boolean hasGBeanAttributes(Artifact configName);
 }

Modified: geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
(original)
+++ geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
Wed Dec 13 11:45:10 2006
@@ -568,6 +568,17 @@
         attributeChanged();
     }
 
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    public boolean hasGBeanAttributes(Artifact configName) {
+        ConfigurationOverride configInfo = serverOverride.getConfiguration(configName);
+        return configInfo != null && !configInfo.getGBeans().isEmpty();
+    }
+
     //GBeanLifeCycle
     public synchronized void doStart() throws Exception {
         load();

Modified: geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/server/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Wed Dec 13 11:45:10 2006
@@ -366,7 +366,7 @@
         try {
             // Is this the right way to get hold of PersistentConfigurationList?
             PersistentConfigurationList configList = (PersistentConfigurationList) kernel.getGBean(PersistentConfigurationList.class);
-            configList.removeConfiguration(configId);
+            if(!configList.hasGBeanAttributes(configId)) configList.removeConfiguration(configId);
         } catch (Exception e) {
             log.warn("Unable to remove configuration from persistent configurations. id =
"+configId, e);
         }

Modified: geronimo/server/branches/1.2/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
Wed Dec 13 11:45:10 2006
@@ -90,4 +90,12 @@
      *                       they are migrated.
      */
     void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration);
+
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    boolean hasGBeanAttributes(Artifact configName);
 }

Modified: geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
Wed Dec 13 11:45:10 2006
@@ -599,6 +599,17 @@
         attributeChanged();
     }
 
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    public boolean hasGBeanAttributes(Artifact configName) {
+        ConfigurationOverride configInfo = serverOverride.getConfiguration(configName);
+        return configInfo != null && !configInfo.getGBeans().isEmpty();
+    }
+
     //GBeanLifeCycle
     public synchronized void doStart() throws Exception {
         load();

Modified: geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Wed Dec 13 11:45:10 2006
@@ -360,7 +360,7 @@
         try {
             // Is this the right way to get hold of PersistentConfigurationList?
             PersistentConfigurationList configList = (PersistentConfigurationList) kernel.getGBean(PersistentConfigurationList.class);
-            configList.removeConfiguration(configId);
+            if(!configList.hasGBeanAttributes(configId)) configList.removeConfiguration(configId);
         } catch (Exception e) {
             log.warn("Unable to remove configuration from persistent configurations. id =
"+configId, e);
         }

Modified: geronimo/server/branches/2.0-M1/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M1/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/2.0-M1/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
(original)
+++ geronimo/server/branches/2.0-M1/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
Wed Dec 13 11:45:10 2006
@@ -90,4 +90,12 @@
      *                       they are migrated.
      */
     void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration);
+
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    boolean hasGBeanAttributes(Artifact configName);
 }

Modified: geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
(original)
+++ geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
Wed Dec 13 11:45:10 2006
@@ -599,6 +599,17 @@
         attributeChanged();
     }
 
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    public boolean hasGBeanAttributes(Artifact configName) {
+        ConfigurationOverride configInfo = serverOverride.getConfiguration(configName);
+        return configInfo != null && !configInfo.getGBeans().isEmpty();
+    }
+
     //GBeanLifeCycle
     public synchronized void doStart() throws Exception {
         load();

Modified: geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/server/branches/2.0-M1/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Wed Dec 13 11:45:10 2006
@@ -341,7 +341,6 @@
         // For now assume the repo is a Maven2Repository.  This should not cause any harm
even if it is an
         // Maven1Repository, for it would be deleting the 'repository' directory if it happens
to be empty.
         boolean m2repo = true;
-
         if(m2repo) {
             // Check version, artifact and group directories, i.e. 3 levels up
             dirDepth = 3;
@@ -361,7 +360,7 @@
         try {
             // Is this the right way to get hold of PersistentConfigurationList?
             PersistentConfigurationList configList = (PersistentConfigurationList) kernel.getGBean(PersistentConfigurationList.class);
-            configList.removeConfiguration(configId);
+            if(!configList.hasGBeanAttributes(configId)) configList.removeConfiguration(configId);
         } catch (Exception e) {
             log.warn("Unable to remove configuration from persistent configurations. id =
"+configId, e);
         }

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
Wed Dec 13 11:45:10 2006
@@ -90,4 +90,12 @@
      *                       they are migrated.
      */
     void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration);
+
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    boolean hasGBeanAttributes(Artifact configName);
 }

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
Wed Dec 13 11:45:10 2006
@@ -599,6 +599,17 @@
         attributeChanged();
     }
 
+    /**
+     * This method checks if there are any custom gbean attributes in the configuration.
+     *
+     * @param configName Name of the configuration
+     * @return true if the configuration contains any custom gbean attributes
+     */
+    public boolean hasGBeanAttributes(Artifact configName) {
+        ConfigurationOverride configInfo = serverOverride.getConfiguration(configName);
+        return configInfo != null && !configInfo.getGBeans().isEmpty();
+    }
+
     //GBeanLifeCycle
     public synchronized void doStart() throws Exception {
         load();

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?view=diff&rev=486815&r1=486814&r2=486815
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Wed Dec 13 11:45:10 2006
@@ -341,7 +341,6 @@
         // For now assume the repo is a Maven2Repository.  This should not cause any harm
even if it is an
         // Maven1Repository, for it would be deleting the 'repository' directory if it happens
to be empty.
         boolean m2repo = true;
-
         if(m2repo) {
             // Check version, artifact and group directories, i.e. 3 levels up
             dirDepth = 3;
@@ -361,7 +360,7 @@
         try {
             // Is this the right way to get hold of PersistentConfigurationList?
             PersistentConfigurationList configList = (PersistentConfigurationList) kernel.getGBean(PersistentConfigurationList.class);
-            configList.removeConfiguration(configId);
+            if(!configList.hasGBeanAttributes(configId)) configList.removeConfiguration(configId);
         } catch (Exception e) {
             log.warn("Unable to remove configuration from persistent configurations. id =
"+configId, e);
         }



Mime
View raw message