You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/12/16 18:18:08 UTC

svn commit: r357187 [7/25] - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: ./ addressing/ client/ client/async/ context/ deployment/ deployment/listener/ deployment/repository/util/ deployment/scheduler/ deployment/util/ descripti...

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=357187&r1=357186&r2=357187&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 Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * 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.axis2.deployment;
 
@@ -34,181 +35,189 @@
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Iterator;
+
 /**
  * This class is to convert OM->ServiceDescrption , where first create OM from services.xml and
  * then populate service description by using OM
  */
-public class ModuleBuilder extends DescriptionBuilder{
-
-    private ModuleDescription module;
+public class ModuleBuilder extends DescriptionBuilder {
     private AxisConfiguration axisConfig;
-    public ModuleBuilder(InputStream serviceInputSteram,ModuleDescription module ,
+    private ModuleDescription module;
+
+    public ModuleBuilder(InputStream serviceInputSteram, ModuleDescription module,
                          AxisConfiguration axisConfig) {
         super(serviceInputSteram, axisConfig);
         this.axisConfig = axisConfig;
         this.module = module;
     }
 
+    private void loadModuleClass(ModuleDescription module, String moduleClassName)
+            throws DeploymentException {
+        Class moduleClass;
+
+        try {
+            if ((moduleClassName != null) && !"".equals(moduleClassName)) {
+                moduleClass = Class.forName(moduleClassName, true, module.getModuleClassLoader());
+                module.setModule((Module) moduleClass.newInstance());
+            }
+        } catch (Exception e) {
+            throw new DeploymentException(e.getMessage(), e);
+        }
+    }
 
     public void populateModule() throws DeploymentException {
         try {
             OMElement moduleElement = buildOM();
+
             // Setting Module Name
-            OMAttribute moduleNameAtt = moduleElement.getAttribute(
-                    new QName(ATTNAME));
-            if(moduleNameAtt != null){
+            OMAttribute moduleNameAtt = moduleElement.getAttribute(new QName(ATTNAME));
+
+            if (moduleNameAtt != null) {
                 String moduleName = moduleNameAtt.getAttributeValue();
-                if (moduleName != null && !"".equals(moduleName)) {
+
+                if ((moduleName != null) && !"".equals(moduleName)) {
                     module.setName(new QName(moduleName));
                 }
             }
+
             // Setting Module Class , if it is there
-            OMAttribute moduleClassAtt = moduleElement.getAttribute(
-                    new QName(CLASSNAME));
-            if(moduleClassAtt !=null){
+            OMAttribute moduleClassAtt = moduleElement.getAttribute(new QName(CLASSNAME));
+
+            if (moduleClassAtt != null) {
                 String moduleClass = moduleClassAtt.getAttributeValue();
-                if(moduleClass !=null && !"".equals(moduleClass)){
-                    loadModuleClass(module,moduleClass);
+
+                if ((moduleClass != null) && !"".equals(moduleClass)) {
+                    loadModuleClass(module, moduleClass);
                 }
             }
 
-            //processing Parameters
-            //Processing service level parameters
-            Iterator itr = moduleElement.getChildrenWithName(
-                    new QName(PARAMETER));
-            processParameters(itr,module,module.getParent());
+            // processing Parameters
+            // Processing service level parameters
+            Iterator itr = moduleElement.getChildrenWithName(new QName(PARAMETER));
+
+            processParameters(itr, module, module.getParent());
 
-            //process INFLOW
-            OMElement inFlow = moduleElement.getFirstChildWithName(
-                    new QName(INFLOWST));
-            if(inFlow !=null){
-                module.setInFlow(processFlow(inFlow,module));
+            // 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 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 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));
+            OMElement outFaultFlow = moduleElement.getFirstChildWithName(new QName(OUT_FAILTFLOW));
+
+            if (outFaultFlow != null) {
+                module.setFaultOutFlow(processFlow(outFaultFlow, module));
             }
 
-            //processing Operations
+            // processing Operations
             Iterator op_itr = moduleElement.getChildrenWithName(new QName(OPRATIONST));
             ArrayList operations = processOperations(op_itr);
+
             for (int i = 0; i < operations.size(); i++) {
                 AxisOperation operation = (AxisOperation) operations.get(i);
+
                 module.addOperation(operation);
             }
-
-
         } catch (XMLStreamException e) {
             throw new DeploymentException(e);
         }
     }
 
-
-    private void loadModuleClass(ModuleDescription module , String moduleClassName)
-            throws DeploymentException {
-        Class moduleClass;
-        try {
-            if (moduleClassName != null && !"".equals(moduleClassName)) {
-                moduleClass =
-                        Class.forName(moduleClassName,
-                                true,
-                                module.getModuleClassLoader());
-                module.setModule((Module) moduleClass.newInstance());
-            }
-        } catch (Exception e) {
-            throw new DeploymentException(e.getMessage(), e);
-        }
-
-    }
-
-
-
     private ArrayList processOperations(Iterator operationsIterator) throws DeploymentException {
         ArrayList operations = new ArrayList();
+
         while (operationsIterator.hasNext()) {
             OMElement operation = (OMElement) operationsIterator.next();
 
             // /getting operation name
-            OMAttribute op_name_att = operation.getAttribute(
-                    new QName(ATTNAME));
-            if(op_name_att == null){
-                throw new DeploymentException(Messages.getMessage(Messages.getMessage(
-                        DeploymentErrorMsgs.INVALID_OP
-                        ,"operation name missing")));
-            }
-            OMAttribute op_mep_att = operation.getAttribute(
-                    new QName(MEP));
-            String mepURL =null;
+            OMAttribute op_name_att = operation.getAttribute(new QName(ATTNAME));
+
+            if (op_name_att == null) {
+                throw new DeploymentException(
+                        Messages.getMessage(
+                                Messages.getMessage(
+                                        DeploymentErrorMsgs.INVALID_OP, "operation name missing")));
+            }
+
+            OMAttribute op_mep_att = operation.getAttribute(new QName(MEP));
+            String mepURL = null;
             AxisOperation op_descrip;
-            if(op_mep_att !=null){
-                mepURL= op_mep_att.getAttributeValue();
+
+            if (op_mep_att != null) {
+                mepURL = op_mep_att.getAttributeValue();
             }
 
-            if(mepURL == null){
+            if (mepURL == null) {
+
                 // assuming in-out mep
                 op_descrip = new InOnlyAxisOperation();
             } else {
                 try {
                     op_descrip = AxisOperationFactory.getOperetionDescription(mepURL);
                 } catch (AxisFault axisFault) {
-                    throw new DeploymentException(Messages.getMessage(Messages.getMessage(
-                            DeploymentErrorMsgs.OPERATION_PROCESS_ERROR,axisFault.getMessage())));
+                    throw new DeploymentException(
+                            Messages.getMessage(
+                                    Messages.getMessage(
+                                            DeploymentErrorMsgs.OPERATION_PROCESS_ERROR,
+                                            axisFault.getMessage())));
                 }
             }
+
             String opname = op_name_att.getAttributeValue();
-//            AxisOperation op_descrip = new AxisOperation();
+
+//          AxisOperation op_descrip = new AxisOperation();
             op_descrip.setName(new QName(opname));
 
-            //Operation Parameters
-            Iterator parameters = operation.getChildrenWithName(
-                    new QName(PARAMETER));
-            ArrayList wsamapping =   processParameters(parameters,op_descrip,module);
-            op_descrip.setWsamappingList(wsamapping);
+            // Operation Parameters
+            Iterator parameters = operation.getChildrenWithName(new QName(PARAMETER));
+            ArrayList wsamapping = processParameters(parameters, op_descrip, module);
 
+            op_descrip.setWsamappingList(wsamapping);
 
-            //setting the mep of the operation
+            // setting the mep of the operation
+            // loading the message recivers
+            OMElement receiverElement = operation.getFirstChildWithName(new QName(MESSAGERECEIVER));
 
+            if (receiverElement != null) {
+                MessageReceiver messageReceiver =
+                        loadMessageReceiver(module.getModuleClassLoader(), receiverElement);
 
-            // loading the message recivers
-            OMElement receiverElement = operation.getFirstChildWithName(
-                    new QName(MESSAGERECEIVER));
-            if(receiverElement !=null){
-                MessageReceiver messageReceiver = loadMessageReceiver(module.getModuleClassLoader()
-                        ,receiverElement);
                 op_descrip.setMessageReceiver(messageReceiver);
-            }  else {
-                //setting default message reciver
+            } else {
+
+                // setting default message reciver
                 MessageReceiver msgReceiver = loadDefaultMessageReceiver();
+
                 op_descrip.setMessageReceiver(msgReceiver);
             }
-            //Process Module Refs
-            Iterator modules = operation.getChildrenWithName(
-                    new QName(MODULEST));
+
+            // Process Module Refs
+            Iterator modules = operation.getChildrenWithName(new QName(MODULEST));
+
             processOperationModuleRefs(modules, op_descrip);
 
-            //setting Operation phase
+            // setting Operation phase
             PhasesInfo info = axisConfig.getPhasesInfo();
+
             info.setOperationPhases(op_descrip);
 
-            //adding the operation
+            // adding the operation
             operations.add(op_descrip);
         }
+
         return operations;
     }
-
-
 }

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=357187&r1=357186&r2=357187&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 Fri Dec 16 09:13:57 2005
@@ -14,11 +14,19 @@
  * limitations under the License.
  */
 
+
 package org.apache.axis2.deployment;
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.deployment.util.PhasesInfo;
-import org.apache.axis2.description.*;
+import org.apache.axis2.description.AxisMessage;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisOperationFactory;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.description.ModuleConfiguration;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.ParameterInclude;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.i18n.Messages;
@@ -32,22 +40,13 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 
-
 /**
  * This class is to convert OM->ServiceDescrption , where first create OM from services.xml and
  * then populate service description by using OM
  */
-
-
 public class ServiceBuilder extends DescriptionBuilder {
-    private AxisService service;
     private AxisConfiguration axisConfig;
-
-    public ServiceBuilder(InputStream serviceInputSteram,
-                          AxisConfiguration axisConfig, AxisService service) {
-        super(serviceInputSteram, axisConfig);
-        this.service = service;
-    }
+    private AxisService service;
 
     public ServiceBuilder(AxisConfiguration axisConfig, AxisService service) {
         this.service = service;
@@ -55,24 +54,33 @@
         super.axisConfig = axisConfig;
     }
 
+    public ServiceBuilder(InputStream serviceInputSteram, AxisConfiguration axisConfig,
+                          AxisService service) {
+        super(serviceInputSteram, axisConfig);
+        this.service = service;
+    }
+
     /**
      * top most method that used to populate service from corresponding OM
      */
     public AxisService populateService(OMElement service_element) throws DeploymentException {
         try {
 
-            //Processing service level parameters
-            Iterator itr = service_element.getChildrenWithName(
-                    new QName(PARAMETER));
+            // Processing service level parameters
+            Iterator itr = service_element.getChildrenWithName(new QName(PARAMETER));
+
             processParameters(itr, service, service.getParent());
 
-            //process service description
-            OMElement descriptionElement = service_element.getFirstChildWithName(
-                    new QName(DESCRIPTION));
+            // 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.serialize(writer);
                     writer.flush();
@@ -81,208 +89,230 @@
                     service.setAxisServiceName(descriptionElement.getText());
                 }
             } else {
-                OMAttribute serviceNameatt = service_element.getAttribute(
-                        new QName(ATTNAME));
+                OMAttribute serviceNameatt = service_element.getAttribute(new QName(ATTNAME));
+
                 if (serviceNameatt != null) {
                     service.setAxisServiceName(serviceNameatt.getAttributeValue());
                 }
             }
 
-            //processing servicewide modules which required to engage gloabbly
-            Iterator moduleRefs = service_element.getChildrenWithName(
-                    new QName(MODULEST));
+            // processing servicewide modules which required to engage gloabbly
+            Iterator moduleRefs = service_element.getChildrenWithName(new QName(MODULEST));
+
             processModuleRefs(moduleRefs);
 
-            //processing operations
-            Iterator operationsIterator = service_element.getChildrenWithName(
-                    new QName(OPRATIONST));
+            // processing operations
+            Iterator operationsIterator =
+                    service_element.getChildrenWithName(new QName(OPRATIONST));
             ArrayList ops = processOperations(operationsIterator);
+
             for (int i = 0; i < ops.size(); i++) {
                 AxisOperation operationDesc = (AxisOperation) ops.get(i);
                 ArrayList wsamappings = operationDesc.getWsamappingList();
+
                 for (int j = 0; j < wsamappings.size(); j++) {
                     Parameter parameter = (Parameter) wsamappings.get(j);
+
                     service.mapActionToOperation((String) parameter.getValue(), operationDesc);
                 }
+
                 service.addOperation(operationDesc);
             }
 
             Iterator moduleConfigs = service_element.getChildrenWithName(new QName(MODULECONFIG));
-            processServiceModuleConfig(moduleConfigs, service, service);
-
 
+            processServiceModuleConfig(moduleConfigs, service, service);
         } catch (XMLStreamException e) {
             throw new DeploymentException(e);
         } catch (AxisFault axisFault) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.OPERATION_PROCESS_ERROR, axisFault.getMessage()));
+            throw new DeploymentException(
+                    Messages.getMessage(
+                            DeploymentErrorMsgs.OPERATION_PROCESS_ERROR, axisFault.getMessage()));
         }
+
         return service;
     }
 
+    private void processMessages(Iterator messages, AxisOperation operation)
+            throws DeploymentException {
+        while (messages.hasNext()) {
+            OMElement messageElement = (OMElement) messages.next();
+            OMAttribute lable = messageElement.getAttribute(new QName(LABEL));
+
+            if (lable == null) {
+                throw new DeploymentException("message lebel can not be null");
+            }
+
+            AxisMessage message = new AxisMessage();
+            Iterator parameters = messageElement.getChildrenWithName(new QName(PARAMETER));
+
+            processParameters(parameters, message, operation);
+            operation.addMessage(message, lable.getAttributeValue().trim());
+        }
+    }
+
+    /**
+     * 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.getAttributeValue();
+
+                    if (axisConfig.getModule(new QName(refName)) == null) {
+                        throw new DeploymentException(
+                                Messages.getMessage(DeploymentErrorMsgs.MODULE_NOT_FOUND, refName));
+                    } else {
+                        service.addModuleref(new QName(refName));
+                    }
+                }
+            }
+        } catch (AxisFault axisFault) {
+            throw new DeploymentException(axisFault);
+        }
+    }
+
+    protected void processOperationModuleConfig(Iterator moduleConfigs, ParameterInclude parent,
+                                                AxisOperation operation)
+            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(
+                        Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
+            } else {
+                String module = moduleName_att.getAttributeValue();
+                ModuleConfiguration moduleConfiguration =
+                        new ModuleConfiguration(new QName(module), parent);
+                Iterator parameters = moduleConfig.getChildrenWithName(new QName(PARAMETER));
+
+                processParameters(parameters, moduleConfiguration, parent);
+                operation.addModuleConfig(moduleConfiguration);
+            }
+        }
+    }
+
     private ArrayList processOperations(Iterator operationsIterator) throws AxisFault {
         ArrayList operations = new ArrayList();
+
         while (operationsIterator.hasNext()) {
             OMElement operation = (OMElement) operationsIterator.next();
 
             // /getting operation name
-            OMAttribute op_name_att = operation.getAttribute(
-                    new QName(ATTNAME));
+            OMAttribute op_name_att = operation.getAttribute(new QName(ATTNAME));
+
             if (op_name_att == null) {
-                throw new DeploymentException(Messages.getMessage(Messages.getMessage(
-                        DeploymentErrorMsgs.INVALID_OP
-                        , "operation name missing")));
+                throw new DeploymentException(
+                        Messages.getMessage(
+                                Messages.getMessage(
+                                        DeploymentErrorMsgs.INVALID_OP, "operation name missing")));
             }
 
-            //setting the mep of the operation
-            OMAttribute op_mep_att = operation.getAttribute(
-                    new QName(MEP));
+            // setting the mep of the operation
+            OMAttribute op_mep_att = operation.getAttribute(new QName(MEP));
             String mepurl = null;
+
             if (op_mep_att != null) {
                 mepurl = op_mep_att.getAttributeValue();
-                //todo value has to be validate
-                //todo
+
+                // todo value has to be validate
+                // todo
                 // op_descrip.setMessageExchangePattern(mep);
             }
 
             String opname = op_name_att.getAttributeValue();
             AxisOperation op_descrip;
+
             if (mepurl == null) {
+
                 // assumed MEP is in-out
                 op_descrip = new InOutAxisOperation();
             } else {
                 op_descrip = AxisOperationFactory.getOperetionDescription(mepurl);
             }
-//                op_descrip = new AxisOperation();
+
+//          op_descrip = new AxisOperation();
             op_descrip.setName(new QName(opname));
             log.info(Messages.getMessage(DeploymentErrorMsgs.OP_NOT_FOUN_IN_WSDL, opname));
 
-            //Operation Parameters
-            Iterator parameters = operation.getChildrenWithName(
-                    new QName(PARAMETER));
+            // Operation Parameters
+            Iterator parameters = operation.getChildrenWithName(new QName(PARAMETER));
             ArrayList wsamappings = processParameters(parameters, op_descrip, service);
+
             op_descrip.setWsamappingList(wsamappings);
+
             // loading the message receivers
-            OMElement receiverElement = operation.getFirstChildWithName(
-                    new QName(MESSAGERECEIVER));
+            OMElement receiverElement = operation.getFirstChildWithName(new QName(MESSAGERECEIVER));
+
             if (receiverElement != null) {
-                MessageReceiver messageReceiver = loadMessageReceiver(
-                        service.getClassLoader(), receiverElement);
+                MessageReceiver messageReceiver = loadMessageReceiver(service.getClassLoader(),
+                        receiverElement);
+
                 op_descrip.setMessageReceiver(messageReceiver);
             } else {
-                //setting default message reciver
+
+                // setting default message reciver
                 MessageReceiver msgReceiver = loadDefaultMessageReceiver();
+
                 op_descrip.setMessageReceiver(msgReceiver);
             }
 
-            //Process Module Refs
-            Iterator modules = operation.getChildrenWithName(
-                    new QName(MODULEST));
+            // Process Module Refs
+            Iterator modules = operation.getChildrenWithName(new QName(MODULEST));
+
             processOperationModuleRefs(modules, op_descrip);
 
-            //processing Messages
+            // processing Messages
             Iterator messages = operation.getChildrenWithName(new QName(MESSGES));
+
             processMessages(messages, op_descrip);
 
-            //setting Operation phase
+            // setting Operation phase
             if (axisConfig != null) {
                 PhasesInfo info = axisConfig.getPhasesInfo();
+
                 info.setOperationPhases(op_descrip);
             }
 
             Iterator moduleConfigs = operation.getChildrenWithName(new QName(MODULECONFIG));
+
             processOperationModuleConfig(moduleConfigs, op_descrip, op_descrip);
 
-            //adding the operation
+            // adding the operation
             operations.add(op_descrip);
         }
-        return operations;
-    }
-
-    private void processMessages(Iterator messages, AxisOperation operation)
-            throws DeploymentException {
-        while (messages.hasNext()) {
-            OMElement messageElement = (OMElement) messages.next();
-            OMAttribute lable = messageElement.getAttribute(new QName(LABEL));
-            if (lable == null) {
-                throw new DeploymentException("message lebel can not be null");
-            }
-            AxisMessage message = new AxisMessage();
-            Iterator parameters = messageElement.getChildrenWithName(new QName(PARAMETER));
-            processParameters(parameters, message, operation);
-            operation.addMessage(message, lable.getAttributeValue().trim());
-        }
 
+        return operations;
     }
 
-    protected void processServiceModuleConfig(Iterator moduleConfigs,
-                                              ParameterInclude parent, AxisService service)
+    protected void processServiceModuleConfig(Iterator moduleConfigs, ParameterInclude parent,
+                                              AxisService 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(Messages.getMessage(
-                        DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
-            } else {
-                String module = moduleName_att.getAttributeValue();
-                ModuleConfiguration moduleConfiguration =
-                        new ModuleConfiguration(new QName(module), parent);
-                Iterator parameters = moduleConfig.getChildrenWithName(new QName(PARAMETER));
-                processParameters(parameters, moduleConfiguration, parent);
-                service.addModuleConfig(moduleConfiguration);
-            }
-        }
-    }
+            OMAttribute moduleName_att = moduleConfig.getAttribute(new QName(ATTNAME));
 
-    protected void processOperationModuleConfig(Iterator moduleConfigs,
-                                                ParameterInclude parent,
-                                                AxisOperation operation)
-            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(Messages.getMessage(
-                        DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
+                throw new DeploymentException(
+                        Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
             } else {
                 String module = moduleName_att.getAttributeValue();
                 ModuleConfiguration moduleConfiguration =
                         new ModuleConfiguration(new QName(module), parent);
                 Iterator parameters = moduleConfig.getChildrenWithName(new QName(PARAMETER));
-                processParameters(parameters, moduleConfiguration, parent);
-                operation.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.getAttributeValue();
-                    if (axisConfig.getModule(new QName(refName)) == null) {
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.MODULE_NOT_FOUND, refName));
-                    } else {
-                        service.addModuleref(new QName(refName));
-                    }
-                }
+                processParameters(parameters, moduleConfiguration, parent);
+                service.addModuleConfig(moduleConfiguration);
             }
-        } catch (AxisFault axisFault) {
-            throw new DeploymentException(axisFault);
         }
     }
-
 }

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=357187&r1=357186&r2=357187&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 Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * 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.axis2.deployment;
 
@@ -32,10 +33,9 @@
 import java.util.Iterator;
 
 public class ServiceGroupBuilder extends DescriptionBuilder {
-
+    private AxisConfiguration axisConfig;
     private OMElement servcice;
     private HashMap wsdlServices;
-    private AxisConfiguration axisConfig;
 
     public ServiceGroupBuilder(OMElement servcice, HashMap wsdlServices,
                                AxisConfiguration axisConfig) {
@@ -45,70 +45,59 @@
         super.axisConfig = axisConfig;
     }
 
-    public ArrayList populateServiceGroup(AxisServiceGroup axisServiceGroup) throws DeploymentException {
+    public ArrayList populateServiceGroup(AxisServiceGroup axisServiceGroup)
+            throws DeploymentException {
         ArrayList serviceList = new ArrayList();
+
         try {
-            //Processing service level parameters
-            Iterator itr = servcice.getChildrenWithName(
-                    new QName(PARAMETER));
+
+            // Processing service level parameters
+            Iterator itr = servcice.getChildrenWithName(new QName(PARAMETER));
+
             processParameters(itr, axisServiceGroup, axisServiceGroup.getParent());
 
             Iterator moduleConfigs = servcice.getChildrenWithName(new QName(MODULECONFIG));
-            processServiceModuleConfig(moduleConfigs, axisServiceGroup.getParent(), axisServiceGroup);
 
-            //processing servicewide modules which required to engage gloabbly
-            Iterator moduleRefs = servcice.getChildrenWithName(
-                    new QName(MODULEST));
+            processServiceModuleConfig(moduleConfigs, axisServiceGroup.getParent(),
+                    axisServiceGroup);
+
+            // processing servicewide modules which required to engage gloabbly
+            Iterator moduleRefs = servcice.getChildrenWithName(new QName(MODULEST));
+
             processModuleRefs(moduleRefs, axisServiceGroup);
 
             Iterator serviceitr = servcice.getChildrenWithName(new QName(SERVICE_ELEMENT));
+
             while (serviceitr.hasNext()) {
                 OMElement service = (OMElement) serviceitr.next();
-
-                OMAttribute serviceNameatt = service.getAttribute(
-                        new QName(ATTNAME));
+                OMAttribute serviceNameatt = service.getAttribute(new QName(ATTNAME));
                 String serviceName = serviceNameatt.getAttributeValue();
+
                 if (serviceName == null) {
-                    throw new DeploymentException(Messages.getMessage(
-                            DeploymentErrorMsgs.SERVICE_NAME_ERROR));
+                    throw new DeploymentException(
+                            Messages.getMessage(DeploymentErrorMsgs.SERVICE_NAME_ERROR));
                 } else {
                     AxisService axisService = (AxisService) wsdlServices.get(serviceName);
+
                     if (axisService == null) {
                         axisService = new AxisService(serviceName);
                     }
+
                     // the service that has to be deploy
                     axisService.setParent(axisServiceGroup);
                     axisService.setClassLoader(axisServiceGroup.getServiceGroupClassLoader());
+
                     ServiceBuilder serviceBuilder = new ServiceBuilder(axisConfig, axisService);
                     AxisService as = serviceBuilder.populateService(service);
+
                     serviceList.add(as);
                 }
             }
         } catch (AxisFault e) {
             throw new DeploymentException(e);
         }
-        return serviceList;
-    }
 
-    protected void processServiceModuleConfig(Iterator moduleConfigs,
-                                              ParameterInclude parent, AxisServiceGroup axisService)
-            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(Messages.getMessage(
-                        DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
-            } else {
-                String module = moduleName_att.getAttributeValue();
-                ModuleConfiguration moduleConfiguration =
-                        new ModuleConfiguration(new QName(module), parent);
-                Iterator parameters = moduleConfig.getChildrenWithName(new QName(PARAMETER));
-                processParameters(parameters, moduleConfiguration, parent);
-                axisService.addModuleConfig(moduleConfiguration);
-            }
-        }
+        return serviceList;
     }
 
     /**
@@ -122,13 +111,14 @@
         try {
             while (moduleRefs.hasNext()) {
                 OMElement moduleref = (OMElement) moduleRefs.next();
-                OMAttribute moduleRefAttribute = moduleref.getAttribute(
-                        new QName(REF));
+                OMAttribute moduleRefAttribute = moduleref.getAttribute(new QName(REF));
+
                 if (moduleRefAttribute != null) {
                     String refName = moduleRefAttribute.getAttributeValue();
+
                     if (axisConfig.getModule(new QName(refName)) == null) {
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.MODULE_NOT_FOUND, refName));
+                        throw new DeploymentException(
+                                Messages.getMessage(DeploymentErrorMsgs.MODULE_NOT_FOUND, refName));
                     } else {
                         axisServiceGroup.addModuleref(new QName(refName));
                     }
@@ -139,4 +129,25 @@
         }
     }
 
+    protected void processServiceModuleConfig(Iterator moduleConfigs, ParameterInclude parent,
+                                              AxisServiceGroup axisService)
+            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(
+                        Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE_CONFIG));
+            } else {
+                String module = moduleName_att.getAttributeValue();
+                ModuleConfiguration moduleConfiguration =
+                        new ModuleConfiguration(new QName(module), parent);
+                Iterator parameters = moduleConfig.getChildrenWithName(new QName(PARAMETER));
+
+                processParameters(parameters, moduleConfiguration, parent);
+                axisService.addModuleConfig(moduleConfiguration);
+            }
+        }
+    }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListener.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListener.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListener.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListener.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * 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.axis2.deployment.listener;
 
@@ -33,14 +34,13 @@
     void checkServices();
 
     /**
-     * If new services or modules(service or module) are added then this method will call
-     */
-    void update();
-
-    /**
      * this is to Initialize the Deployment , this only call when the Axis engine start up
      * Then it should deploy all the WS and modules , and should initialize the WSInfoList
      */
     void init();
 
-}
\ No newline at end of file
+    /**
+     * If new services or modules(service or module) are added then this method will call
+     */
+    void update();
+}

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListenerImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListenerImpl.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListenerImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListenerImpl.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * 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.axis2.deployment.listener;
 
@@ -25,23 +26,20 @@
 
 import java.io.File;
 
-public class RepositoryListenerImpl implements RepositoryListener,
-        DeploymentConstants {
-
+public class RepositoryListenerImpl implements RepositoryListener, DeploymentConstants {
     protected Log log = LogFactory.getLog(getClass());
-    /**
-     * Referance to a WSInfoList
-     */
-    private WSInfoList wsInfoList;
     private DeploymentEngine deEngine;
 
-
     /**
      * The parent directory of the modules and services directories
      * taht the listentner should listent
      */
     private String folderName;
 
+    /**
+     * Referance to a WSInfoList
+     */
+    private WSInfoList wsInfoList;
 
     /**
      * This constructor take two argumnets folder name and referance to Deployment Engine
@@ -51,8 +49,7 @@
      * @param folderName    path to parent directory that the listener should listent
      * @param deploy_engine refearnce to engine registry  inorder to inform the updates
      */
-    public RepositoryListenerImpl(String folderName,
-                                  DeploymentEngine deploy_engine) {
+    public RepositoryListenerImpl(String folderName, DeploymentEngine deploy_engine) {
         this.folderName = folderName;
         wsInfoList = new WSInfoList(deploy_engine);
         this.deEngine = deploy_engine;
@@ -66,16 +63,19 @@
     public void checkModules() {
         String modulepath = folderName + MODULE_PATH;
         File root = new File(modulepath);
-        File [] files = root.listFiles();
+        File[] files = root.listFiles();
+
         if (files != null) {
             for (int i = 0; i < files.length; i++) {
                 File file = files[i];
+
                 if (!file.isDirectory()) {
                     if (ArchiveFileData.isModuleArchiveFile(file.getName())) {
                         wsInfoList.addWSInfoItem(file, MODULE);
                     }
                 } else {
                     if ("lib".equals(file.getName()) || "Lib".equals(file.getName())) {
+
                         // this is a lib file no need to take this as a sevice
                     } else {
                         wsInfoList.addWSInfoItem(file, MODULE);
@@ -91,18 +91,12 @@
      */
     public void checkServices() {
         String modulepath = folderName + SERVICE_PATH;
+
         searchWS(modulepath);
         update();
     }
 
     /**
-     * call to update method of WSInfoList object
-     */
-    public void update() {
-        wsInfoList.update();
-    }
-
-    /**
      * First it call to initalize method of WSInfoList to initilizat that
      * then it call to checkModules to load all the module.jar s
      * and then it call to update() method inorder to update the Deployment engine and
@@ -111,17 +105,9 @@
     public void init() {
         wsInfoList.init();
         checkModules();
-//        checkServices();
-        deEngine.doDeploy();
-    }
 
-    /**
-     * this is the actual method that is call from scheduler
-     */
-    public void startListent() {
-        // checkModules();
-        checkServices();
-        update();
+//      checkServices();
+        deEngine.doDeploy();
     }
 
     /**
@@ -130,16 +116,19 @@
      */
     private void searchWS(String folderName) {
         File root = new File(folderName);
-        File [] files = root.listFiles();
+        File[] files = root.listFiles();
+
         if (files != null) {
             for (int i = 0; i < files.length; i++) {
                 File file = files[i];
+
                 if (!file.isDirectory()) {
                     if (ArchiveFileData.isServiceArchiveFile(file.getName())) {
                         wsInfoList.addWSInfoItem(file, SERVICE);
                     }
                 } else {
                     if ("lib".equals(file.getName()) || "Lib".equals(file.getName())) {
+
                         // this is a lib file no need to take this as a sevice
                     } else {
                         wsInfoList.addWSInfoItem(file, SERVICE);
@@ -149,37 +138,54 @@
         }
     }
 
-//    private void searchExplodedDir(String rootDirName){
-//        File rootDir = new File(rootDirName);
-//        File [] fileList = rootDir.listFiles();
-//        if (fileList !=null) {
-//            for (int i = 0; i < fileList.length; i++) {
-//                File file = fileList[i];
-//                if(file.isDirectory()){
-//                    wsInfoList.addWSInfoItem(file, SERVICE);
-//                }
-//            }
-//        }
-//    }
+    /**
+     * this is the actual method that is call from scheduler
+     */
+    public void startListent() {
+
+        // checkModules();
+        checkServices();
+        update();
+    }
+
+    /**
+     * call to update method of WSInfoList object
+     */
+    public void update() {
+        wsInfoList.update();
+    }
+
+//  private void searchExplodedDir(String rootDirName){
+//      File rootDir = new File(rootDirName);
+//      File [] fileList = rootDir.listFiles();
+//      if (fileList !=null) {
+//          for (int i = 0; i < fileList.length; i++) {
+//              File file = fileList[i];
+//              if(file.isDirectory()){
+//                  wsInfoList.addWSInfoItem(file, SERVICE);
+//              }
+//          }
+//      }
+//  }
 
     /**
      * To delete a given directory with its all childerns
      * @param dir
      * @return boolean
      */
-//    private boolean deleteDir(File dir) {
-//        if (dir.isDirectory()) {
-//            String[] children = dir.list();
-//            for (int i=0; i<children.length; i++) {
-//                boolean success = deleteDir(new File(dir, children[i]));
-//                if (!success) {
-//                    return false;
-//                }
-//            }
-//        }
-//        // The directory is now empty so delete it
-//        return dir.delete();
-//    }
+//  private boolean deleteDir(File dir) {
+//      if (dir.isDirectory()) {
+//          String[] children = dir.list();
+//          for (int i=0; i<children.length; i++) {
+//              boolean success = deleteDir(new File(dir, children[i]));
+//              if (!success) {
+//                  return false;
+//              }
+//          }
+//      }
+//      // The directory is now empty so delete it
+//      return dir.delete();
+//  }
 
     /**
      * Will extarct given file , into same dirctory with the name of archive file (removing file
@@ -187,44 +193,42 @@
      * @param infile  <code>java.io.File</code>   Archive file
      * @param outdirctory <code>java.io.File</code>  output file
      */
-//    public void extarctServiceArchive(File infile , File outdirctory ) {
-//        try{
-//            BufferedOutputStream dest;
-//            FileInputStream fis = new  FileInputStream(infile);
-//            ZipInputStream zis = new
-//                    ZipInputStream(new BufferedInputStream(fis));
-//            ZipEntry entry;
+//  public void extarctServiceArchive(File infile , File outdirctory ) {
+//      try{
+//          BufferedOutputStream dest;
+//          FileInputStream fis = new  FileInputStream(infile);
+//          ZipInputStream zis = new
+//                  ZipInputStream(new BufferedInputStream(fis));
+//          ZipEntry entry;
 //
-//            outdirctory.mkdir();
-//            File outFile ;
-//            String outPath =  outdirctory.getAbsolutePath() + "/";
-//            while((entry = zis.getNextEntry()) != null) {
-//                int count;
-//                byte data[] = new byte[BUFFER];
-//                // write the files to the disk
-//                outFile = new File(outPath + entry.getName());
-//                if(entry.isDirectory()){
-//                    if(!outFile.exists()){
-//                        outFile.mkdir();
-//                    }
-//                    continue;
-//                }
-//                FileOutputStream fos = new
-//                        FileOutputStream(outFile);
-//                dest = new
-//                        BufferedOutputStream(fos, BUFFER);
-//                while ((count = zis.read(data, 0, BUFFER))
-//                        != -1) {
-//                    dest.write(data, 0, count);
-//                }
-//                dest.flush();
-//                dest.close();
-//            }
-//            zis.close();
-//        } catch(Exception e) {
-//            log.error(e);
-//        }
-//    }
-
-
+//          outdirctory.mkdir();
+//          File outFile ;
+//          String outPath =  outdirctory.getAbsolutePath() + "/";
+//          while((entry = zis.getNextEntry()) != null) {
+//              int count;
+//              byte data[] = new byte[BUFFER];
+//              // write the files to the disk
+//              outFile = new File(outPath + entry.getName());
+//              if(entry.isDirectory()){
+//                  if(!outFile.exists()){
+//                      outFile.mkdir();
+//                  }
+//                  continue;
+//              }
+//              FileOutputStream fos = new
+//                      FileOutputStream(outFile);
+//              dest = new
+//                      BufferedOutputStream(fos, BUFFER);
+//              while ((count = zis.read(data, 0, BUFFER))
+//                      != -1) {
+//                  dest.write(data, 0, count);
+//              }
+//              dest.flush();
+//              dest.close();
+//          }
+//          zis.close();
+//      } catch(Exception e) {
+//          log.error(e);
+//      }
+//  }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * 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.axis2.deployment.repository.util;
 
@@ -25,39 +26,49 @@
 import java.io.File;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.HashMap;
 
 /**
  * ArchiveFileData = Hot Deployment File Item , to store infromation of the module or servise
  * item to be deploy
  */
 public class ArchiveFileData {
-
-    private ClassLoader classLoader;
     private File file = null;
-    private int type;
+    private ArrayList deploybleServices = new ArrayList();
+    private ClassLoader classLoader;
     private String messgeReceiver;
-//    private String moduleClass;
+
+//  private String moduleClass;
     private String name;
+    private int type;
 
-    private ArrayList deploybleServices = new ArrayList();
+    public ArchiveFileData(File file, int type) {
+        this.file = file;
+        this.type = type;
+    }
 
     public ArchiveFileData(int type, String name) {
         this.type = type;
         this.name = name;
     }
 
-    public String getMessgeReceiver() {
-        return messgeReceiver;
+    public String getAbsolutePath() {
+        return file.getAbsolutePath();
     }
 
-    public void setMessgeReceiver(String messgeReceiver) {
-        this.messgeReceiver = messgeReceiver;
+    public ClassLoader getClassLoader() {
+        return classLoader;
     }
 
-    public ArchiveFileData(File file, int type) {
-        this.file = file;
-        this.type = type;
+    public ArrayList getDeploybleServices() {
+        return deploybleServices;
+    }
+
+    public File getFile() {
+        return file;
+    }
+
+    public String getMessgeReceiver() {
+        return messgeReceiver;
     }
 
     public String getName() {
@@ -67,24 +78,27 @@
     public String getServiceName() {
         if (file != null) {
             return file.getName();
-        } else
+        } else {
             return name;
-    }
-
-    public String getAbsolutePath() {
-        return file.getAbsolutePath();
+        }
     }
 
     public int getType() {
         return type;
     }
 
-    public File getFile() {
-        return file;
+    public static boolean isModuleArchiveFile(String filename) {
+        return ((filename.endsWith(".jar")) || (filename.endsWith(".mar")));
     }
 
-    public ClassLoader getClassLoader() {
-        return classLoader;
+    /**
+     * to check whthere a given file is  a  jar file
+     *
+     * @param filename
+     * @return boolean
+     */
+    public static boolean isServiceArchiveFile(String filename) {
+        return ((filename.endsWith(".jar")) | (filename.endsWith(".aar")));
     }
 
     public void setClassLoader(ClassLoader classLoader) {
@@ -92,19 +106,20 @@
     }
 
     public void setClassLoader(boolean extractArichive, ClassLoader parent) throws AxisFault {
-        if (! extractArichive) {
+        if (!extractArichive) {
+
             // has to be craeted taking that file to the account
             if (file != null) {
                 URL[] urlsToLoadFrom;
+
                 try {
                     if (!file.exists()) {
-                        throw new AxisFault(Messages.getMessage(
-                                DeploymentErrorMsgs.FILE_NOT_FOUND,
+                        throw new AxisFault(Messages.getMessage(DeploymentErrorMsgs.FILE_NOT_FOUND,
                                 file.getAbsolutePath()));
                     }
+
                     urlsToLoadFrom = new URL[]{file.toURL()};
-                    classLoader =
-                            new DeploymentClassLoader(urlsToLoadFrom, parent);
+                    classLoader = new DeploymentClassLoader(urlsToLoadFrom, parent);
                 } catch (Exception e) {
                     throw new AxisFault(e);
                 }
@@ -114,28 +129,13 @@
                 classLoader = Utils.getClassLoader(parent, file);
             }
         }
-
-    }
-
-    /**
-     * to check whthere a given file is  a  jar file
-     *
-     * @param filename
-     * @return boolean
-     */
-    public static boolean isServiceArchiveFile(String filename) {
-        return ((filename.endsWith(".jar")) | (filename.endsWith(".aar")));
-    }
-
-    public static boolean isModuleArchiveFile(String filename) {
-        return ((filename.endsWith(".jar")) || (filename.endsWith(".mar")));
-    }
-
-    public ArrayList getDeploybleServices() {
-        return deploybleServices;
     }
 
     public void setDeploybleServices(ArrayList deploybleServices) {
         this.deploybleServices = deploybleServices;
+    }
+
+    public void setMessgeReceiver(String messgeReceiver) {
+        this.messgeReceiver = messgeReceiver;
     }
 }