geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r709717 - /geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
Date Sat, 01 Nov 2008 16:04:24 GMT
Author: djencks
Date: Sat Nov  1 09:04:23 2008
New Revision: 709717

URL: http://svn.apache.org/viewvc?rev=709717&view=rev
Log:
GERONIMO-3417 Hopefully temporary hack to make the XmlStreamReader return interned local name
and namespaceURI

Modified:
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java?rev=709717&r1=709716&r2=709717&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
Sat Nov  1 09:04:23 2008
@@ -44,6 +44,10 @@
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.namespace.QName;
+import javax.xml.namespace.NamespaceContext;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.components.jaspi.model.AuthModuleType;
@@ -133,6 +137,7 @@
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.SAXException;
@@ -798,7 +803,7 @@
                         authConfigProviderData = new GBeanData(providerName, AuthConfigProviderGBean.class);
                         final XmlCursor xmlCursor = authType.getConfigProvider().newCursor();
                         try {
-                            XMLStreamReader reader = xmlCursor.newXMLStreamReader();
+                            XMLStreamReader reader = new InternWrapper(xmlCursor.newXMLStreamReader());
                             ConfigProviderType configProviderType = JaspiXmlUtil.loadConfigProvider(reader);
                             StringWriter out = new StringWriter();
                             JaspiXmlUtil.writeConfigProvider(configProviderType, out);
@@ -810,7 +815,7 @@
                         authConfigProviderData = new GBeanData(providerName, ServerAuthConfigGBean.class);
                         final XmlCursor xmlCursor = authType.getServerAuthConfig().newCursor();
                         try {
-                            XMLStreamReader reader = xmlCursor.newXMLStreamReader();
+                            XMLStreamReader reader = new InternWrapper(xmlCursor.newXMLStreamReader());
                             ServerAuthConfigType serverAuthConfigType = JaspiXmlUtil.loadServerAuthConfig(reader);
                             StringWriter out = new StringWriter();
                             JaspiXmlUtil.writeServerAuthConfig(serverAuthConfigType, out);
@@ -822,7 +827,7 @@
                         authConfigProviderData = new GBeanData(providerName, ServerAuthContextGBean.class);
                         final XmlCursor xmlCursor = authType.getServerAuthContext().newCursor();
                         try {
-                            XMLStreamReader reader = xmlCursor.newXMLStreamReader();
+                            XMLStreamReader reader = new InternWrapper(xmlCursor.newXMLStreamReader());
                             ServerAuthContextType serverAuthContextType = JaspiXmlUtil.loadServerAuthContext(reader);
                             StringWriter out = new StringWriter();
                             JaspiXmlUtil.writeServerAuthContext(serverAuthContextType, out);
@@ -834,11 +839,15 @@
                         authConfigProviderData = new GBeanData(providerName, ServerAuthModuleGBean.class);
                         final XmlCursor xmlCursor = authType.getServerAuthModule().newCursor();
                         try {
-                            XMLStreamReader reader = xmlCursor.newXMLStreamReader();
+                            XMLStreamReader reader = new InternWrapper(xmlCursor.newXMLStreamReader());
                             AuthModuleType<ServerAuthModule> authModuleType = JaspiXmlUtil.loadServerAuthModule(reader);
                             StringWriter out = new StringWriter();
                             JaspiXmlUtil.writeServerAuthModule(authModuleType, out);
                             authConfigProviderData.setAttribute("config", out.toString());
+                            authConfigProviderData.setAttribute("messageLayer", "Http");
+                            authConfigProviderData.setAttribute("appContext", contextPath);
+                            //TODO ??
+                            authConfigProviderData.setAttribute("authenticationID", contextPath);
                         } finally {
                             xmlCursor.dispose();
                         }
@@ -1271,4 +1280,192 @@
             return comp;
         }
     }
+
+    private static class InternWrapper implements XMLStreamReader {
+        private final XMLStreamReader delegate;
+
+        private InternWrapper(XMLStreamReader delegate) {
+            this.delegate = delegate;
+        }
+
+        public void close() throws XMLStreamException {
+                 delegate.close();
+            }
+
+            public int getAttributeCount() {
+                return  delegate.getAttributeCount();
+            }
+
+            public String getAttributeLocalName(int i) {
+                return  delegate.getAttributeLocalName(i);
+            }
+
+            public QName getAttributeName(int i) {
+                return  delegate.getAttributeName(i);
+            }
+
+            public String getAttributeNamespace(int i) {
+                return  delegate.getAttributeNamespace(i);
+            }
+
+            public String getAttributePrefix(int i) {
+                return  delegate.getAttributePrefix(i);
+            }
+
+            public String getAttributeType(int i) {
+                return  delegate.getAttributeType(i);
+            }
+
+            public String getAttributeValue(int i) {
+                return  delegate.getAttributeValue(i);
+            }
+
+            public String getAttributeValue(String s, String s1) {
+                return  delegate.getAttributeValue(s, s1);
+            }
+
+            public String getCharacterEncodingScheme() {
+                return  delegate.getCharacterEncodingScheme();
+            }
+
+            public String getElementText() throws XMLStreamException {
+                return  delegate.getElementText();
+            }
+
+            public String getEncoding() {
+                return  delegate.getEncoding();
+            }
+
+            public int getEventType() {
+                return  delegate.getEventType();
+            }
+
+            public String getLocalName() {
+                return  delegate.getLocalName().intern();
+            }
+
+            public Location getLocation() {
+                return  delegate.getLocation();
+            }
+
+            public QName getName() {
+                return  delegate.getName();
+            }
+
+            public NamespaceContext getNamespaceContext() {
+                return  delegate.getNamespaceContext();
+            }
+
+            public int getNamespaceCount() {
+                return  delegate.getNamespaceCount();
+            }
+
+            public String getNamespacePrefix(int i) {
+                return  delegate.getNamespacePrefix(i);
+            }
+
+            public String getNamespaceURI() {
+                return  delegate.getNamespaceURI().intern();
+            }
+
+            public String getNamespaceURI(int i) {
+                return  delegate.getNamespaceURI(i);
+            }
+
+            public String getNamespaceURI(String s) {
+                return  delegate.getNamespaceURI(s);
+            }
+
+            public String getPIData() {
+                return  delegate.getPIData();
+            }
+
+            public String getPITarget() {
+                return  delegate.getPITarget();
+            }
+
+            public String getPrefix() {
+                return  delegate.getPrefix();
+            }
+
+            public Object getProperty(String s) throws IllegalArgumentException {
+                return  delegate.getProperty(s);
+            }
+
+            public String getText() {
+                return  delegate.getText();
+            }
+
+            public char[] getTextCharacters() {
+                return  delegate.getTextCharacters();
+            }
+
+            public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException
{
+                return  delegate.getTextCharacters(i, chars, i1, i2);
+            }
+
+            public int getTextLength() {
+                return  delegate.getTextLength();
+            }
+
+            public int getTextStart() {
+                return  delegate.getTextStart();
+            }
+
+            public String getVersion() {
+                return  delegate.getVersion();
+            }
+
+            public boolean hasName() {
+                return  delegate.hasName();
+            }
+
+            public boolean hasNext() throws XMLStreamException {
+                return  delegate.hasNext();
+            }
+
+            public boolean hasText() {
+                return  delegate.hasText();
+            }
+
+            public boolean isAttributeSpecified(int i) {
+                return  delegate.isAttributeSpecified(i);
+            }
+
+            public boolean isCharacters() {
+                return  delegate.isCharacters();
+            }
+
+            public boolean isEndElement() {
+                return  delegate.isEndElement();
+            }
+
+            public boolean isStandalone() {
+                return  delegate.isStandalone();
+            }
+
+            public boolean isStartElement() {
+                return  delegate.isStartElement();
+            }
+
+            public boolean isWhiteSpace() {
+                return  delegate.isWhiteSpace();
+            }
+
+            public int next() throws XMLStreamException {
+                return  delegate.next();
+            }
+
+            public int nextTag() throws XMLStreamException {
+                return  delegate.nextTag();
+            }
+
+            public void require(int i, String s, String s1) throws XMLStreamException {
+                 delegate.require(i, s, s1);
+            }
+
+            public boolean standaloneSet() {
+                return  delegate.standaloneSet();
+            }
+    }
 }



Mime
View raw message