geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chirun...@apache.org
Subject svn commit: r1140982 - /geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
Date Wed, 29 Jun 2011 07:15:55 GMT
Author: chirunhua
Date: Wed Jun 29 07:15:55 2011
New Revision: 1140982

URL: http://svn.apache.org/viewvc?rev=1140982&view=rev
Log:
GERONIMO-6010:NPE when creating keystores

Modified:
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java?rev=1140982&r1=1140981&r2=1140982&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
Wed Jun 29 07:15:55 2011
@@ -55,6 +55,9 @@ import org.apache.geronimo.gbean.GBeanIn
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.EditableConfigurationManager;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.util.InputUtils;
 import org.apache.geronimo.management.geronimo.KeyIsLocked;
 import org.apache.geronimo.management.geronimo.KeystoreException;
@@ -178,21 +181,21 @@ public class FileKeystoreManager impleme
             }
         }
         data.setAttribute("keystoreType", type);
-//        EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
-//        if(mgr != null) {
-//            try {
-//                mgr.addGBeanToConfiguration(myName.getArtifact(), data, true);
-//                return (KeystoreInstance) kernel.getProxyManager().createProxy(aName, KeystoreInstance.class);
-//            } catch (InvalidConfigException e) {
-//                log.error("Should never happen", e);
-//                throw new IllegalStateException("Unable to add Keystore GBean ("+e.getMessage()+")",
e);
-//            } finally {
-//                ConfigurationUtil.releaseConfigurationManager(kernel, mgr);
-//            }
-//        } else {
+        EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
+        if(mgr != null) {
+            try {
+                mgr.addGBeanToConfiguration(myName.getArtifact(), data, true);
+                return (KeystoreInstance) kernel.getProxyManager().createProxy(aName, KeystoreInstance.class);
+            } catch (InvalidConfigException e) {
+                log.error("Should never happen", e);
+                throw new IllegalStateException("Unable to add Keystore GBean ("+e.getMessage()+")",
e);
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, mgr);
+            }
+        } else {
             log.warn("The ConfigurationManager in the kernel does not allow changes at runtime");
             return null;
-//        }
+        }
     }
 
     /**



Mime
View raw message