You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2005/04/29 14:04:03 UTC

svn commit: r165298 - in /webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om: OMAbstractFactory.java SOAPFactory.java impl/llom/factory/SOAPLinkedListImplFactory.java impl/llom/soap11/SOAP11Factory.java impl/llom/soap12/SOAP12Factory.java

Author: chinthaka
Date: Fri Apr 29 05:04:02 2005
New Revision: 165298

URL: http://svn.apache.org/viewcvs?rev=165298&view=rev
Log:
Adding SOAP and OM Factories. Refer mail to the mailing list for more details

Added:
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMAbstractFactory.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/SOAPFactory.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/SOAPLinkedListImplFactory.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap11/SOAP11Factory.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap12/SOAP12Factory.java

Added: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMAbstractFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMAbstractFactory.java?rev=165298&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMAbstractFactory.java (added)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMAbstractFactory.java Fri Apr 29 05:04:02 2005
@@ -0,0 +1,89 @@
+package org.apache.axis.om;
+
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.FactoryFinder;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Factory;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * <p/>
+ */
+public class OMAbstractFactory {
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+    /**
+     * Constructor OMFactory
+     */
+    protected OMAbstractFactory() {
+    }
+
+    /**
+     * This will pick up the default factory implementation from the classpath
+     *
+     * @return
+     */
+    public static OMFactory getOMFactory() {
+        return FactoryFinder.findOMFactory(null);
+    }
+
+    /**
+     * If user needs to provide his own factory implementation, here provide the
+     * Class Loader for that.
+     * @param classLoader
+     * @return
+     */
+    public static OMFactory getOMFactory(ClassLoader classLoader) {
+        return FactoryFinder.findOMFactory(classLoader);
+    }
+
+    /**
+     * This will pick up the default factory implementation from the classpath
+     *
+     * @return
+     */
+    public static SOAPFactory getSOAP11Factory() {
+        return FactoryFinder.findSOAP11Factory(null);
+    }
+
+    /**
+     * If user needs to provide his own factory implementation, here provide the
+     * Class Loader for that.
+     * @param classLoader
+     * @return
+     */
+    public static SOAPFactory getSOAP11Factory(ClassLoader classLoader) {
+        return FactoryFinder.findSOAP11Factory(classLoader);
+    }
+
+    /**
+     * This will pick up the default factory implementation from the classpath
+     *
+     * @return
+     */
+    public static SOAPFactory getSOAP12Factory() {
+        return FactoryFinder.findSOAP12Factory(null);
+    }
+
+    /**
+     * If user needs to provide his own factory implementation, here provide the
+     * Class Loader for that.
+     * @param classLoader
+     * @return
+     */
+    public static SOAPFactory getSOAP12Factory(ClassLoader classLoader) {
+        return FactoryFinder.findSOAP12Factory(classLoader);
+    }
+}

Added: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/SOAPFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/SOAPFactory.java?rev=165298&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/SOAPFactory.java (added)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/SOAPFactory.java Fri Apr 29 05:04:02 2005
@@ -0,0 +1,107 @@
+package org.apache.axis.om;
+
+import org.apache.axis.om.*;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * <p/>
+ */
+public interface SOAPFactory extends OMFactory{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+    /**
+     * @param envelope
+     * @return
+     */
+    public abstract SOAPBody createSOAPBody(SOAPEnvelope envelope);
+
+    /**
+     * @param envelope
+     * @param builder
+     * @return
+     */
+    public abstract SOAPBody createSOAPBody(SOAPEnvelope envelope,
+                                            OMXMLParserWrapper builder);
+
+    /**
+     * @param ns
+     * @param builder
+     * @return
+     */
+    public abstract SOAPEnvelope createSOAPEnvelope(OMNamespace ns,
+                                                    OMXMLParserWrapper builder);
+
+    /**
+     * @param ns
+     * @return
+     */
+    public abstract SOAPEnvelope createSOAPEnvelope(OMNamespace ns);
+
+    /**
+     * @param envelope
+     * @return
+     */
+    public abstract SOAPHeader createSOAPHeader(SOAPEnvelope envelope);
+
+    /**
+     * @param envelope
+     * @param builder
+     * @return
+     */
+    public abstract SOAPHeader createSOAPHeader(SOAPEnvelope envelope,
+                                                OMXMLParserWrapper builder);
+
+    /**
+     * @param localName
+     * @param ns
+     * @return
+     */
+    public abstract SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+                                                          OMNamespace ns);
+
+    /**
+     * @param localName
+     * @param ns
+     * @param parent
+     * @param builder
+     * @return
+     */
+    public abstract SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+                                                          OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
+
+    /**
+     * @param parent
+     * @param e
+     * @return
+     */
+    public abstract SOAPFault createSOAPFault(SOAPBody parent, Exception e);
+
+    /**
+     * @param ns
+     * @param parent
+     * @param builder
+     * @return
+     */
+    public abstract SOAPFault createSOAPFault(OMNamespace ns, SOAPBody parent,
+                                              OMXMLParserWrapper builder);
+
+    /**
+     * Method getDefaultEnvelope
+     *
+     * @return
+     */
+    public abstract SOAPEnvelope getDefaultEnvelope();
+}

Added: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/SOAPLinkedListImplFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/SOAPLinkedListImplFactory.java?rev=165298&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/SOAPLinkedListImplFactory.java (added)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/SOAPLinkedListImplFactory.java Fri Apr 29 05:04:02 2005
@@ -0,0 +1,164 @@
+package org.apache.axis.om.impl.llom.factory;
+
+import org.apache.axis.om.*;
+import org.apache.axis.om.impl.llom.*;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * <p/>
+ */
+public class SOAPLinkedListImplFactory extends OMLinkedListImplFactory implements SOAPFactory {
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+
+    /**
+     * Method createSOAPBody
+     *
+     * @param envelope
+     * @return
+     */
+    public SOAPBody createSOAPBody(SOAPEnvelope envelope) {
+        SOAPBody soapBody = new SOAPBodyImpl(envelope);
+        return soapBody;
+    }
+
+    /**
+     * Method createSOAPBody
+     *
+     * @param envelope
+     * @param builder
+     * @return
+     */
+    public SOAPBody createSOAPBody(SOAPEnvelope envelope,
+                                   OMXMLParserWrapper builder) {
+        return new SOAPBodyImpl(envelope, builder);
+    }
+
+    /**
+     * Method createSOAPEnvelope
+     *
+     * @param ns
+     * @param builder
+     * @return
+     */
+    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns,
+                                           OMXMLParserWrapper builder) {
+        return new SOAPEnvelopeImpl(ns, builder);
+    }
+
+    /**
+     * Method createSOAPEnvelope
+     *
+     * @param ns
+     * @return
+     */
+    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
+        return new SOAPEnvelopeImpl(ns);
+    }
+
+    /**
+     * Method createSOAPHeader
+     *
+     * @param envelope
+     * @return
+     */
+    public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) {
+        return new SOAPHeaderImpl(envelope);
+    }
+
+    /**
+     * Method createSOAPHeader
+     *
+     * @param envelope
+     * @param builder
+     * @return
+     */
+    public SOAPHeader createSOAPHeader(SOAPEnvelope envelope,
+                                       OMXMLParserWrapper builder) {
+        return new SOAPHeaderImpl(envelope, builder);
+    }
+
+    /**
+     * Method createSOAPHeaderBlock
+     *
+     * @param localName
+     * @param ns
+     * @return
+     */
+    public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+                                                 OMNamespace ns) {
+        return new SOAPHeaderBlockImpl(localName, ns);
+    }
+
+    /**
+     * Method createSOAPHeaderBlock
+     *
+     * @param localName
+     * @param ns
+     * @param parent
+     * @param builder
+     * @return
+     */
+    public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+                                                 OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+        return new SOAPHeaderBlockImpl(localName, ns, parent, builder);
+    }
+
+    /**
+     * Method createSOAPFault
+     *
+     * @param parent
+     * @param e
+     * @return
+     */
+    public SOAPFault createSOAPFault(SOAPBody parent, Exception e) {
+        return new SOAPFaultImpl(parent, e);
+    }
+
+    /**
+     * Method createSOAPFault
+     *
+     * @param ns
+     * @param parent
+     * @param builder
+     * @return
+     */
+    public SOAPFault createSOAPFault(OMNamespace ns, SOAPBody parent,
+                                     OMXMLParserWrapper builder) {
+        return new SOAPFaultImpl(ns, parent, builder);
+    }
+
+    /**
+     * Method getDefaultEnvelope
+     *
+     * @return
+     */
+    public SOAPEnvelope getDefaultEnvelope() {
+        // Create an envelope
+        OMNamespace ns =
+        new OMNamespaceImpl(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+                SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
+        SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns);
+        SOAPBodyImpl bodyImpl = new SOAPBodyImpl(env);
+        env.addChild(bodyImpl);
+
+        SOAPHeaderImpl headerImpl = new SOAPHeaderImpl(env);
+        headerImpl.setComplete(true);
+        env.addChild(headerImpl);
+        return env;
+    }
+}

Added: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap11/SOAP11Factory.java?rev=165298&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap11/SOAP11Factory.java (added)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap11/SOAP11Factory.java Fri Apr 29 05:04:02 2005
@@ -0,0 +1,27 @@
+package org.apache.axis.om.impl.llom.soap11;
+
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.SOAPFactory;
+import org.apache.axis.om.impl.llom.factory.SOAPLinkedListImplFactory;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * <p/>
+ */
+public class SOAP11Factory extends SOAPLinkedListImplFactory implements SOAPFactory{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+}

Added: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap12/SOAP12Factory.java?rev=165298&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap12/SOAP12Factory.java (added)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/soap12/SOAP12Factory.java Fri Apr 29 05:04:02 2005
@@ -0,0 +1,26 @@
+package org.apache.axis.om.impl.llom.soap12;
+
+import org.apache.axis.om.impl.llom.factory.SOAPLinkedListImplFactory;
+import org.apache.axis.om.SOAPFactory;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ * <p/>
+ */
+public class SOAP12Factory extends SOAPLinkedListImplFactory implements SOAPFactory{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+}