geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r486453 - /geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
Date Wed, 13 Dec 2006 02:03:52 GMT
Author: djencks
Date: Tue Dec 12 18:03:51 2006
New Revision: 486453

URL: http://svn.apache.org/viewvc?view=rev&rev=486453
Log:
GERONIMO-2560 Fix qname for substitution group for inserted gbean type

Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?view=diff&rev=486453&r1=486452&r2=486453
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
Tue Dec 12 18:03:51 2006
@@ -30,6 +30,7 @@
 import org.apache.geronimo.deployment.xbeans.ReferenceType;
 import org.apache.geronimo.deployment.xbeans.XmlAttributeType;
 import org.apache.geronimo.deployment.xbeans.AbstractServiceType;
+import org.apache.geronimo.deployment.xbeans.ServiceDocument;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
@@ -78,6 +79,7 @@
 import javax.security.auth.spi.LoginModule;
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
+import javax.xml.namespace.QName;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -146,6 +148,7 @@
     private PortletRequestDispatcher testResultsView;
     private PortletRequestDispatcher planView;
     private PortletRequestDispatcher usageView;
+    private static final QName GBEAN_QNAME = new QName(ServiceDocument.type.getDocumentElementName().getNamespaceURI(),
"gbean");
 
     public void init(PortletConfig portletConfig) throws PortletException {
         super.init(portletConfig);
@@ -449,6 +452,19 @@
         destination.dispose();
         config.setName("LoginModuleConfiguration");
         root.setServiceArray(new AbstractServiceType[]{realm});
+
+
+        //Above code inserts gbean using xsi:type=dep:GBeanType.  We also need to account
for the substitution group
+        //by changing the qname:
+        XmlCursor gbeanCursor = root.newCursor();
+        try {
+            if (!gbeanCursor.toChild(ServiceDocument.type.getDocumentElementName())) {
+                throw new RuntimeException("Could not find service element");
+            }
+            gbeanCursor.setName(GBEAN_QNAME);
+        } finally {
+            gbeanCursor.dispose();
+        }
 
         return doc;
     }



Mime
View raw message