axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r289289 [13/134] - in /webservices/axis2/trunk/java: ./ etc/ modules/addressing/ modules/addressing/src/META-INF/ modules/addressing/src/org/apache/axis2/handlers/addressing/ modules/addressing/test-resources/ modules/addressing/test/org/ap...
Date Thu, 15 Sep 2005 19:07:03 GMT
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java Thu Sep 15 11:52:11 2005
@@ -1,372 +1,372 @@
-package org.apache.axis2.deployment;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMFactory;
-import org.apache.axis2.om.OMAbstractFactory;
-import org.apache.axis2.om.OMAttribute;
-import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
-import org.apache.axis2.description.*;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.AxisFault;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.namespace.QName;
-import java.io.InputStream;
-import java.util.Iterator;
-/*
-* 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.
-*
-*
-*/
-
-/**
- * Author: Deepal Jayasinghe
- * Date: Aug 26, 2005
- * Time: 3:12:06 PM
- */
-
-/**
- * To do the common tasks for all *Builder class
- */
-public class DescriptionBuilder implements DeploymentConstants{
-
-    protected Log log = LogFactory.getLog(getClass());
-    protected InputStream serviceInputSteram;
-    protected DeploymentEngine engine;
-
-    public DescriptionBuilder(InputStream serviceInputSteram, DeploymentEngine engine) {
-        this.serviceInputSteram = serviceInputSteram;
-        this.engine = engine;
-    }
-
-    public DescriptionBuilder() {
-    }
-
-    /**
-     * This will creat OMElemnt for a given service.xml
-     *
-     * @return OMElement <code>OMElement</code>
-     * @throws javax.xml.stream.XMLStreamException
-     */
-    public OMElement buildOM() throws XMLStreamException {
-        XMLStreamReader xmlReader =
-                XMLInputFactory.newInstance().createXMLStreamReader(serviceInputSteram);
-        OMFactory fac = OMAbstractFactory.getOMFactory();
-        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(fac, xmlReader);
-        OMElement element = staxOMBuilder.getDocumentElement();
-        element.build();
-        return element;
-    }
-
-
-    /**
-     * To process Flow elements in service.xml
-     * @param flowelement       <code>OMElement</code>
-     * @return
-     * @throws DeploymentException  <code>DeploymentException</code>
-     */
-    protected Flow processFlow(OMElement flowelement, ParameterInclude parent) throws DeploymentException {
-        Flow flow = new FlowImpl();
-        if(flowelement == null){
-            return flow;
-        }
-        Iterator handlers = flowelement.getChildrenWithName(
-                new QName(HANDERST));
-        while (handlers.hasNext()) {
-            OMElement  handlerElement =  (OMElement)handlers.next();
-            flow.addHandler(processHandler(handlerElement,parent));
-        }
-        return flow;
-    }
-
-    /**
-     *  To process Handler element
-     * @param handler_element    <code>OMElement</code>
-     * @return
-     * @throws DeploymentException    <code>DeploymentException</code>
-     */
-    protected HandlerDescription processHandler(OMElement handler_element, ParameterInclude parent)
-            throws DeploymentException {
-        HandlerDescription handler = new HandlerDescription();
-
-        //Setting Handler name
-        OMAttribute name_attribute = handler_element.getAttribute(
-                new QName(ATTNAME));
-        if(name_attribute == null){
-            throw new DeploymentException("Invalid Handler");
-        } else {
-            handler.setName(new QName(name_attribute.getValue()));
-        }
-
-        //Setting Handler Class name
-        OMAttribute class_attribute = handler_element.getAttribute(
-                new QName(CLASSNAME));
-        if(class_attribute == null){
-            throw new DeploymentException("Invalid Handler");
-        } else {
-            handler.setClassName(class_attribute.getValue());
-        }
-
-        //processing phase Rules (order)
-        OMElement order_element = handler_element.getFirstChildWithName(
-                new QName(ORDER));
-        if(order_element == null){
-            throw new DeploymentException("Invaid Handler , phase rule does not specify");
-        } else {
-            Iterator order_itr = order_element.getAttributes();
-            while (order_itr.hasNext()) {
-                OMAttribute orderAttribut = (OMAttribute) order_itr.next();
-                String name  = orderAttribut.getQName().getLocalPart();
-                String value = orderAttribut.getValue();
-                if (AFTER.equals(name)) {
-                    handler.getRules().setAfter(value);
-                } else if (BEFORE.equals(name)) {
-                    handler.getRules().setBefore(value);
-                } else if (PHASE.equals(name)) {
-                    handler.getRules().setPhaseName(value);
-                } else if (PHASEFIRST.equals(name)) {
-                    String boolval = getValue(value);
-                    if (boolval.equals("true")) {
-                        handler.getRules().setPhaseFirst(true);
-                    } else if (boolval.equals("false")) {
-                        handler.getRules().setPhaseFirst(false);
-                    }
-                } else if (PHASELAST.equals(name)) {
-                    String boolval = getValue(value);
-                    if (boolval.equals("true")) {
-                        handler.getRules().setPhaseLast(true);
-                    } else if (boolval.equals("false")) {
-                        handler.getRules().setPhaseLast(false);
-                    }
-                }
-
-            }
-            Iterator paramters = handler_element.getChildrenWithName(
-                    new QName(PARAMETERST));
-            processParameters(paramters,handler,parent);
-        }
-        handler.setParent(parent);
-        return handler;
-    }
-
-
-    /**
-     * To get the list og modules that is requird to be engage globally
-     * @param moduleRefs  <code>java.util.Iterator</code>
-     * @throws DeploymentException   <code>DeploymentException</code>
-     */
-//    protected void processModuleRefs(Iterator moduleRefs) throws DeploymentException {
-//        try {
-//            while (moduleRefs.hasNext()) {
-//                OMElement moduleref = (OMElement) moduleRefs.next();
-//                OMAttribute moduleRefAttribute = moduleref.getAttribute(
-//                        new QName(REF));
-//                if(moduleRefAttribute !=null){
-//                    String refName = moduleRefAttribute.getValue();
-//                    if(engine.getModule(new QName(refName)) == null) {
-//                        throw new DeploymentException(Messages.getMessage(
-//                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
-//                    } else {
-//                        engine.getCurrentFileItem().addModule(new QName(refName));
-//                    }
-//                }
-//            }
-//        }catch (AxisFault axisFault) {
-//            throw   new DeploymentException(axisFault);
-//        }
-//    }
-
-
-    /**
-     * To get the Paramter object out from the OM
-     * @param paramters <code>Parameter</code>
-     * @param parameterInclude <code>ParameterInclude</code>
-     * @param parent <code>ParameterInclude</code>
-     */
-    protected void processParameters(Iterator paramters, ParameterInclude parameterInclude,
-                                     ParameterInclude parent )
-            throws DeploymentException {
-        while (paramters.hasNext()) {
-            //this is to check whether some one has locked the parmter at the top level
-            OMElement paramterElement = (OMElement) paramters.next();
-
-            Parameter paramter = new ParameterImpl();
-            //setting paramterElement
-            paramter.setParameterElement(paramterElement);
-
-            //setting paramter Name
-            OMAttribute paraName = paramterElement.getAttribute(
-                    new QName(ATTNAME));
-            if(paraName == null ){
-                throw new DeploymentException(
-                        Messages.getMessage(DeploymentErrorMsgs.BAD_PARA_ARGU));
-            }
-            paramter.setName(paraName.getValue());
-
-            //setting paramter Value (the chiled elemnt of the paramter)
-            OMElement paraValue = paramterElement.getFirstElement();
-            if(paraValue !=null){
-                paramter.setValue(paramterElement);
-                paramter.setParamterType(Parameter.DOM_PARAMETER);
-            } else {
-                String paratestValue = paramterElement.getText();
-                paramter.setValue(paratestValue);
-                paramter.setParamterType(Parameter.TEXT_PARAMETER);
-            }
-
-            //setting locking attribute
-            OMAttribute paraLocked = paramterElement.getAttribute(
-                    new QName(ATTLOCKED));
-            if (paraLocked !=null) {
-                String lockedValue = paraLocked.getValue();
-                if("true".equals(lockedValue)){
-                    //if the parameter is locked at some levle paramer value replace by that
-                    if(parent.isParamterLocked(paramter.getName())){
-                        throw new DeploymentException("The paramter " + paramter.getName() + " has" +
-                                " locked at top levle can not overide");
-                    } else{
-                        paramter.setLocked(true);
-                    }
-
-                } else {
-                    paramter.setLocked(false);
-                }
-            }
-            try {
-                parameterInclude.addParameter(paramter);
-            } catch (AxisFault axisFault) {
-                throw new DeploymentException(axisFault);
-            }
-        }
-    }
-
-
-    protected void processOpeasrtionModuleRefs(Iterator moduleRefs
-            , OperationDescription opeartion) throws DeploymentException {
-        try {
-            while (moduleRefs.hasNext()) {
-                OMElement moduleref = (OMElement) moduleRefs.next();
-                OMAttribute moduleRefAttribute = moduleref.getAttribute(
-                        new QName(REF));
-                if (moduleRefAttribute !=null) {
-                    String refName = moduleRefAttribute.getValue();
-                    if(engine.getModule(new QName(refName)) == null) {
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
-                    } else {
-                        opeartion.addModule(new QName(refName));
-                    }
-                }
-            }
-        }catch (AxisFault axisFault) {
-            throw   new DeploymentException("Porcessing Operations Modules" + axisFault);
-        }
-    }
-
-    protected MessageReceiver loadMessageReceiver(ClassLoader loader , OMElement reciverElement)
-            throws DeploymentException {
-        OMAttribute recieverName = reciverElement.getAttribute(
-                new QName(CLASSNAME));
-        String className = recieverName.getValue();
-        MessageReceiver receiver = null;
-        try{
-            Class messageReceiver ;
-            if (className != null &&!"".equals(className)) {
-                messageReceiver = Class.forName(className,true,loader);
-                receiver = (MessageReceiver) messageReceiver.newInstance();
-            }
-        } catch (ClassNotFoundException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,"ClassNotFoundException", className));
-        } catch (IllegalAccessException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,"IllegalAccessException", className));
-        } catch (InstantiationException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,"InstantiationException", className));
-        }
-        return receiver;
-    }
-
-    protected MessageReceiver loadDefaultMessageReciver() throws DeploymentException {
-        MessageReceiver receiver;
-        String defaultMessageReciver ="org.apache.axis2.receivers.RawXMLINOutMessageReceiver";
-        try {
-            /**
-             * Setting default Message Recive as Message Receiver
-             */
-            ClassLoader loader1 = Thread.currentThread()
-                    .getContextClassLoader();
-            Class messageReceiver =
-                    Class.forName(defaultMessageReciver,true,loader1);
-            receiver = ((MessageReceiver) messageReceiver.newInstance());
-        } catch (ClassNotFoundException e) {
-            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "ClassNotFoundException",defaultMessageReciver));
-        } catch (IllegalAccessException e) {
-            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "IllegalAccessException",defaultMessageReciver));
-        } catch (InstantiationException e) {
-            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "InstantiationException",defaultMessageReciver));
-        }
-        return receiver;
-    }
-
-
-    /**
-     * This method is used to retrive service name form the arechive file name
-     * if the archive file name is service1.aar , then axis service name would be service1
-     *
-     * @param fileName
-     * @return String
-     */
-    public static String getShortFileName(String fileName) {
-        char seperator = '.';
-        String value;
-        int index = fileName.lastIndexOf(seperator);
-        if (index > 0) {
-            value = fileName.substring(0, index);
-            return value;
-        }
-        return fileName;
-    }
-
-
-    /**
-     * this method is to get the value of attribue
-     * eg xsd:anyVal --> anyVal
-     *
-     * @return String
-     */
-    protected String getValue(String in) {
-        char seperator = ':';
-        String value ;
-        int index = in.indexOf(seperator);
-        if (index > 0) {
-            value = in.substring(index + 1, in.length());
-            return value;
-        }
-        return in;
-    }
-
-
-
-}
+package org.apache.axis2.deployment;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMFactory;
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
+import org.apache.axis2.description.*;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.AxisFault;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.namespace.QName;
+import java.io.InputStream;
+import java.util.Iterator;
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author: Deepal Jayasinghe
+ * Date: Aug 26, 2005
+ * Time: 3:12:06 PM
+ */
+
+/**
+ * To do the common tasks for all *Builder class
+ */
+public class DescriptionBuilder implements DeploymentConstants{
+
+    protected Log log = LogFactory.getLog(getClass());
+    protected InputStream serviceInputSteram;
+    protected DeploymentEngine engine;
+
+    public DescriptionBuilder(InputStream serviceInputSteram, DeploymentEngine engine) {
+        this.serviceInputSteram = serviceInputSteram;
+        this.engine = engine;
+    }
+
+    public DescriptionBuilder() {
+    }
+
+    /**
+     * This will creat OMElemnt for a given service.xml
+     *
+     * @return OMElement <code>OMElement</code>
+     * @throws javax.xml.stream.XMLStreamException
+     */
+    public OMElement buildOM() throws XMLStreamException {
+        XMLStreamReader xmlReader =
+                XMLInputFactory.newInstance().createXMLStreamReader(serviceInputSteram);
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(fac, xmlReader);
+        OMElement element = staxOMBuilder.getDocumentElement();
+        element.build();
+        return element;
+    }
+
+
+    /**
+     * To process Flow elements in service.xml
+     * @param flowelement       <code>OMElement</code>
+     * @return
+     * @throws DeploymentException  <code>DeploymentException</code>
+     */
+    protected Flow processFlow(OMElement flowelement, ParameterInclude parent) throws DeploymentException {
+        Flow flow = new FlowImpl();
+        if(flowelement == null){
+            return flow;
+        }
+        Iterator handlers = flowelement.getChildrenWithName(
+                new QName(HANDERST));
+        while (handlers.hasNext()) {
+            OMElement  handlerElement =  (OMElement)handlers.next();
+            flow.addHandler(processHandler(handlerElement,parent));
+        }
+        return flow;
+    }
+
+    /**
+     *  To process Handler element
+     * @param handler_element    <code>OMElement</code>
+     * @return
+     * @throws DeploymentException    <code>DeploymentException</code>
+     */
+    protected HandlerDescription processHandler(OMElement handler_element, ParameterInclude parent)
+            throws DeploymentException {
+        HandlerDescription handler = new HandlerDescription();
+
+        //Setting Handler name
+        OMAttribute name_attribute = handler_element.getAttribute(
+                new QName(ATTNAME));
+        if(name_attribute == null){
+            throw new DeploymentException("Invalid Handler");
+        } else {
+            handler.setName(new QName(name_attribute.getValue()));
+        }
+
+        //Setting Handler Class name
+        OMAttribute class_attribute = handler_element.getAttribute(
+                new QName(CLASSNAME));
+        if(class_attribute == null){
+            throw new DeploymentException("Invalid Handler");
+        } else {
+            handler.setClassName(class_attribute.getValue());
+        }
+
+        //processing phase Rules (order)
+        OMElement order_element = handler_element.getFirstChildWithName(
+                new QName(ORDER));
+        if(order_element == null){
+            throw new DeploymentException("Invaid Handler , phase rule does not specify");
+        } else {
+            Iterator order_itr = order_element.getAttributes();
+            while (order_itr.hasNext()) {
+                OMAttribute orderAttribut = (OMAttribute) order_itr.next();
+                String name  = orderAttribut.getQName().getLocalPart();
+                String value = orderAttribut.getValue();
+                if (AFTER.equals(name)) {
+                    handler.getRules().setAfter(value);
+                } else if (BEFORE.equals(name)) {
+                    handler.getRules().setBefore(value);
+                } else if (PHASE.equals(name)) {
+                    handler.getRules().setPhaseName(value);
+                } else if (PHASEFIRST.equals(name)) {
+                    String boolval = getValue(value);
+                    if (boolval.equals("true")) {
+                        handler.getRules().setPhaseFirst(true);
+                    } else if (boolval.equals("false")) {
+                        handler.getRules().setPhaseFirst(false);
+                    }
+                } else if (PHASELAST.equals(name)) {
+                    String boolval = getValue(value);
+                    if (boolval.equals("true")) {
+                        handler.getRules().setPhaseLast(true);
+                    } else if (boolval.equals("false")) {
+                        handler.getRules().setPhaseLast(false);
+                    }
+                }
+
+            }
+            Iterator paramters = handler_element.getChildrenWithName(
+                    new QName(PARAMETERST));
+            processParameters(paramters,handler,parent);
+        }
+        handler.setParent(parent);
+        return handler;
+    }
+
+
+    /**
+     * To get the list og modules that is requird to be engage globally
+     * @param moduleRefs  <code>java.util.Iterator</code>
+     * @throws DeploymentException   <code>DeploymentException</code>
+     */
+//    protected void processModuleRefs(Iterator moduleRefs) throws DeploymentException {
+//        try {
+//            while (moduleRefs.hasNext()) {
+//                OMElement moduleref = (OMElement) moduleRefs.next();
+//                OMAttribute moduleRefAttribute = moduleref.getAttribute(
+//                        new QName(REF));
+//                if(moduleRefAttribute !=null){
+//                    String refName = moduleRefAttribute.getValue();
+//                    if(engine.getModule(new QName(refName)) == null) {
+//                        throw new DeploymentException(Messages.getMessage(
+//                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
+//                    } else {
+//                        engine.getCurrentFileItem().addModule(new QName(refName));
+//                    }
+//                }
+//            }
+//        }catch (AxisFault axisFault) {
+//            throw   new DeploymentException(axisFault);
+//        }
+//    }
+
+
+    /**
+     * To get the Paramter object out from the OM
+     * @param paramters <code>Parameter</code>
+     * @param parameterInclude <code>ParameterInclude</code>
+     * @param parent <code>ParameterInclude</code>
+     */
+    protected void processParameters(Iterator paramters, ParameterInclude parameterInclude,
+                                     ParameterInclude parent )
+            throws DeploymentException {
+        while (paramters.hasNext()) {
+            //this is to check whether some one has locked the parmter at the top level
+            OMElement paramterElement = (OMElement) paramters.next();
+
+            Parameter paramter = new ParameterImpl();
+            //setting paramterElement
+            paramter.setParameterElement(paramterElement);
+
+            //setting paramter Name
+            OMAttribute paraName = paramterElement.getAttribute(
+                    new QName(ATTNAME));
+            if(paraName == null ){
+                throw new DeploymentException(
+                        Messages.getMessage(DeploymentErrorMsgs.BAD_PARA_ARGU));
+            }
+            paramter.setName(paraName.getValue());
+
+            //setting paramter Value (the chiled elemnt of the paramter)
+            OMElement paraValue = paramterElement.getFirstElement();
+            if(paraValue !=null){
+                paramter.setValue(paramterElement);
+                paramter.setParamterType(Parameter.DOM_PARAMETER);
+            } else {
+                String paratestValue = paramterElement.getText();
+                paramter.setValue(paratestValue);
+                paramter.setParamterType(Parameter.TEXT_PARAMETER);
+            }
+
+            //setting locking attribute
+            OMAttribute paraLocked = paramterElement.getAttribute(
+                    new QName(ATTLOCKED));
+            if (paraLocked !=null) {
+                String lockedValue = paraLocked.getValue();
+                if("true".equals(lockedValue)){
+                    //if the parameter is locked at some levle paramer value replace by that
+                    if(parent.isParamterLocked(paramter.getName())){
+                        throw new DeploymentException("The paramter " + paramter.getName() + " has" +
+                                " locked at top levle can not overide");
+                    } else{
+                        paramter.setLocked(true);
+                    }
+
+                } else {
+                    paramter.setLocked(false);
+                }
+            }
+            try {
+                parameterInclude.addParameter(paramter);
+            } catch (AxisFault axisFault) {
+                throw new DeploymentException(axisFault);
+            }
+        }
+    }
+
+
+    protected void processOpeasrtionModuleRefs(Iterator moduleRefs
+            , OperationDescription opeartion) throws DeploymentException {
+        try {
+            while (moduleRefs.hasNext()) {
+                OMElement moduleref = (OMElement) moduleRefs.next();
+                OMAttribute moduleRefAttribute = moduleref.getAttribute(
+                        new QName(REF));
+                if (moduleRefAttribute !=null) {
+                    String refName = moduleRefAttribute.getValue();
+                    if(engine.getModule(new QName(refName)) == null) {
+                        throw new DeploymentException(Messages.getMessage(
+                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
+                    } else {
+                        opeartion.addModule(new QName(refName));
+                    }
+                }
+            }
+        }catch (AxisFault axisFault) {
+            throw   new DeploymentException("Porcessing Operations Modules" + axisFault);
+        }
+    }
+
+    protected MessageReceiver loadMessageReceiver(ClassLoader loader , OMElement reciverElement)
+            throws DeploymentException {
+        OMAttribute recieverName = reciverElement.getAttribute(
+                new QName(CLASSNAME));
+        String className = recieverName.getValue();
+        MessageReceiver receiver = null;
+        try{
+            Class messageReceiver ;
+            if (className != null &&!"".equals(className)) {
+                messageReceiver = Class.forName(className,true,loader);
+                receiver = (MessageReceiver) messageReceiver.newInstance();
+            }
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException(Messages.getMessage(
+                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,"ClassNotFoundException", className));
+        } catch (IllegalAccessException e) {
+            throw new DeploymentException(Messages.getMessage(
+                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,"IllegalAccessException", className));
+        } catch (InstantiationException e) {
+            throw new DeploymentException(Messages.getMessage(
+                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,"InstantiationException", className));
+        }
+        return receiver;
+    }
+
+    protected MessageReceiver loadDefaultMessageReciver() throws DeploymentException {
+        MessageReceiver receiver;
+        String defaultMessageReciver ="org.apache.axis2.receivers.RawXMLINOutMessageReceiver";
+        try {
+            /**
+             * Setting default Message Recive as Message Receiver
+             */
+            ClassLoader loader1 = Thread.currentThread()
+                    .getContextClassLoader();
+            Class messageReceiver =
+                    Class.forName(defaultMessageReciver,true,loader1);
+            receiver = ((MessageReceiver) messageReceiver.newInstance());
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
+                    "ClassNotFoundException",defaultMessageReciver));
+        } catch (IllegalAccessException e) {
+            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
+                    "IllegalAccessException",defaultMessageReciver));
+        } catch (InstantiationException e) {
+            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
+                    "InstantiationException",defaultMessageReciver));
+        }
+        return receiver;
+    }
+
+
+    /**
+     * This method is used to retrive service name form the arechive file name
+     * if the archive file name is service1.aar , then axis service name would be service1
+     *
+     * @param fileName
+     * @return String
+     */
+    public static String getShortFileName(String fileName) {
+        char seperator = '.';
+        String value;
+        int index = fileName.lastIndexOf(seperator);
+        if (index > 0) {
+            value = fileName.substring(0, index);
+            return value;
+        }
+        return fileName;
+    }
+
+
+    /**
+     * this method is to get the value of attribue
+     * eg xsd:anyVal --> anyVal
+     *
+     * @return String
+     */
+    protected String getValue(String in) {
+        char seperator = ':';
+        String value ;
+        int index = in.indexOf(seperator);
+        if (index > 0) {
+            value = in.substring(index + 1, in.length());
+            return value;
+        }
+        return in;
+    }
+
+
+
+}

Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java Thu Sep 15 11:52:11 2005
@@ -1,194 +1,194 @@
-package org.apache.axis2.deployment;
-
-import org.apache.axis2.description.ModuleDescription;
-import org.apache.axis2.description.OperationDescription;
-import org.apache.axis2.om.OMAttribute;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.deployment.util.PhasesInfo;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.ArrayList;
-/*
-* 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.
-*
-*
-*/
-
-/**
- * Author: Deepal Jayasinghe
- * Date: Aug 26, 2005
- * Time: 1:05:49 PM
- */
-
-/**
- * This class is to convert OM->ServiceDescrption , where first create OM from service.xml and
- * then populate service description by using OM
- */
-public class ModuleBuilder extends DescriptionBuilder{
-
-
-
-    private ModuleDescription module;
-
-
-    public ModuleBuilder(InputStream serviceInputSteram, DeploymentEngine engine
-            ,ModuleDescription module) {
-        super(serviceInputSteram, engine);
-        this.module = module;
-    }
-
-
-    public void populateModule() throws DeploymentException {
-        try {
-            OMElement moduleElement = buildOM();
-
-            // Setting Module Name
-            OMAttribute moduleNameAtt = moduleElement.getAttribute(
-                    new QName(ATTNAME));
-            if(moduleNameAtt != null){
-                String moduleName = moduleNameAtt.getValue();
-                if (moduleName != null && !"".equals(moduleName)) {
-                    module.setName(new QName(moduleName));
-                } else {
-                    module.setName(new QName(getShortFileName(engine.getCurrentFileItem()
-                            .getServiceName())));
-                }
-            }else {
-                module.setName(new QName(getShortFileName(engine.getCurrentFileItem()
-                        .getServiceName())));
-            }
-
-            // Setting Module Class , if it is there
-            OMAttribute moduleClassAtt = moduleElement.getAttribute(
-                    new QName(CLASSNAME));
-            if(moduleClassAtt !=null){
-                String moduleClass = moduleClassAtt.getValue();
-                if(moduleClass !=null && !"".equals(moduleClass)){
-                    if (engine !=null) {
-                        engine.getCurrentFileItem().setModuleClass(moduleClass);
-                    }
-                }
-            }
-
-            //processing Paramters
-            //Processing service level paramters
-            Iterator itr = moduleElement.getChildrenWithName(
-                    new QName(PARAMETERST));
-            processParameters(itr,module,module.getParent());
-
-            //process INFLOW
-            OMElement inFlow = moduleElement.getFirstChildWithName(
-                    new QName(INFLOWST));
-            if(inFlow !=null){
-                module.setInFlow(processFlow(inFlow,module));
-            }
-
-            OMElement outFlow = moduleElement.getFirstChildWithName(
-                    new QName(OUTFLOWST));
-            if(outFlow !=null){
-                module.setOutFlow(processFlow(outFlow,module));
-            }
-
-            OMElement inFaultFlow = moduleElement.getFirstChildWithName(
-                    new QName(IN_FAILTFLOW));
-            if(inFaultFlow !=null){
-                module.setFaultInFlow(processFlow(inFaultFlow,module));
-            }
-
-            OMElement outFaultFlow = moduleElement.getFirstChildWithName(
-                    new QName(OUT_FAILTFLOW));
-            if(outFaultFlow !=null){
-                module.setFaultOutFlow(processFlow(outFaultFlow,module));
-            }
-
-            //processing Operations
-            Iterator op_itr = moduleElement.getChildrenWithName(new QName(OPRATIONST));
-            ArrayList opeartions = processOpeartions(op_itr);
-            for (int i = 0; i < opeartions.size(); i++) {
-                OperationDescription opeartion = (OperationDescription) opeartions.get(i);
-                module.addOperation(opeartion);
-            }
-
-
-        } catch (XMLStreamException e) {
-            throw new DeploymentException(e);
-
-        }
-    }
-
-
-    private ArrayList processOpeartions(Iterator opeartinsItr) throws DeploymentException {
-        ArrayList operations = new ArrayList();
-        while (opeartinsItr.hasNext()) {
-            OMElement operation = (OMElement) opeartinsItr.next();
-
-            // /getting opeartion name
-            OMAttribute op_name_att = operation.getAttribute(
-                    new QName(ATTNAME));
-            if(op_name_att == null){
-                throw new DeploymentException(Messages.getMessage("Invalide Operations"));
-            }
-            String opname = op_name_att.getValue();
-            OperationDescription op_descrip = new OperationDescription();
-            op_descrip.setName(new QName(opname));
-
-            //Opeartion Paramters
-            Iterator paramters = operation.getChildrenWithName(
-                    new QName(PARAMETERST));
-            processParameters(paramters,op_descrip,module);
-
-
-            //setting the mep of the operation
-            OMAttribute op_mep_att = operation.getAttribute(
-                    new QName(MEP));
-            if(op_mep_att !=null){
-                String mep = op_mep_att.getValue();
-                op_descrip.setMessageExchangePattern(mep);
-            }
-
-            // loading the message recivers
-            OMElement receiverElement = operation.getFirstChildWithName(
-                    new QName(MESSAGERECEIVER));
-            if(receiverElement !=null){
-                MessageReceiver messageReceiver = loadMessageReceiver(
-                        engine.getCurrentFileItem().getClassLoader(),receiverElement);
-                op_descrip.setMessageReceiver(messageReceiver);
-            }  else {
-                //setting default message reciver
-                MessageReceiver msgReceiver = loadDefaultMessageReciver();
-                op_descrip.setMessageReceiver(msgReceiver);
-            }
-            //Process Module Refs
-            Iterator modules = operation.getChildrenWithName(
-                    new QName(MODULEST));
-            processOpeasrtionModuleRefs(modules, op_descrip);
-
-            //setting Operation phase
-            PhasesInfo info = engine.getPhasesinfo();
-            info.setOperationPhases(op_descrip);
-
-            //adding the opeartion
-            operations.add(op_descrip);
-        }
-        return operations;
-    }
-
-
-}
+package org.apache.axis2.deployment;
+
+import org.apache.axis2.description.ModuleDescription;
+import org.apache.axis2.description.OperationDescription;
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.deployment.util.PhasesInfo;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.ArrayList;
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author: Deepal Jayasinghe
+ * Date: Aug 26, 2005
+ * Time: 1:05:49 PM
+ */
+
+/**
+ * This class is to convert OM->ServiceDescrption , where first create OM from service.xml and
+ * then populate service description by using OM
+ */
+public class ModuleBuilder extends DescriptionBuilder{
+
+
+
+    private ModuleDescription module;
+
+
+    public ModuleBuilder(InputStream serviceInputSteram, DeploymentEngine engine
+            ,ModuleDescription module) {
+        super(serviceInputSteram, engine);
+        this.module = module;
+    }
+
+
+    public void populateModule() throws DeploymentException {
+        try {
+            OMElement moduleElement = buildOM();
+
+            // Setting Module Name
+            OMAttribute moduleNameAtt = moduleElement.getAttribute(
+                    new QName(ATTNAME));
+            if(moduleNameAtt != null){
+                String moduleName = moduleNameAtt.getValue();
+                if (moduleName != null && !"".equals(moduleName)) {
+                    module.setName(new QName(moduleName));
+                } else {
+                    module.setName(new QName(getShortFileName(engine.getCurrentFileItem()
+                            .getServiceName())));
+                }
+            }else {
+                module.setName(new QName(getShortFileName(engine.getCurrentFileItem()
+                        .getServiceName())));
+            }
+
+            // Setting Module Class , if it is there
+            OMAttribute moduleClassAtt = moduleElement.getAttribute(
+                    new QName(CLASSNAME));
+            if(moduleClassAtt !=null){
+                String moduleClass = moduleClassAtt.getValue();
+                if(moduleClass !=null && !"".equals(moduleClass)){
+                    if (engine !=null) {
+                        engine.getCurrentFileItem().setModuleClass(moduleClass);
+                    }
+                }
+            }
+
+            //processing Paramters
+            //Processing service level paramters
+            Iterator itr = moduleElement.getChildrenWithName(
+                    new QName(PARAMETERST));
+            processParameters(itr,module,module.getParent());
+
+            //process INFLOW
+            OMElement inFlow = moduleElement.getFirstChildWithName(
+                    new QName(INFLOWST));
+            if(inFlow !=null){
+                module.setInFlow(processFlow(inFlow,module));
+            }
+
+            OMElement outFlow = moduleElement.getFirstChildWithName(
+                    new QName(OUTFLOWST));
+            if(outFlow !=null){
+                module.setOutFlow(processFlow(outFlow,module));
+            }
+
+            OMElement inFaultFlow = moduleElement.getFirstChildWithName(
+                    new QName(IN_FAILTFLOW));
+            if(inFaultFlow !=null){
+                module.setFaultInFlow(processFlow(inFaultFlow,module));
+            }
+
+            OMElement outFaultFlow = moduleElement.getFirstChildWithName(
+                    new QName(OUT_FAILTFLOW));
+            if(outFaultFlow !=null){
+                module.setFaultOutFlow(processFlow(outFaultFlow,module));
+            }
+
+            //processing Operations
+            Iterator op_itr = moduleElement.getChildrenWithName(new QName(OPRATIONST));
+            ArrayList opeartions = processOpeartions(op_itr);
+            for (int i = 0; i < opeartions.size(); i++) {
+                OperationDescription opeartion = (OperationDescription) opeartions.get(i);
+                module.addOperation(opeartion);
+            }
+
+
+        } catch (XMLStreamException e) {
+            throw new DeploymentException(e);
+
+        }
+    }
+
+
+    private ArrayList processOpeartions(Iterator opeartinsItr) throws DeploymentException {
+        ArrayList operations = new ArrayList();
+        while (opeartinsItr.hasNext()) {
+            OMElement operation = (OMElement) opeartinsItr.next();
+
+            // /getting opeartion name
+            OMAttribute op_name_att = operation.getAttribute(
+                    new QName(ATTNAME));
+            if(op_name_att == null){
+                throw new DeploymentException(Messages.getMessage("Invalide Operations"));
+            }
+            String opname = op_name_att.getValue();
+            OperationDescription op_descrip = new OperationDescription();
+            op_descrip.setName(new QName(opname));
+
+            //Opeartion Paramters
+            Iterator paramters = operation.getChildrenWithName(
+                    new QName(PARAMETERST));
+            processParameters(paramters,op_descrip,module);
+
+
+            //setting the mep of the operation
+            OMAttribute op_mep_att = operation.getAttribute(
+                    new QName(MEP));
+            if(op_mep_att !=null){
+                String mep = op_mep_att.getValue();
+                op_descrip.setMessageExchangePattern(mep);
+            }
+
+            // loading the message recivers
+            OMElement receiverElement = operation.getFirstChildWithName(
+                    new QName(MESSAGERECEIVER));
+            if(receiverElement !=null){
+                MessageReceiver messageReceiver = loadMessageReceiver(
+                        engine.getCurrentFileItem().getClassLoader(),receiverElement);
+                op_descrip.setMessageReceiver(messageReceiver);
+            }  else {
+                //setting default message reciver
+                MessageReceiver msgReceiver = loadDefaultMessageReciver();
+                op_descrip.setMessageReceiver(msgReceiver);
+            }
+            //Process Module Refs
+            Iterator modules = operation.getChildrenWithName(
+                    new QName(MODULEST));
+            processOpeasrtionModuleRefs(modules, op_descrip);
+
+            //setting Operation phase
+            PhasesInfo info = engine.getPhasesinfo();
+            info.setOperationPhases(op_descrip);
+
+            //adding the opeartion
+            operations.add(op_descrip);
+        }
+        return operations;
+    }
+
+
+}

Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java Thu Sep 15 11:52:11 2005
@@ -1,283 +1,283 @@
-package org.apache.axis2.deployment;
-
-import org.apache.axis2.deployment.util.PhasesInfo;
-import org.apache.axis2.description.*;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.om.OMAttribute;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.impl.OMOutputImpl;
-import org.apache.axis2.Constants;
-import org.apache.axis2.AxisFault;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-/*
-* 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.
-*
-*
-*/
-
-/**
- * Author: Deepal Jayasinghe
- * Date: Aug 24, 2005
- * Time: 11:21:02 PM
- */
-
-
-/**
- * This class is to convert OM->ServiceDescrption , where first create OM from service.xml and
- * then populate service description by using OM
- */
-
-
-public class ServiceBuilder extends DescriptionBuilder{
-
-    private ServiceDescription service;
-
-    public ServiceBuilder(InputStream serviceInputSteram,
-                          DeploymentEngine engine,ServiceDescription service) {
-        super(serviceInputSteram, engine);
-        this.service = service;
-    }
-
-    public ServiceBuilder(DeploymentEngine engine,ServiceDescription service) {
-        this.service = service;
-        super.engine = engine;
-    }
-
-    /**
-     * top most method that used to populate service from corresponding OM
-     */
-    public void populateService(OMElement service_element) throws DeploymentException {
-        try {
-
-            //Processing service level paramters
-            Iterator itr = service_element.getChildrenWithName(
-                    new QName(PARAMETERST));
-            processParameters(itr,service,service.getParent());
-
-            //process service description
-            OMElement descriptionElement = service_element.getFirstChildWithName(
-                    new QName(DESCRIPTION));
-            if (descriptionElement !=null) {
-                OMElement descriptionValue = descriptionElement.getFirstElement();
-                if(descriptionValue !=null){
-                    StringWriter writer = new StringWriter();
-                    descriptionValue.build();
-                    descriptionValue.serializeWithCache(new
-                            OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
-                    writer.flush();
-                    service.setServiceDescription(writer.toString());
-                } else {
-                    service.setServiceDescription(descriptionElement.getText());
-                }
-            }
-
-            //processing servicewide modules which required to engage gloabbly
-            Iterator moduleRefs = service_element.getChildrenWithName(
-                    new QName(MODULEST));
-            processModuleRefs(moduleRefs);
-
-            //process INFLOW
-            OMElement inFlow = service_element.getFirstChildWithName(
-                    new QName(INFLOWST));
-            if(inFlow !=null){
-                service.setInFlow(processFlow(inFlow,service));
-            }
-
-            OMElement outFlow = service_element.getFirstChildWithName(
-                    new QName(OUTFLOWST));
-            if(outFlow !=null){
-                service.setOutFlow(processFlow(outFlow,service));
-            }
-
-            OMElement inFaultFlow = service_element.getFirstChildWithName(
-                    new QName(IN_FAILTFLOW));
-            if(inFaultFlow !=null){
-                service.setFaultInFlow(processFlow(inFaultFlow,service));
-            }
-
-            OMElement outFaultFlow = service_element.getFirstChildWithName(
-                    new QName(OUT_FAILTFLOW));
-            if(outFaultFlow !=null){
-                service.setFaultOutFlow(processFlow(outFaultFlow,service));
-            }
-
-            //processing operations
-            Iterator opeartinsItr = service_element.getChildrenWithName(
-                    new QName(OPRATIONST));
-            ArrayList ops = processOpeartions(opeartinsItr);
-            for (int i = 0; i < ops.size(); i++) {
-                OperationDescription opeartionDesc = (OperationDescription) ops.get(i);
-                ArrayList paramters = opeartionDesc.getParameters();
-
-                // Adding wsa-maping into service
-                for (int j = 0; j < paramters.size(); j++) {
-                    Parameter parameter = (Parameter) paramters.get(j);
-                    if(parameter.getName().equals(Constants.WSA_ACTION)){
-                        service.addMapping((String)parameter.getValue(),opeartionDesc);
-                    }
-                }
-                service.addOperation(opeartionDesc);
-            }
-
-            Iterator moduleConfigs = service_element.getChildrenWithName(new QName(MODULECONFIG));
-            processServiceModuleConfig(moduleConfigs,service,service);
-
-
-        } catch (XMLStreamException e) {
-            throw new DeploymentException(e);
-        }
-    }
-
-    private ArrayList processOpeartions(Iterator opeartinsItr) throws DeploymentException {
-        ArrayList operations = new ArrayList();
-        while (opeartinsItr.hasNext()) {
-            OMElement operation = (OMElement) opeartinsItr.next();
-
-            // /getting opeartion name
-            OMAttribute op_name_att = operation.getAttribute(
-                    new QName(ATTNAME));
-            if(op_name_att == null){
-                throw new DeploymentException(Messages.getMessage("Invalide Operations"));
-            }
-            String opname = op_name_att.getValue();
-            OperationDescription op_descrip = service.getOperation(new QName(opname));
-            if(op_descrip == null){
-                op_descrip = new OperationDescription();
-                op_descrip.setName(new QName(opname));
-                log.info(Messages.getMessage(DeploymentErrorMsgs.OP_NOT_FOUN_IN_WSDL, opname));
-            }
-
-            //setting the mep of the operation
-            OMAttribute op_mep_att = operation.getAttribute(
-                    new QName(MEP));
-            if(op_mep_att !=null){
-                String mep = op_mep_att.getValue();
-                op_descrip.setMessageExchangePattern(mep);
-            }
-
-            //Opeartion Paramters
-            Iterator paramters = operation.getChildrenWithName(
-                    new QName(PARAMETERST));
-            processParameters(paramters,op_descrip,service);
-
-            // loading the message recivers
-            OMElement receiverElement = operation.getFirstChildWithName(
-                    new QName(MESSAGERECEIVER));
-            if(receiverElement !=null){
-                MessageReceiver messageReceiver = loadMessageReceiver(
-                        service.getClassLoader(),receiverElement);
-                op_descrip.setMessageReceiver(messageReceiver);
-            }  else {
-                //setting default message reciver
-                MessageReceiver msgReceiver = loadDefaultMessageReciver();
-                op_descrip.setMessageReceiver(msgReceiver);
-            }
-
-            //Process Module Refs
-            Iterator modules = operation.getChildrenWithName(
-                    new QName(MODULEST));
-            processOpeasrtionModuleRefs(modules, op_descrip);
-
-            //setting Operation phase
-            if (engine !=null) {
-                PhasesInfo info = engine.getPhasesinfo();
-                info.setOperationPhases(op_descrip);
-            }
-
-            Iterator moduleConfigs = operation.getChildrenWithName(new QName(MODULECONFIG));
-            processOperationModuleConfig(moduleConfigs,op_descrip,op_descrip);
-
-            //adding the opeartion
-            operations.add(op_descrip);
-        }
-        return operations;
-    }
-
-
-    protected void processServiceModuleConfig(Iterator moduleConfigs ,
-                                              ParameterInclude parent, ServiceDescription service)
-            throws DeploymentException {
-        while (moduleConfigs.hasNext()) {
-            OMElement moduleConfig = (OMElement) moduleConfigs.next();
-            OMAttribute moduleName_att = moduleConfig.getAttribute(
-                    new QName(ATTNAME));
-            if(moduleName_att == null){
-                throw new DeploymentException("Invalid module configuration");
-            } else {
-                String module = moduleName_att.getValue();
-                ModuleConfiguration moduleConfiguration =
-                        new ModuleConfiguration(new QName(module),parent);
-                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
-                processParameters(paramters,moduleConfiguration,parent);
-                service.addModuleConfig(moduleConfiguration);
-            }
-        }
-    }
-
-    protected void processOperationModuleConfig(Iterator moduleConfigs ,
-                                                ParameterInclude parent, OperationDescription opeartion)
-            throws DeploymentException {
-        while (moduleConfigs.hasNext()) {
-            OMElement moduleConfig = (OMElement) moduleConfigs.next();
-            OMAttribute moduleName_att = moduleConfig.getAttribute(
-                    new QName(ATTNAME));
-            if(moduleName_att == null){
-                throw new DeploymentException("Invalid module configuration");
-            } else {
-                String module = moduleName_att.getValue();
-                ModuleConfiguration moduleConfiguration =
-                        new ModuleConfiguration(new QName(module),parent);
-                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
-                processParameters(paramters,moduleConfiguration,parent);
-                opeartion.addModuleConfig(moduleConfiguration);
-            }
-        }
-    }
-
-    /**
-     * To get the list og modules that is requird to be engage globally
-     * @param moduleRefs  <code>java.util.Iterator</code>
-     * @throws DeploymentException   <code>DeploymentException</code>
-     */
-    protected void processModuleRefs(Iterator moduleRefs) throws DeploymentException {
-        try {
-            while (moduleRefs.hasNext()) {
-                OMElement moduleref = (OMElement) moduleRefs.next();
-                OMAttribute moduleRefAttribute = moduleref.getAttribute(
-                        new QName(REF));
-                if(moduleRefAttribute !=null){
-                    String refName = moduleRefAttribute.getValue();
-                    if(engine.getModule(new QName(refName)) == null) {
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
-                    } else {
-                        service.addModuleref(new QName(refName));
-                    }
-                }
-            }
-        }catch (AxisFault axisFault) {
-            throw   new DeploymentException(axisFault);
-        }
-    }
-
-}
+package org.apache.axis2.deployment;
+
+import org.apache.axis2.deployment.util.PhasesInfo;
+import org.apache.axis2.description.*;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.impl.OMOutputImpl;
+import org.apache.axis2.Constants;
+import org.apache.axis2.AxisFault;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Iterator;
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author: Deepal Jayasinghe
+ * Date: Aug 24, 2005
+ * Time: 11:21:02 PM
+ */
+
+
+/**
+ * This class is to convert OM->ServiceDescrption , where first create OM from service.xml and
+ * then populate service description by using OM
+ */
+
+
+public class ServiceBuilder extends DescriptionBuilder{
+
+    private ServiceDescription service;
+
+    public ServiceBuilder(InputStream serviceInputSteram,
+                          DeploymentEngine engine,ServiceDescription service) {
+        super(serviceInputSteram, engine);
+        this.service = service;
+    }
+
+    public ServiceBuilder(DeploymentEngine engine,ServiceDescription service) {
+        this.service = service;
+        super.engine = engine;
+    }
+
+    /**
+     * top most method that used to populate service from corresponding OM
+     */
+    public void populateService(OMElement service_element) throws DeploymentException {
+        try {
+
+            //Processing service level paramters
+            Iterator itr = service_element.getChildrenWithName(
+                    new QName(PARAMETERST));
+            processParameters(itr,service,service.getParent());
+
+            //process service description
+            OMElement descriptionElement = service_element.getFirstChildWithName(
+                    new QName(DESCRIPTION));
+            if (descriptionElement !=null) {
+                OMElement descriptionValue = descriptionElement.getFirstElement();
+                if(descriptionValue !=null){
+                    StringWriter writer = new StringWriter();
+                    descriptionValue.build();
+                    descriptionValue.serializeWithCache(new
+                            OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
+                    writer.flush();
+                    service.setServiceDescription(writer.toString());
+                } else {
+                    service.setServiceDescription(descriptionElement.getText());
+                }
+            }
+
+            //processing servicewide modules which required to engage gloabbly
+            Iterator moduleRefs = service_element.getChildrenWithName(
+                    new QName(MODULEST));
+            processModuleRefs(moduleRefs);
+
+            //process INFLOW
+            OMElement inFlow = service_element.getFirstChildWithName(
+                    new QName(INFLOWST));
+            if(inFlow !=null){
+                service.setInFlow(processFlow(inFlow,service));
+            }
+
+            OMElement outFlow = service_element.getFirstChildWithName(
+                    new QName(OUTFLOWST));
+            if(outFlow !=null){
+                service.setOutFlow(processFlow(outFlow,service));
+            }
+
+            OMElement inFaultFlow = service_element.getFirstChildWithName(
+                    new QName(IN_FAILTFLOW));
+            if(inFaultFlow !=null){
+                service.setFaultInFlow(processFlow(inFaultFlow,service));
+            }
+
+            OMElement outFaultFlow = service_element.getFirstChildWithName(
+                    new QName(OUT_FAILTFLOW));
+            if(outFaultFlow !=null){
+                service.setFaultOutFlow(processFlow(outFaultFlow,service));
+            }
+
+            //processing operations
+            Iterator opeartinsItr = service_element.getChildrenWithName(
+                    new QName(OPRATIONST));
+            ArrayList ops = processOpeartions(opeartinsItr);
+            for (int i = 0; i < ops.size(); i++) {
+                OperationDescription opeartionDesc = (OperationDescription) ops.get(i);
+                ArrayList paramters = opeartionDesc.getParameters();
+
+                // Adding wsa-maping into service
+                for (int j = 0; j < paramters.size(); j++) {
+                    Parameter parameter = (Parameter) paramters.get(j);
+                    if(parameter.getName().equals(Constants.WSA_ACTION)){
+                        service.addMapping((String)parameter.getValue(),opeartionDesc);
+                    }
+                }
+                service.addOperation(opeartionDesc);
+            }
+
+            Iterator moduleConfigs = service_element.getChildrenWithName(new QName(MODULECONFIG));
+            processServiceModuleConfig(moduleConfigs,service,service);
+
+
+        } catch (XMLStreamException e) {
+            throw new DeploymentException(e);
+        }
+    }
+
+    private ArrayList processOpeartions(Iterator opeartinsItr) throws DeploymentException {
+        ArrayList operations = new ArrayList();
+        while (opeartinsItr.hasNext()) {
+            OMElement operation = (OMElement) opeartinsItr.next();
+
+            // /getting opeartion name
+            OMAttribute op_name_att = operation.getAttribute(
+                    new QName(ATTNAME));
+            if(op_name_att == null){
+                throw new DeploymentException(Messages.getMessage("Invalide Operations"));
+            }
+            String opname = op_name_att.getValue();
+            OperationDescription op_descrip = service.getOperation(new QName(opname));
+            if(op_descrip == null){
+                op_descrip = new OperationDescription();
+                op_descrip.setName(new QName(opname));
+                log.info(Messages.getMessage(DeploymentErrorMsgs.OP_NOT_FOUN_IN_WSDL, opname));
+            }
+
+            //setting the mep of the operation
+            OMAttribute op_mep_att = operation.getAttribute(
+                    new QName(MEP));
+            if(op_mep_att !=null){
+                String mep = op_mep_att.getValue();
+                op_descrip.setMessageExchangePattern(mep);
+            }
+
+            //Opeartion Paramters
+            Iterator paramters = operation.getChildrenWithName(
+                    new QName(PARAMETERST));
+            processParameters(paramters,op_descrip,service);
+
+            // loading the message recivers
+            OMElement receiverElement = operation.getFirstChildWithName(
+                    new QName(MESSAGERECEIVER));
+            if(receiverElement !=null){
+                MessageReceiver messageReceiver = loadMessageReceiver(
+                        service.getClassLoader(),receiverElement);
+                op_descrip.setMessageReceiver(messageReceiver);
+            }  else {
+                //setting default message reciver
+                MessageReceiver msgReceiver = loadDefaultMessageReciver();
+                op_descrip.setMessageReceiver(msgReceiver);
+            }
+
+            //Process Module Refs
+            Iterator modules = operation.getChildrenWithName(
+                    new QName(MODULEST));
+            processOpeasrtionModuleRefs(modules, op_descrip);
+
+            //setting Operation phase
+            if (engine !=null) {
+                PhasesInfo info = engine.getPhasesinfo();
+                info.setOperationPhases(op_descrip);
+            }
+
+            Iterator moduleConfigs = operation.getChildrenWithName(new QName(MODULECONFIG));
+            processOperationModuleConfig(moduleConfigs,op_descrip,op_descrip);
+
+            //adding the opeartion
+            operations.add(op_descrip);
+        }
+        return operations;
+    }
+
+
+    protected void processServiceModuleConfig(Iterator moduleConfigs ,
+                                              ParameterInclude parent, ServiceDescription service)
+            throws DeploymentException {
+        while (moduleConfigs.hasNext()) {
+            OMElement moduleConfig = (OMElement) moduleConfigs.next();
+            OMAttribute moduleName_att = moduleConfig.getAttribute(
+                    new QName(ATTNAME));
+            if(moduleName_att == null){
+                throw new DeploymentException("Invalid module configuration");
+            } else {
+                String module = moduleName_att.getValue();
+                ModuleConfiguration moduleConfiguration =
+                        new ModuleConfiguration(new QName(module),parent);
+                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
+                processParameters(paramters,moduleConfiguration,parent);
+                service.addModuleConfig(moduleConfiguration);
+            }
+        }
+    }
+
+    protected void processOperationModuleConfig(Iterator moduleConfigs ,
+                                                ParameterInclude parent, OperationDescription opeartion)
+            throws DeploymentException {
+        while (moduleConfigs.hasNext()) {
+            OMElement moduleConfig = (OMElement) moduleConfigs.next();
+            OMAttribute moduleName_att = moduleConfig.getAttribute(
+                    new QName(ATTNAME));
+            if(moduleName_att == null){
+                throw new DeploymentException("Invalid module configuration");
+            } else {
+                String module = moduleName_att.getValue();
+                ModuleConfiguration moduleConfiguration =
+                        new ModuleConfiguration(new QName(module),parent);
+                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
+                processParameters(paramters,moduleConfiguration,parent);
+                opeartion.addModuleConfig(moduleConfiguration);
+            }
+        }
+    }
+
+    /**
+     * To get the list og modules that is requird to be engage globally
+     * @param moduleRefs  <code>java.util.Iterator</code>
+     * @throws DeploymentException   <code>DeploymentException</code>
+     */
+    protected void processModuleRefs(Iterator moduleRefs) throws DeploymentException {
+        try {
+            while (moduleRefs.hasNext()) {
+                OMElement moduleref = (OMElement) moduleRefs.next();
+                OMAttribute moduleRefAttribute = moduleref.getAttribute(
+                        new QName(REF));
+                if(moduleRefAttribute !=null){
+                    String refName = moduleRefAttribute.getValue();
+                    if(engine.getModule(new QName(refName)) == null) {
+                        throw new DeploymentException(Messages.getMessage(
+                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
+                    } else {
+                        service.addModuleref(new QName(refName));
+                    }
+                }
+            }
+        }catch (AxisFault axisFault) {
+            throw   new DeploymentException(axisFault);
+        }
+    }
+
+}

Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java Thu Sep 15 11:52:11 2005
@@ -1,138 +1,138 @@
-package org.apache.axis2.deployment;
-
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.description.ServiceGroupDescription;
-import org.apache.axis2.description.ParameterInclude;
-import org.apache.axis2.description.ModuleConfiguration;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMAttribute;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.i18n.Messages;
-
-import javax.xml.namespace.QName;
-import java.util.Iterator;
-/*
-* 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.
-*
-*
-*/
-
-/**
- * Author: Deepal Jayasinghe
- * Date: Sep 14, 2005
- * Time: 11:17:26 AM
- */
-public class ServiceGroupBuilder extends DescriptionBuilder{
-
-    private OMElement servcice;
-    public ServiceGroupBuilder(OMElement servcice, DeploymentEngine engine) {
-        super.engine =engine;
-        this.servcice = servcice;
-    }
-
-
-    public void populateServiceGroup(ServiceGroupDescription serviceGroup) throws DeploymentException {
-        try {
-            //Processing service level paramters
-            Iterator itr = servcice.getChildrenWithName(
-                    new QName(PARAMETERST));
-            processParameters(itr,serviceGroup,serviceGroup.getParent());
-
-            Iterator moduleConfigs = servcice.getChildrenWithName(new QName(MODULECONFIG));
-            processServiceModuleConfig(moduleConfigs,serviceGroup.getParent(),serviceGroup);
-
-            //processing servicewide modules which required to engage gloabbly
-            Iterator moduleRefs = servcice.getChildrenWithName(
-                    new QName(MODULEST));
-            processModuleRefs(moduleRefs,serviceGroup);
-
-            Iterator serviceitr = servcice.getChildrenWithName(new QName(SERVICE_ELEMENT));
-            while (serviceitr.hasNext()) {
-                OMElement service = (OMElement) serviceitr.next();
-
-                OMAttribute serviceNameatt = service.getAttribute(
-                        new QName(ATTNAME));
-                String serviceName = serviceNameatt.getValue();
-                if(serviceName == null){
-                    throw new DeploymentException("Service Name required");
-                } else {
-                    ServiceDescription serviceDecs = engine.getCurrentFileItem().getService(
-                            new QName(serviceName));
-                    if(serviceDecs == null){
-                        serviceDecs = new ServiceDescription(new QName(serviceName));
-                        engine.getCurrentFileItem().addService(serviceDecs);
-                        serviceDecs.setName(new QName(serviceName));
-                    }
-                    serviceDecs.setParent(serviceGroup);
-                    serviceDecs.setClassLoader(engine.getCurrentFileItem().getClassLoader());
-                    ServiceBuilder serviceBuilder = new ServiceBuilder(engine,serviceDecs);
-                    serviceBuilder.populateService(service);
-                }
-            }
-
-        } catch (DeploymentException e) {
-            throw new DeploymentException(e);
-        }
-
-    }
-
-    protected void processServiceModuleConfig(Iterator moduleConfigs ,
-                                              ParameterInclude parent, ServiceGroupDescription service)
-            throws DeploymentException {
-        while (moduleConfigs.hasNext()) {
-            OMElement moduleConfig = (OMElement) moduleConfigs.next();
-            OMAttribute moduleName_att = moduleConfig.getAttribute(
-                    new QName(ATTNAME));
-            if(moduleName_att == null){
-                throw new DeploymentException("Invalid module configuration");
-            } else {
-                String module = moduleName_att.getValue();
-                ModuleConfiguration moduleConfiguration =
-                        new ModuleConfiguration(new QName(module),parent);
-                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
-                processParameters(paramters,moduleConfiguration,parent);
-                service.addModuleConfig(moduleConfiguration);
-            }
-        }
-    }
-
-    /**
-     * To get the list og modules that is requird to be engage globally
-     * @param moduleRefs  <code>java.util.Iterator</code>
-     * @throws DeploymentException   <code>DeploymentException</code>
-     */
-    protected void processModuleRefs(Iterator moduleRefs ,ServiceGroupDescription serviceGroup)
-            throws DeploymentException {
-        try {
-            while (moduleRefs.hasNext()) {
-                OMElement moduleref = (OMElement) moduleRefs.next();
-                OMAttribute moduleRefAttribute = moduleref.getAttribute(
-                        new QName(REF));
-                if(moduleRefAttribute !=null){
-                    String refName = moduleRefAttribute.getValue();
-                    if(engine.getModule(new QName(refName)) == null) {
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
-                    } else {
-                        serviceGroup.addModuleref(new QName(refName));
-                    }
-                }
-            }
-        }catch (AxisFault axisFault) {
-            throw   new DeploymentException(axisFault);
-        }
-    }
-
-}
+package org.apache.axis2.deployment;
+
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.description.ServiceGroupDescription;
+import org.apache.axis2.description.ParameterInclude;
+import org.apache.axis2.description.ModuleConfiguration;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.i18n.Messages;
+
+import javax.xml.namespace.QName;
+import java.util.Iterator;
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author: Deepal Jayasinghe
+ * Date: Sep 14, 2005
+ * Time: 11:17:26 AM
+ */
+public class ServiceGroupBuilder extends DescriptionBuilder{
+
+    private OMElement servcice;
+    public ServiceGroupBuilder(OMElement servcice, DeploymentEngine engine) {
+        super.engine =engine;
+        this.servcice = servcice;
+    }
+
+
+    public void populateServiceGroup(ServiceGroupDescription serviceGroup) throws DeploymentException {
+        try {
+            //Processing service level paramters
+            Iterator itr = servcice.getChildrenWithName(
+                    new QName(PARAMETERST));
+            processParameters(itr,serviceGroup,serviceGroup.getParent());
+
+            Iterator moduleConfigs = servcice.getChildrenWithName(new QName(MODULECONFIG));
+            processServiceModuleConfig(moduleConfigs,serviceGroup.getParent(),serviceGroup);
+
+            //processing servicewide modules which required to engage gloabbly
+            Iterator moduleRefs = servcice.getChildrenWithName(
+                    new QName(MODULEST));
+            processModuleRefs(moduleRefs,serviceGroup);
+
+            Iterator serviceitr = servcice.getChildrenWithName(new QName(SERVICE_ELEMENT));
+            while (serviceitr.hasNext()) {
+                OMElement service = (OMElement) serviceitr.next();
+
+                OMAttribute serviceNameatt = service.getAttribute(
+                        new QName(ATTNAME));
+                String serviceName = serviceNameatt.getValue();
+                if(serviceName == null){
+                    throw new DeploymentException("Service Name required");
+                } else {
+                    ServiceDescription serviceDecs = engine.getCurrentFileItem().getService(
+                            new QName(serviceName));
+                    if(serviceDecs == null){
+                        serviceDecs = new ServiceDescription(new QName(serviceName));
+                        engine.getCurrentFileItem().addService(serviceDecs);
+                        serviceDecs.setName(new QName(serviceName));
+                    }
+                    serviceDecs.setParent(serviceGroup);
+                    serviceDecs.setClassLoader(engine.getCurrentFileItem().getClassLoader());
+                    ServiceBuilder serviceBuilder = new ServiceBuilder(engine,serviceDecs);
+                    serviceBuilder.populateService(service);
+                }
+            }
+
+        } catch (DeploymentException e) {
+            throw new DeploymentException(e);
+        }
+
+    }
+
+    protected void processServiceModuleConfig(Iterator moduleConfigs ,
+                                              ParameterInclude parent, ServiceGroupDescription service)
+            throws DeploymentException {
+        while (moduleConfigs.hasNext()) {
+            OMElement moduleConfig = (OMElement) moduleConfigs.next();
+            OMAttribute moduleName_att = moduleConfig.getAttribute(
+                    new QName(ATTNAME));
+            if(moduleName_att == null){
+                throw new DeploymentException("Invalid module configuration");
+            } else {
+                String module = moduleName_att.getValue();
+                ModuleConfiguration moduleConfiguration =
+                        new ModuleConfiguration(new QName(module),parent);
+                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
+                processParameters(paramters,moduleConfiguration,parent);
+                service.addModuleConfig(moduleConfiguration);
+            }
+        }
+    }
+
+    /**
+     * To get the list og modules that is requird to be engage globally
+     * @param moduleRefs  <code>java.util.Iterator</code>
+     * @throws DeploymentException   <code>DeploymentException</code>
+     */
+    protected void processModuleRefs(Iterator moduleRefs ,ServiceGroupDescription serviceGroup)
+            throws DeploymentException {
+        try {
+            while (moduleRefs.hasNext()) {
+                OMElement moduleref = (OMElement) moduleRefs.next();
+                OMAttribute moduleRefAttribute = moduleref.getAttribute(
+                        new QName(REF));
+                if(moduleRefAttribute !=null){
+                    String refName = moduleRefAttribute.getValue();
+                    if(engine.getModule(new QName(refName)) == null) {
+                        throw new DeploymentException(Messages.getMessage(
+                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
+                    } else {
+                        serviceGroup.addModuleref(new QName(refName));
+                    }
+                }
+            }
+        }catch (AxisFault axisFault) {
+            throw   new DeploymentException(axisFault);
+        }
+    }
+
+}

Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message