ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1601683 - in /webservices/axiom/trunk/modules: axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/ axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/ axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/ ax...
Date Tue, 10 Jun 2014 16:55:29 GMT
Author: veithen
Date: Tue Jun 10 16:55:29 2014
New Revision: 1601683

URL: http://svn.apache.org/r1601683
Log:
Duplicate code reduction.

Added:
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java
      - copied, changed from r1601682, webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java
Modified:
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java?rev=1601683&r1=1601682&r2=1601683&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java
Tue Jun 10 16:55:29 2014
@@ -49,6 +49,14 @@ public abstract class DOMSOAPFactory ext
         return new SOAPEnvelopeImpl((ParentNode)message, null, builder, this, false);
     }
 
+    public final SOAPEnvelope createSOAPEnvelope() {
+        return new SOAPEnvelopeImpl(null, getNamespace(), null, this, true);
+    }
+    
+    public final SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
+        return new SOAPEnvelopeImpl(null, ns, null, this, true);
+    }
+
     public final SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
         SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(null, getNamespace(), null, this, true);
         createSOAPHeader(env);

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java?rev=1601683&r1=1601682&r2=1601683&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java
Tue Jun 10 16:55:29 2014
@@ -42,7 +42,6 @@ import org.apache.axiom.soap.SOAPHeaderB
 import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.SOAPVersion;
 import org.apache.axiom.soap.SOAP11Version;
-import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
 import org.apache.axiom.soap.impl.dom.factory.DOMSOAPFactory;
 
 /**
@@ -63,19 +62,6 @@ public class SOAP11Factory extends DOMSO
         return SOAP11Version.getSingleton();
     }
 
-    public SOAPEnvelope createSOAPEnvelope() {
-        return new SOAPEnvelopeImpl(
-                null,
-                new OMNamespaceImpl(
-                        SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
-                        SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX),
-                null, this, true);
-    }
-    
-    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
-        return new SOAPEnvelopeImpl(null, ns, null, this, true);
-    }
-
     public SOAPHeader createSOAPHeader() throws SOAPProcessingException {
         return new SOAP11HeaderImpl(null, getNamespace(), null, this, true);
     }

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java?rev=1601683&r1=1601682&r2=1601683&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java
Tue Jun 10 16:55:29 2014
@@ -42,7 +42,6 @@ import org.apache.axiom.soap.SOAPProcess
 import org.apache.axiom.soap.SOAPVersion;
 import org.apache.axiom.soap.SOAP12Version;
 import org.apache.axiom.soap.impl.builder.SOAP12FactoryEx;
-import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
 import org.apache.axiom.soap.impl.dom.factory.DOMSOAPFactory;
 
 /**
@@ -63,19 +62,6 @@ public class SOAP12Factory extends DOMSO
         return SOAP12Version.getSingleton();
     }
 
-    public SOAPEnvelope createSOAPEnvelope() {
-        return new SOAPEnvelopeImpl(
-                null,
-                new OMNamespaceImpl(
-                        SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
-                        SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX),
-                null, this, true);
-    }
-    
-    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
-        return new SOAPEnvelopeImpl(null, ns, null, this, true);
-    }
-
     public SOAPHeader createSOAPHeader() throws SOAPProcessingException {
         return new SOAP12HeaderImpl(null, getNamespace(), null, this, true);
     }

Copied: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java
(from r1601682, webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java?p2=webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java&p1=webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java&r1=1601682&r2=1601683&rev=1601683&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java
Tue Jun 10 16:55:29 2014
@@ -16,56 +16,58 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.axiom.soap.impl.llom;
 
-package org.apache.axiom.soap.impl.dom.factory;
-
-import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.impl.dom.ParentNode;
-import org.apache.axiom.om.impl.dom.factory.OMDOMFactory;
-import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
 import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPHeaderBlock;
 import org.apache.axiom.soap.SOAPMessage;
 import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.impl.builder.SOAPFactoryEx;
-import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
-import org.apache.axiom.soap.impl.dom.SOAPMessageImpl;
 
-public abstract class DOMSOAPFactory extends OMDOMFactory implements SOAPFactoryEx {
-    public DOMSOAPFactory(OMDOMMetaFactory metaFactory) {
+public abstract class SOAPFactoryImpl extends OMLinkedListImplFactory implements SOAPFactoryEx
{
+    public SOAPFactoryImpl(OMLinkedListMetaFactory metaFactory) {
         super(metaFactory);
     }
 
-    public DOMSOAPFactory() {
+    /**
+     * @deprecated
+     */
+    public SOAPFactoryImpl() {
+        super();
+    }
+
+    public final SOAPMessage createSOAPMessage() {
+        return new SOAPMessageImpl(this);
     }
 
     public final SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
-        return new SOAPMessageImpl(builder, this);
+        if (builder == null) {
+            // For Spring-WS compatibility
+            return createSOAPMessage();
+        } else {
+            return new SOAPMessageImpl(builder, this);
+        }
     }
 
     public final SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper
builder) {
-        return new SOAPEnvelopeImpl((ParentNode)message, null, builder, this, false);
+        return new SOAPEnvelopeImpl(message, builder, this);
+    }
+
+    public final SOAPEnvelope createSOAPEnvelope() {
+        return new SOAPEnvelopeImpl(getNamespace(), this);
+    }
+    
+    public final SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
+        return new SOAPEnvelopeImpl(ns, this);
     }
 
     public final SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
-        SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(null, getNamespace(), null, this, true);
+        SOAPEnvelope env = createSOAPEnvelope();
         createSOAPHeader(env);
         createSOAPBody(env);
         return env;
     }
-
-    public final SOAPMessage createSOAPMessage() {
-        return new SOAPMessageImpl(this);
-    }
-
-    public SOAPHeaderBlock createSOAPHeaderBlock(OMDataSource source) {
-        throw new UnsupportedOperationException("TODO");
-    }
-
-    public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns, OMDataSource
ds) throws SOAPProcessingException {
-        throw new UnsupportedOperationException("TODO");
-    }
-
 }

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java?rev=1601683&r1=1601682&r2=1601683&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
Tue Jun 10 16:55:29 2014
@@ -24,7 +24,6 @@ import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
-import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
 import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAPBody;
@@ -40,17 +39,14 @@ import org.apache.axiom.soap.SOAPFaultTe
 import org.apache.axiom.soap.SOAPFaultValue;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.soap.SOAPMessage;
 import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.SOAPVersion;
 import org.apache.axiom.soap.SOAP11Version;
-import org.apache.axiom.soap.impl.builder.SOAPFactoryEx;
-import org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl;
-import org.apache.axiom.soap.impl.llom.SOAPMessageImpl;
+import org.apache.axiom.soap.impl.llom.SOAPFactoryImpl;
 
 /**
  */
-public class SOAP11Factory extends OMLinkedListImplFactory implements SOAPFactoryEx {
+public class SOAP11Factory extends SOAPFactoryImpl {
     /**
      * For internal use only.
      * 
@@ -80,19 +76,6 @@ public class SOAP11Factory extends OMLin
         return SOAP11Version.getSingleton();
     }
 
-    public SOAPEnvelope createSOAPEnvelope() {
-        return new SOAPEnvelopeImpl(
-                new OMNamespaceImpl(
-                        SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
-                        SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX),
-                this);
-    }
-    
-    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
-        return new SOAPEnvelopeImpl(ns,
-                                    this);
-    }
-
     public SOAPHeader createSOAPHeader(SOAPEnvelope envelope)
             throws SOAPProcessingException {
         return new SOAP11HeaderImpl(envelope, this);
@@ -272,17 +255,6 @@ public class SOAP11Factory extends OMLin
         return new SOAP11FaultDetailImpl(parent, builder, this);
     }
 
-    public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
-        OMNamespace ns =
-                new OMNamespaceImpl(
-                        SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
-                        SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
-        SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns, this);
-        createSOAPHeader(env);
-        createSOAPBody(env);
-        return env;
-    }
-
     public SOAPEnvelope getDefaultFaultEnvelope() throws SOAPProcessingException {
         SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
         SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());
@@ -291,23 +263,4 @@ public class SOAP11Factory extends OMLin
         createSOAPFaultDetail(fault);
         return defaultEnvelope;
     }
-
-    public SOAPMessage createSOAPMessage() {
-        return new SOAPMessageImpl(this);
-    }
-
-    public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
-        if (builder == null) {
-            // For Spring-WS compatibility
-            return createSOAPMessage();
-        } else {
-            return new SOAPMessageImpl(builder, this);
-        }
-    }
-
-    public SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder)
{
-        return new SOAPEnvelopeImpl(message, builder, this);
-    }
-
-
 }

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java?rev=1601683&r1=1601682&r2=1601683&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
Tue Jun 10 16:55:29 2014
@@ -24,7 +24,6 @@ import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
-import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
 import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPBody;
@@ -40,17 +39,15 @@ import org.apache.axiom.soap.SOAPFaultTe
 import org.apache.axiom.soap.SOAPFaultValue;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.soap.SOAPMessage;
 import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axiom.soap.SOAPVersion;
 import org.apache.axiom.soap.SOAP12Version;
 import org.apache.axiom.soap.impl.builder.SOAP12FactoryEx;
-import org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl;
-import org.apache.axiom.soap.impl.llom.SOAPMessageImpl;
+import org.apache.axiom.soap.impl.llom.SOAPFactoryImpl;
 
 /**
  */
-public class SOAP12Factory extends OMLinkedListImplFactory implements SOAP12FactoryEx {
+public class SOAP12Factory extends SOAPFactoryImpl implements SOAP12FactoryEx {
     /**
      * For internal use only.
      * 
@@ -80,19 +77,6 @@ public class SOAP12Factory extends OMLin
                                    SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
     }
 
-    public SOAPEnvelope createSOAPEnvelope() {
-        return new SOAPEnvelopeImpl(
-                new OMNamespaceImpl(
-                        SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
-                        SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX),
-                this);
-    }
-    
-    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
-        return new SOAPEnvelopeImpl(ns,
-                                    this);
-    }
-
     public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) throws SOAPProcessingException
{
         return new SOAP12HeaderImpl(envelope, this);
     }
@@ -305,18 +289,6 @@ public class SOAP12Factory extends OMLin
         return new SOAP12FaultDetailImpl(parent, builder, this);
     }
 
-    public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
-        OMNamespace ns =
-                new OMNamespaceImpl(
-                        SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
-                        SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
-        SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns, this);
-        createSOAPHeader(env);
-        createSOAPBody(env);
-
-        return env;
-    }
-
     public SOAPEnvelope getDefaultFaultEnvelope() throws SOAPProcessingException {
         SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
         SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());
@@ -331,23 +303,4 @@ public class SOAP12Factory extends OMLin
 
         return defaultEnvelope;
     }
-
-    public SOAPMessage createSOAPMessage() {
-        return new SOAPMessageImpl(this);
-    }
-
-    public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
-        if (builder == null) {
-            // For Spring-WS compatibility
-            return createSOAPMessage();
-        } else {
-            return new SOAPMessageImpl(builder, this);
-        }
-    }
-
-    public SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder)
{
-        return new SOAPEnvelopeImpl(message, builder, this);
-    }
-
-
 }



Mime
View raw message