You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/06/15 11:57:21 UTC

svn commit: r190723 - in /webservices/axis/trunk/java/modules/core: src/org/apache/axis/deployment/ src/org/apache/axis/description/ src/org/apache/axis/phaseresolver/ test-resources/deployment/module1/META-INF/

Author: deepal
Date: Wed Jun 15 02:57:20 2005
New Revision: 190723

URL: http://svn.apache.org/viewcvs?rev=190723&view=rev
Log:
module can add operations to when some one engage that to a service or globally

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ModuleDescription.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
    webservices/axis/trunk/java/modules/core/test-resources/deployment/module1/META-INF/module.xml

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java?rev=190723&r1=190722&r2=190723&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java Wed Jun 15 02:57:20 2005
@@ -699,7 +699,9 @@
                 String attvalue = pullparser.getAttributeValue(i);
                 if (ATTNAME.equals(attname)) {
                     operation.setName(new QName(attvalue));
-                } else
+                } else if(MEP.equals(attname)){
+                    operation.setMessageExchangePattern(attvalue);
+                }else
                     throw new DeploymentException("bad attribute in operation " + attname);
             }
         }
@@ -728,7 +730,10 @@
                                 }
                             }
                         }
-                    } else if (IN_FAILTFLOW.equals(ST)) {
+                    }else if(PARAMETERST.equals(ST)){
+                        Parameter parameter = processParameter();
+                        operation.addParameter(parameter);
+                    }else if (IN_FAILTFLOW.equals(ST)) {
                         throw new UnsupportedOperationException("nexted elements are not allowed for M1");
                     } else if (INFLOWST.equals(ST)) {
                         throw new UnsupportedOperationException("nexted elements are not allowed for M1");
@@ -743,8 +748,8 @@
                                 try {
                                     Class messageReceiver = null;
                                     ClassLoader loader1= dpengine.getCurrentFileItem().getClassLoader();
-                                   // ClassLoader loader1 =
-                                     //       Thread.currentThread().getContextClassLoader();
+                                    // ClassLoader loader1 =
+                                    //       Thread.currentThread().getContextClassLoader();
                                     if (attvalue != null && !"".equals(attvalue)) {
                                         messageReceiver = Class.forName(attvalue, true, loader1);
                                         operation.setMessageReciever(
@@ -778,7 +783,7 @@
         } catch (XMLStreamException e) {
             throw new DeploymentException("parser Exception", e);
         } catch (AxisFault e) {
-            throw new DeploymentException("Axis fault , loading module", e);
+            throw new DeploymentException("Axis fault", e);
         }
         return operation;
     }
@@ -872,6 +877,35 @@
                     } else if (OUTFLOWST.equals(ST)) {
                         Flow outFlow = processOutFlow();
                         module.setOutFlow(outFlow);
+                    } else if (OPRATIONST.equals(ST)) {
+                        OperationDescription operation = processOperation();
+                        DeploymentData.getInstance().setOperationPhases(operation);
+                        if (operation.getMessageReciever() == null) {
+                            try {
+                                /**
+                                 * Setting default Message Recive as Message Reciever
+                                 */
+                                ClassLoader loader1 =
+                                        Thread.currentThread().getContextClassLoader();
+                                Class messageReceiver =
+                                        Class.forName(
+                                                "org.apache.axis.receivers.RawXMLINOutMessageRecevier",
+                                                true,
+                                                loader1);
+                                operation.setMessageReciever(
+                                        (MessageReceiver) messageReceiver.newInstance());
+                            } catch (ClassNotFoundException e) {
+                                throw new DeploymentException(
+                                        "Error in loading messageRecivers " + e.getMessage());
+                            } catch (IllegalAccessException e) {
+                                throw new DeploymentException(
+                                        "Error in loading messageRecivers " + e.getMessage());
+                            } catch (InstantiationException e) {
+                                throw new DeploymentException(
+                                        "Error in loading messageRecivers " + e.getMessage());
+                            }
+                        }
+                        module.addOperation(operation);
                     } else {
                         throw new UnsupportedOperationException(
                                 ST + "elment is not allowed in module.xml");

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ModuleDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ModuleDescription.java?rev=190723&r1=190722&r2=190723&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ModuleDescription.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ModuleDescription.java Wed Jun 15 02:57:20 2005
@@ -1,23 +1,24 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * 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
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* 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
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* 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.
+*/
 package org.apache.axis.description;
 
 import org.apache.axis.modules.Module;
 
 import javax.xml.namespace.QName;
+import java.util.HashMap;
 
 /**
  * <p>This holds the information about a Module. </p>
@@ -29,7 +30,7 @@
  * has a module ref="." or avalible to a single service if service.xml have module ref=".."</p>
  */
 public class ModuleDescription implements FlowInclude, ParameterInclude {
-    
+
     private Module module;
     /**
      * Field name
@@ -41,6 +42,9 @@
      */
     private final FlowInclude flowInclude = new FlowIncludeImpl();
 
+    //to store module opeartions , which are suppose to be added to a service if it is engaged to a service
+    private HashMap opeartions ;
+
     /**
      * Field parameters
      */
@@ -50,6 +54,7 @@
      * Constructor ModuleDescription
      */
     public ModuleDescription() {
+        opeartions = new HashMap();
     }
 
     /**
@@ -58,6 +63,7 @@
      * @param name
      */
     public ModuleDescription(QName name) {
+        this();
         this.name = name;
     }
 
@@ -93,7 +99,7 @@
         flowInclude.setFaultInFlow(faultFlow);
     }
 
-     /**
+    /**
      * @param faultFlow
      */
     public void setFaultOutFlow(Flow faultFlow) {
@@ -154,6 +160,14 @@
      */
     public void setModule(Module module) {
         this.module = module;
+    }
+
+    public void addOperation(OperationDescription operation){
+        opeartions.put(operation.getName(),operation);
+    }
+    
+    public HashMap getOperations(){
+        return opeartions;
     }
 
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java?rev=190723&r1=190722&r2=190723&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/ServiceDescription.java Wed Jun 15 02:57:20 2005
@@ -92,6 +92,19 @@
         collectionModule.add(moduleref);
     }
 
+    /**
+     * To add a opeartion to a service if a module requird to do so
+     * @param module
+     */
+    public void addModuleOperations(ModuleDescription module){
+        HashMap map = module.getOperations();
+        Collection col =  map.values();
+        for (Iterator iterator = col.iterator(); iterator.hasNext();) {
+            OperationDescription operation = (OperationDescription) iterator.next();
+            this.addOperation(operation);
+        }
+    }
+
     public void addToEngagModuleList(ModuleDescription moduleName){
         Collection collectionModule = (Collection) this.getComponentProperty(MODULEREF_KEY);
         collectionModule.add(moduleName);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java?rev=190723&r1=190722&r2=190723&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java Wed Jun 15 02:57:20 2005
@@ -320,7 +320,7 @@
             }
         }
     }
-
+    
 
     public void engageModuleGlobally(ModuleDescription module) throws AxisFault {
         enageToGlobalChain(module);
@@ -328,6 +328,7 @@
         Collection serviceCol = services.values();
         for (Iterator iterator = serviceCol.iterator(); iterator.hasNext();) {
             ServiceDescription serviceDescription = (ServiceDescription) iterator.next();
+            serviceDescription.addModuleOperations(module);
             engageModuleToServiceFromGlobal(serviceDescription, module);
             serviceDescription.addToEngagModuleList(module);
         }
@@ -355,7 +356,7 @@
                 }
             }
             if (engaged) {
-               continue;
+                continue;
             }
             Flow flow = null;
             for (int type = 1; type < 5; type++) {
@@ -498,7 +499,7 @@
         boolean engaged = false;
         for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
             OperationDescription opDesc = (OperationDescription) iterator.next();
-           Collection modules =  opDesc.getModules();
+            Collection modules =  opDesc.getModules();
             for (Iterator iterator1 = modules.iterator(); iterator1.hasNext();) {
                 ModuleDescription description = (ModuleDescription) iterator1.next();
                 if(description.getName().equals(module.getName())){
@@ -511,6 +512,7 @@
                 opDesc.addToEngageModuleList(module);
             }
         }
+        service.addModuleOperations(module);
     }
 
 

Modified: webservices/axis/trunk/java/modules/core/test-resources/deployment/module1/META-INF/module.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test-resources/deployment/module1/META-INF/module.xml?rev=190723&r1=190722&r2=190723&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test-resources/deployment/module1/META-INF/module.xml (original)
+++ webservices/axis/trunk/java/modules/core/test-resources/deployment/module1/META-INF/module.xml Wed Jun 15 02:57:20 2005
@@ -25,4 +25,9 @@
              <order phase="userphase1"/>
         </handler>
     </INfaultflow>
+
+    <operation name="creatSeq" mep="MEP_URI_IN_OUT">
+        <messageReceiver class="org.apache.axis.receivers.RawXMLINOutMessageRecevier"/>
+        <parameter name="para1" locked="xsd:true">10</parameter>
+    </operation>
 </module>