axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r349418 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/deployment/listener/ core/src/org/apache/axis2/deployment/scheduler/ core/src/org/apache/axis2/description/ core/src/org/apa...
Date Mon, 28 Nov 2005 16:19:59 GMT
Author: deepal
Date: Mon Nov 28 08:19:26 2005
New Revision: 349418

URL: http://svn.apache.org/viewcvs?rev=349418&view=rev
Log:
Improved module engaging 
  1. Service specific module can add handlers to global phase (removed earlier restriction)
  2. Remove unnecessary codes from PhaseResolver

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/listener/RepositoryListenerImpl.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/scheduler/SchedulerTask.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
    webservices/axis2/trunk/java/modules/core/webapp/ListServiceGroup.jsp
    webservices/axis2/trunk/java/modules/core/webapp/listGroupService.jsp
    webservices/axis2/trunk/java/modules/core/webapp/listService.jsp
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MockFlow.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java Mon Nov 28 08:19:26 2005
@@ -17,6 +17,7 @@
 package org.apache.axis2.deployment;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.deployment.listener.RepositoryListener;
 import org.apache.axis2.deployment.listener.RepositoryListenerImpl;
 import org.apache.axis2.deployment.repository.util.ArchiveFileData;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
@@ -26,12 +27,7 @@
 import org.apache.axis2.deployment.scheduler.SchedulerTask;
 import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.deployment.util.Utils;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.Flow;
-import org.apache.axis2.description.ModuleDescription;
-import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.AxisConfigurationImpl;
 import org.apache.axis2.i18n.Messages;
@@ -41,19 +37,8 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
+import java.io.*;
+import java.util.*;
 
 
 public class DeploymentEngine implements DeploymentConstants {
@@ -216,6 +201,7 @@
             throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.PATH_TO_CONFIG_CAN_NOT_B_NULL));
         }
         File tempfile = new File(engineConfigName);
+        RepositoryListenerImpl repoListener = null;
         try {
             InputStream in = new FileInputStream(tempfile);
             axisConfig = createEngineConfig();
@@ -228,11 +214,7 @@
             throw new DeploymentException(e);
         }
         setDeploymentFeatures();
-        if (hotDeployment) {
-            startSearch(this);
-        } else {
-            new RepositoryListenerImpl(folderName, this);
-        }
+        repoListener = new RepositoryListenerImpl(folderName, this);
         try {
             ((AxisConfigurationImpl) axisConfig).setRepository(axis2repository);
             validateSystemPredefinedPhases();
@@ -241,6 +223,10 @@
             log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED, axisFault.getMessage()));
             throw new DeploymentException(axisFault);
         }
+        repoListener.checkServices();
+        if (hotDeployment) {
+            startSearch(repoListener);
+        }
         return axisConfig;
     }
 
@@ -249,6 +235,7 @@
         InputStream in;
         axis2repository = clientHome;
         boolean isRepositoryExist = false;
+        RepositoryListenerImpl repoListener = null;
         if (!(clientHome == null || clientHome.trim().equals(""))) {
             checkClientHome(clientHome);
             isRepositoryExist = true;
@@ -272,7 +259,7 @@
             hotUpdate = false;
             //setting CLs
             setClassLoaders(repository);
-            new RepositoryListenerImpl(folderName, this);
+            repoListener = new RepositoryListenerImpl(folderName, this);
         }
         try {
             ((AxisConfigurationImpl) axisConfig).setRepository(axis2repository);
@@ -281,6 +268,9 @@
             log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED, axisFault.getMessage()));
             throw new DeploymentException(axisFault);
         }
+        if (repoListener != null) {
+            repoListener.checkServices();
+        }
         return axisConfig;
     }
 
@@ -329,7 +319,7 @@
      * are exist , or they have deployed
      */
     private void engageModules() throws AxisFault {
-        // ArrayList modules = DeploymentData.getInstance().getModules();
+        // ArrayList modules = DeploymentData.getInstance().getModuleRefs();
         // PhaseResolver resolver = new PhaseResolver(axisConfig);
         for (Iterator iterator = modulelist.iterator(); iterator.hasNext();) {
             QName name = (QName) iterator.next();
@@ -365,9 +355,9 @@
      * this method use to start the Deployment engine
      * inorder to perform Hot deployment and so on..
      */
-    private void startSearch(DeploymentEngine engine) {
+    private void startSearch(RepositoryListener listener) {
         Scheduler scheduler = new Scheduler();
-        scheduler.schedule(new SchedulerTask(engine, folderName),
+        scheduler.schedule(new SchedulerTask(listener),
                 new DeploymentIterator());
     }
 
@@ -375,32 +365,39 @@
         return new AxisConfigurationImpl();
     }
 
+    private void addServiceGroup(AxisServiceGroup serviceGroup, ArrayList serviceList)
+            throws AxisFault {
+        serviceGroup.setParent(axisConfig);
+        //engaging globally engage module to this service group
+        Iterator itr_global_modules =
+                ((AxisConfigurationImpl) axisConfig).getEngadgedModules().iterator();
+        while (itr_global_modules.hasNext()) {
+            QName qName = (QName) itr_global_modules.next();
+            serviceGroup.engageModuleToGroup(qName);
+        }
+
+        //module from services.xml at serviceGroup level
+        ArrayList groupModules = serviceGroup.getModuleRefs();
+        for (int i = 0; i < groupModules.size(); i++) {
+            QName moduleName = (QName) groupModules.get(i);
+            ModuleDescription module = axisConfig.getModule(moduleName);
+            if (module != null) {
+                serviceGroup.engageModuleToGroup(moduleName);
+            } else {
+                throw new DeploymentException(Messages.getMessage(
+                        DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE,
+                        serviceGroup.getServiceGroupName()
+                        , moduleName.getLocalPart()));
+            }
+        }
 
-    private void addServiceGroup(AxisServiceGroup serviceGroup,
-                                 ArrayList service) throws AxisFault {
-//        Iterator services = currentArchiveFile.getService().values().iterator();
-        Iterator services = service.iterator();//              currentArchiveFile.getDeploybleServices().iterator();
+        Iterator services = serviceList.iterator();
         while (services.hasNext()) {
             AxisService axisService = (AxisService) services.next();
-//            loadServiceProperties(axisService);
             Utils.loadServiceProperties(axisService);
             axisService.setFileName(
                     currentArchiveFile.getFile().getAbsolutePath());
-
-            //module form serviceGroup
-            ArrayList groupModules = serviceGroup.getModules();
-            for (int i = 0; i < groupModules.size(); i++) {
-                ModuleDescription module =
-                        axisConfig.getModule((QName) groupModules.get(i));
-                if (module == null) {
-                    throw new DeploymentException(Messages.getMessage(
-                            DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE,
-                            axisService.getName().getLocalPart(),
-                            ((QName) groupModules.get(i)).getLocalPart()));
-                }
-                axisService.engageModule(module, axisConfig);
-            }
-
+            serviceGroup.addService(axisService);
             //modules from <service>
             ArrayList list = axisService.getModules();
             for (int i = 0; i < list.size(); i++) {
@@ -424,7 +421,7 @@
                     QName moduleName = (QName) modules.get(i);
                     ModuleDescription module = axisConfig.getModule(moduleName);
                     if (module != null) {
-                        opDesc.engageModule(module,axisConfig);
+                        opDesc.engageModule(module, axisConfig);
                     } else {
                         throw new DeploymentException(Messages.getMessage(
                                 DeploymentErrorMsgs.BAD_MODULE_FROM_OPERATION,
@@ -434,33 +431,30 @@
                 }
 
             }
-            serviceGroup.addService(axisService);
         }
         axisConfig.addServiceGroup(serviceGroup);
     }
 
 
-
-
     private void addNewModule(ModuleDescription modulemetadata) throws AxisFault {
         // currentArchiveFile.setClassLoader();
         Flow inflow = modulemetadata.getInFlow();
         ClassLoader moduleClassLoader = modulemetadata.getModuleClassLoader();
         if (inflow != null) {
-            Utils.addFlowHandlers(inflow,moduleClassLoader);
+            Utils.addFlowHandlers(inflow, moduleClassLoader);
         }
         Flow outFlow = modulemetadata.getOutFlow();
         if (outFlow != null) {
-            Utils.addFlowHandlers(outFlow,moduleClassLoader);
+            Utils.addFlowHandlers(outFlow, moduleClassLoader);
         }
         Flow faultInFlow = modulemetadata.getFaultInFlow();
         if (faultInFlow != null) {
-            Utils.addFlowHandlers(faultInFlow,moduleClassLoader);
+            Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
         }
 
         Flow faultOutFlow = modulemetadata.getFaultOutFlow();
         if (faultOutFlow != null) {
-            Utils.addFlowHandlers(faultOutFlow,moduleClassLoader);
+            Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
         }
 //        modulemetadata.setModuleClassLoader(currentArchiveFile.getClassLoader());
         axisConfig.addModule(modulemetadata);
@@ -493,7 +487,7 @@
                     StringWriter errorWriter = new StringWriter();
                     switch (type) {
                         case SERVICE:
-                            currentArchiveFile.setClassLoader(explodedDir,axisConfig.getServiceClassLoader());
+                            currentArchiveFile.setClassLoader(explodedDir, axisConfig.getServiceClassLoader());
                             archiveReader = new ArchiveReader();
                             String serviceStatus = "";
                             try {
@@ -502,11 +496,11 @@
                                 AxisServiceGroup sericeGroup =
                                         new AxisServiceGroup(axisConfig);
                                 sericeGroup.setServiceGroupClassLoader(axisConfig.getServiceClassLoader());
-                                ArrayList serviceList   = archiveReader.processServiceGroup(
+                                ArrayList serviceList = archiveReader.processServiceGroup(
                                         currentArchiveFile.getAbsolutePath(),
                                         this,
-                                        sericeGroup, explodedDir,wsdlservice,axisConfig);
-                                addServiceGroup(sericeGroup,serviceList);
+                                        sericeGroup, explodedDir, wsdlservice, axisConfig);
+                                addServiceGroup(sericeGroup, serviceList);
                                 log.info(Messages.getMessage(
                                         DeploymentErrorMsgs.DEPLOYING_WS, currentArchiveFile.getName()));
                             } catch (DeploymentException de) {
@@ -516,7 +510,6 @@
                                 de.printStackTrace(error_ptintWriter);
                                 serviceStatus = "Error:\n" +
                                         errorWriter.toString();
-                                de.printStackTrace();
                             } catch (AxisFault axisFault) {
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
                                         currentArchiveFile.getName(), axisFault.getMessage()));
@@ -541,7 +534,7 @@
                             }
                             break;
                         case MODULE:
-                            currentArchiveFile.setClassLoader(explodedDir,axisConfig.getModuleClassLoader());
+                            currentArchiveFile.setClassLoader(explodedDir, axisConfig.getModuleClassLoader());
                             archiveReader = new ArchiveReader();
                             String moduleStatus = "";
                             try {
@@ -550,7 +543,7 @@
                                 metaData.setParent(axisConfig);
                                 archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(),
                                         this,
-                                        metaData, explodedDir,axisConfig);
+                                        metaData, explodedDir, axisConfig);
                                 addNewModule(metaData);
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_MODULE,
                                         metaData.getName().getLocalPart()));
@@ -688,7 +681,7 @@
             currentArchiveFile = new ArchiveFileData(SERVICE, "");
             currentArchiveFile.setClassLoader(classLoader);
 
-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream,axisConfig, axisService);
+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, axisConfig, axisService);
             builder.populateService(builder.buildOM());
             Utils.loadServiceProperties(axisService);
         } catch (AxisFault axisFault) {
@@ -716,23 +709,23 @@
             axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
             ArchiveReader archiveReader = new ArchiveReader();
             ClassLoader moduleClassLoader = config.getModuleClassLoader();
-            currentArchiveFile.setClassLoader(false,moduleClassLoader);
-            archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule, false,axisConfig);
+            currentArchiveFile.setClassLoader(false, moduleClassLoader);
+            archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule, false, axisConfig);
             Flow inflow = axismodule.getInFlow();
             if (inflow != null) {
-                Utils.addFlowHandlers(inflow,moduleClassLoader);
+                Utils.addFlowHandlers(inflow, moduleClassLoader);
             }
             Flow outFlow = axismodule.getOutFlow();
             if (outFlow != null) {
-                Utils.addFlowHandlers(outFlow,moduleClassLoader);
+                Utils.addFlowHandlers(outFlow, moduleClassLoader);
             }
             Flow faultInFlow = axismodule.getFaultInFlow();
             if (faultInFlow != null) {
-                Utils.addFlowHandlers(faultInFlow,moduleClassLoader);
+                Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
             }
             Flow faultOutFlow = axismodule.getFaultOutFlow();
             if (faultOutFlow != null) {
-                Utils.addFlowHandlers(faultOutFlow,moduleClassLoader);
+                Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
             }
 //            loadModuleClass(axismodule);
         } catch (AxisFault axisFault) {

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=349418&r1=349417&r2=349418&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 Mon Nov 28 08:19:26 2005
@@ -89,11 +89,8 @@
      */
     public void checkServices() {
         String modulepath = folderName + SERVICE_PATH;
-
-        // exploded dir
-        //searchExplodedDir(modulepath);
-        //service archives
         searchWS(modulepath);
+        update();
     }
 
     /**
@@ -114,7 +111,7 @@
     public void init() {
         wsInfoList.init();
         checkModules();
-        checkServices();
+//        checkServices();
         update();
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/scheduler/SchedulerTask.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/scheduler/SchedulerTask.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/scheduler/SchedulerTask.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/scheduler/SchedulerTask.java Mon Nov 28 08:19:26 2005
@@ -38,8 +38,8 @@
      * Creates a new scheduler task.
      */
 
-    public SchedulerTask(DeploymentEngine deploy_engine, String folderName ) {
-        wsListener = new RepositoryListenerImpl(folderName, deploy_engine);
+    public SchedulerTask(RepositoryListener listener) {
+        this.wsListener =listener;
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java Mon Nov 28 08:19:26 2005
@@ -19,6 +19,8 @@
 import org.apache.wsdl.WSDLOperation;
 import org.apache.wsdl.WSDLProperty;
 import org.apache.wsdl.impl.WSDLOperationImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.w3c.dom.Document;
 
 import javax.xml.namespace.QName;
@@ -49,6 +51,7 @@
 public abstract class AxisOperation  implements
         ParameterInclude, DescriptionConstants,
         WSDLConstants ,WSDLOperation{
+    private Log log = LogFactory.getLog(getClass());
 
     private MessageReceiver messageReceiver;
     private ArrayList remainingPhasesInFlow;
@@ -69,6 +72,8 @@
     private ArrayList modulerefs;
     //to hide control operation , operation which added by RM like module
     private boolean controlOperation = false;
+    //to store engaged modules
+    private ArrayList engagedModules = new ArrayList();
 
 
 
@@ -76,7 +81,6 @@
         this.wsdlopeartion = (WSDLOperationImpl)wsdlopeartion;
         this.setMessageExchangePattern(MEP_URI_IN_OUT);
         this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
-        this.setComponentProperty(MODULEREF_KEY, new ArrayList());
 
         remainingPhasesInFlow = new ArrayList();
         remainingPhasesInFlow.add(
@@ -116,38 +120,20 @@
         if (moduleref == null) {
             return;
         }
-        Collection collectionModule = (Collection) this.getComponentProperty(
-                MODULEREF_KEY);
-        for (Iterator iterator = collectionModule.iterator();
-             iterator.hasNext();) {
-            ModuleDescription modu = (ModuleDescription) iterator.next();
-            if (modu.getName().equals(moduleref.getName())) {
-                throw new AxisFault(moduleref.getName().getLocalPart() +
+      Iterator module_itr =  engagedModules.iterator();
+        while (module_itr.hasNext()) {
+            ModuleDescription module = (ModuleDescription) module_itr.next();
+            if (module.getName().equals(moduleref.getName())) {
+                log.info(moduleref.getName().getLocalPart() +
                         " module has alredy engaged to the operation" +
                         "  operation terminated !!!");
+//                return;
             }
-
         }
         new PhaseResolver(axisConfig).engageModuleToOperation(this, moduleref);
-        collectionModule.add(moduleref);
-    }
-
-    public final void addToEngageModuleList(ModuleDescription moduleName) {
-        Collection collectionModule = (Collection) this.getComponentProperty(
-                MODULEREF_KEY);
-        for (Iterator iterator = collectionModule.iterator();
-             iterator.hasNext();) {
-            ModuleDescription moduleDescription = (ModuleDescription) iterator.next();
-            if (moduleName.getName().equals(moduleDescription.getName())) {
-                return;
-            }
-        }
-        collectionModule.add(moduleName);
+        engagedModules.add(moduleref);
     }
 
-
-
-
     /*
     * (non-Javadoc)
     *
@@ -158,8 +144,8 @@
      * Method getEngadgedModules
      *
      */
-    public Collection getModules() {
-        return (Collection) this.getComponentProperty(MODULEREF_KEY);
+    public Collection getEngagedModules() {
+        return engagedModules;
     }
 
     /**
@@ -348,7 +334,7 @@
      * Depending on the mep operation description know how to fill the message conetxt map
      * in operationContext.
      * As an exmple if the MEP is IN-OUT then depending on messagelbl operation description
-     * should know how to keep them in corret locations 
+     * should know how to keep them in corret locations
      * @param msgContext <code>MessageContext</code>
      * @param opContext  <code>OperationContext</code>
      * @throws AxisFault <code>AxisFault</code>

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Mon Nov 28 08:19:26 2005
@@ -23,7 +23,6 @@
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.om.OMElement;
-import org.apache.axis2.phaseresolver.PhaseResolver;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.wsdl.*;
@@ -72,7 +71,10 @@
     private HashMap wasaction_opeartionmap = null;
 
     //to store module ref at deploy time parsing
-    private ArrayList mdoulesList = new ArrayList();
+    private ArrayList moduleRefs = new ArrayList();
+
+    //to store engaged mdodules
+    private ArrayList engagedModules = new ArrayList();
 
 
     /**
@@ -82,7 +84,6 @@
     public AxisService(WSDLServiceImpl serviceimpl) {
         this.serviceimpl = serviceimpl;
         this.wasaction_opeartionmap = new HashMap();
-        this.setComponentProperty(MODULEREF_KEY, new ArrayList());
         this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
         this.setServiceInterface(new WSDLInterfaceImpl());
         moduleConfigmap = new HashMap();
@@ -92,7 +93,6 @@
     public AxisService() {
         this.serviceimpl = new WSDLServiceImpl();
         this.wasaction_opeartionmap = new HashMap();
-        this.setComponentProperty(MODULEREF_KEY, new ArrayList());
         this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
         this.setServiceInterface(new WSDLInterfaceImpl());
         moduleConfigmap = new HashMap();
@@ -111,35 +111,38 @@
     /*
     * (non-Javadoc)
     *
-    * @see org.apache.axis2.description.AxisService#addModule(javax.xml.namespace.QName)
+    * @see org.apache.axis2.description.AxisService#addToengagedModules(javax.xml.namespace.QName)
     */
 
     /**
      * To ebgage a module it is reuired to use this method
      *
      * @param moduleref
-     * @throws AxisFault
      */
     public void engageModule(ModuleDescription moduleref,
-                             AxisConfiguration axisConfig)
-            throws AxisFault {
+                             AxisConfiguration axisConfig) throws AxisFault {
         if (moduleref == null) {
             return;
         }
-        Collection collectionModule = (Collection) this.getComponentProperty(
-                MODULEREF_KEY);
-        for (Iterator iterator = collectionModule.iterator();
-             iterator.hasNext();) {
-            ModuleDescription modu = (ModuleDescription) iterator.next();
-            if (modu.getName().equals(moduleref.getName())) {
-                throw new AxisFault(moduleref.getName().getLocalPart() +
+        Iterator itr_engageModules = engagedModules.iterator();
+        while (itr_engageModules.hasNext()) {
+            ModuleDescription module = (ModuleDescription) itr_engageModules.next();
+            if (module.getName().equals(moduleref.getName())) {
+                log.info(moduleref.getName().getLocalPart() +
                         " module has alredy been engaged on the service. " +
                         " Operation terminated !!!");
+//                return;
             }
+        }
+//adding module operations
+        addModuleOperations(moduleref, axisConfig);
 
+        Iterator operations = getOperations().values().iterator();
+        while (operations.hasNext()) {
+            AxisOperation axisOperation = (AxisOperation) operations.next();
+            axisOperation.engageModule(moduleref, axisConfig);
         }
-        new PhaseResolver(axisConfig).engageModuleToService(this, moduleref);
-        collectionModule.add(moduleref);
+        engagedModules.add(moduleref);
     }
 
     /**
@@ -152,47 +155,52 @@
                                     AxisConfiguration axisConfig) throws AxisFault {
         HashMap map = module.getOperations();
         Collection col = map.values();
-//        PhaseResolver pr = new PhaseResolver(axisConfig, this);
         for (Iterator iterator = col.iterator(); iterator.hasNext();) {
-            AxisOperation axisOperation = (AxisOperation) iterator.next();
+            AxisOperation axisOperation = copyOperation((AxisOperation) iterator.next());
             ArrayList wsamappings = axisOperation.getWsamappingList();
             for (int j = 0; j < wsamappings.size(); j++) {
                 Parameter paramter = (Parameter) wsamappings.get(j);
                 this.addMapping((String) paramter.getValue(), axisOperation);
             }
-//            pr.buildModuleOperation(axisOperation);
             //this opration is a control opeartion.
             axisOperation.setControlOperation(true);
             this.addOperation(axisOperation);
         }
     }
 
-    public void addToEngagModuleList(ModuleDescription moduleName) {
-        Collection collectionModule = (Collection) this.getComponentProperty(
-                MODULEREF_KEY);
-        for (Iterator iterator = collectionModule.iterator();
-             iterator.hasNext();) {
-            ModuleDescription moduleDescription = (ModuleDescription) iterator.next();
-            if (moduleName.getName().equals(moduleDescription.getName())) {
-                return;
-            }
-        }
-        collectionModule.add(moduleName);
+    /**
+     * To get a copy from module operation
+     *
+     * @param axisOperation
+     * @return
+     * @throws AxisFault
+     */
+    private AxisOperation copyOperation(AxisOperation axisOperation) throws AxisFault {
+        AxisOperation operation = AxisOperationFactory.getOperetionDescription(
+                axisOperation.getMessageExchangePattern());
+        operation.setMessageReceiver(axisOperation.getMessageReceiver());
+        operation.setName(axisOperation.getName());
+        operation.setStyle(axisOperation.getStyle());
+        Iterator parameters = axisOperation.getParameters().iterator();
+        while (parameters.hasNext()) {
+            Parameter parameter = (Parameter) parameters.next();
+            operation.addParameter(parameter);
+        }
+        operation.setWsamappingList(axisOperation.getWsamappingList());
+        operation.setRemainingPhasesInFlow(axisOperation.getRemainingPhasesInFlow());
+        operation.setPhasesInFaultFlow(axisOperation.getPhasesInFaultFlow());
+        operation.setPhasesOutFaultFlow(axisOperation.getPhasesOutFaultFlow());
+        operation.setPhasesOutFlow(axisOperation.getPhasesOutFlow());
+        return operation;
     }
 
-    /*
-    * (non-Javadoc)
-    *
-    * @see org.apache.axis2.description.AxisService#getEngadgedModules()
-    */
-
     /**
      * Method getEngadgedModules
      *
      * @return Collection
      */
     public Collection getEngagedModules() {
-        return (Collection) this.getComponentProperty(MODULEREF_KEY);
+        return engagedModules;
     }
 
     /**
@@ -237,7 +245,6 @@
      */
     public void addOperation(AxisOperation axisOperation) {
         axisOperation.setParent(this);
-        //todo phase resolving and module engagement :
         Iterator modules = getEngagedModules().iterator();
         while (modules.hasNext()) {
             ModuleDescription module = (ModuleDescription) modules.next();
@@ -529,29 +536,29 @@
 
     public ArrayList getPublishedOperations() {
         Iterator op_itr = getOperations().values().iterator();
-        ArrayList operationList= new ArrayList();
+        ArrayList operationList = new ArrayList();
         while (op_itr.hasNext()) {
             AxisOperation operation = (AxisOperation) op_itr.next();
-            if(!operation.isControlOperation()){
+            if (!operation.isControlOperation()) {
                 operationList.add(operation);
             }
         }
-       return operationList;
+        return operationList;
     }
 
     /**
      * To get the control operation which are added by module like RM
      */
-    public ArrayList getControlOperations(){
-       Iterator op_itr = getOperations().values().iterator();
-        ArrayList operationList= new ArrayList();
+    public ArrayList getControlOperations() {
+        Iterator op_itr = getOperations().values().iterator();
+        ArrayList operationList = new ArrayList();
         while (op_itr.hasNext()) {
             AxisOperation operation = (AxisOperation) op_itr.next();
-            if(operation.isControlOperation()){
+            if (operation.isControlOperation()) {
                 operationList.add(operation);
             }
         }
-       return operationList;
+        return operationList;
     }
 
     public AxisOperation getOperation(String ncName) {
@@ -879,11 +886,11 @@
 
 
     public void addModuleref(QName moduleref) {
-        mdoulesList.add(moduleref);
+        moduleRefs.add(moduleref);
     }
 
     public ArrayList getModules() {
-        return mdoulesList;
+        return moduleRefs;
     }
 
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java Mon Nov 28 08:19:26 2005
@@ -51,8 +51,8 @@
     //to store modeule configuration info
     private HashMap moduleConfigmap;
 
-    // to store service Group modules name
-    private ArrayList modules;
+    // to store service Group engagedModules name
+    private ArrayList engagedModules;
 
     //to store module ref at deploy time parsing
     private ArrayList mdoulesList = new ArrayList();
@@ -64,7 +64,7 @@
         paramInclude = new ParameterIncludeImpl();
         services = new HashMap();
         moduleConfigmap = new HashMap();
-        modules = new ArrayList();
+        engagedModules = new ArrayList();
     }
 
     public AxisServiceGroup(AxisConfiguration axisDescription) {
@@ -135,43 +135,42 @@
         return (ModuleConfiguration) moduleConfigmap.get(moduleName);
     }
 
-    public void addModule(QName moduleName) {
-        modules.add(moduleName);
+    public void addToengagedModules(QName moduleName) {
+        engagedModules.add(moduleName);
     }
 
-    public void engageModuleToGroup(QName moduleName) throws AxisFault {
+    public void engageModuleToGroup(QName moduleName)  {
         if (moduleName == null) {
             return;
         }
-        for (Iterator iterator = modules.iterator();
+        for (Iterator iterator = engagedModules.iterator();
              iterator.hasNext();) {
             QName modu = (QName) iterator.next();
             if (modu.getLocalPart().equals(moduleName.getLocalPart())) {
-                throw new AxisFault(moduleName.getLocalPart() +
+                log.info(moduleName.getLocalPart() +
                         " module has alredy been engaged on the service Group. " +
                         " Operation terminated !!!");
+                //return;
             }
         }
         Iterator srevice = getServices();
-//        PhaseResolver phaseResolver = new PhaseResolver(this.getParent());
-        ModuleDescription module = this.parent.getModule(moduleName);
+        ModuleDescription module = parent.getModule(moduleName);
         if (module != null) {
             while (srevice.hasNext()) {
                 // engagin per each service
                 AxisService axisService = (AxisService) srevice.next();
                 try {
-                    axisService.engageModule(module, this.getParent());
+                    axisService.engageModule(module, parent);
                 } catch (AxisFault axisFault) {
                     log.info(axisFault.getMessage());
                 }
-//                phaseResolver.engageModuleToService(axisService, module);
             }
         }
-        addModule(moduleName);
+        addToengagedModules(moduleName);
     }
 
-    public ArrayList getServiceGroupModules() {
-        return modules;
+    public ArrayList getEngagedModules() {
+        return engagedModules;
     }
 
 
@@ -180,11 +179,10 @@
     }
 
     public synchronized void addService(AxisService service) throws AxisFault {
-        services.put(service.getName(), service);
         service.setParent(this);
         AxisConfiguration axisConfig = getParent();
         if (axisConfig != null) {
-            Iterator modules = getModules().iterator();
+            Iterator modules = getEngagedModules().iterator();
             while (modules.hasNext()) {
                 QName moduleName = (QName) modules.next();
                 ModuleDescription moduleDesc = axisConfig.getModule(moduleName);
@@ -196,9 +194,8 @@
                 }
             }
         }
-//        PhaseResolver handlerResolver = new PhaseResolver(this.parent, service);
-//        handlerResolver.buildchains();
         service.setLastupdate();
+        services.put(service.getName(), service);
     }
 
     public AxisConfiguration getAxisDescription() {
@@ -217,7 +214,7 @@
         mdoulesList.add(moduleref);
     }
 
-    public ArrayList getModules() {
+    public ArrayList getModuleRefs() {
         return mdoulesList;
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java Mon Nov 28 08:19:26 2005
@@ -23,7 +23,6 @@
 import org.apache.axis2.description.*;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.phaseresolver.PhaseMetadata;
-import org.apache.axis2.phaseresolver.PhaseResolver;
 import org.apache.axis2.util.HostConfiguration;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -225,6 +224,7 @@
 
     public void addServiceGroup(AxisServiceGroup axisServiceGroup) throws AxisFault {
         Iterator services = axisServiceGroup.getServices();
+        axisServiceGroup.setParent(this);
         AxisService description;
         while (services.hasNext()) {
             description = (AxisService) services.next();
@@ -436,7 +436,6 @@
     public void engageModule(QName moduleref) throws AxisFault {
         ModuleDescription module = getModule(moduleref);
         boolean isNewmodule = false;
-        boolean tobeEngaged = true;
         if (module == null) {
             File file = new ArchiveReader().creatModuleArchivefromResource(
                     moduleref.getLocalPart(), getRepository());
@@ -448,9 +447,8 @@
                  iterator.hasNext();) {
                 QName qName = (QName) iterator.next();
                 if (moduleref.equals(qName)) {
-                    tobeEngaged = false;
-                    //Instead of throwing the error, we can just log this problem
                     log.info("Attempt to engage an already engaged module " + qName);
+                    return;
                 }
             }
         } else {
@@ -459,14 +457,15 @@
                             + moduleref.getLocalPart() +
                             " has not bean deployed yet !");
         }
-        if (tobeEngaged) {
-            Iterator sgs = getServiceGroups();
-            new PhaseResolver(this).engageModuleGlobally(module);
-            engagedModules.add(moduleref);
+        Iterator servicegroups = getServiceGroups();
+        while (servicegroups.hasNext()) {
+            AxisServiceGroup serviceGroup = (AxisServiceGroup) servicegroups.next();
+            serviceGroup.engageModuleToGroup(module.getName());
         }
         if (isNewmodule) {
             addModule(module);
         }
+        engagedModules.add(moduleref);
     }
 
     //to get all the services in the system

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Phase.java Mon Nov 28 08:19:26 2005
@@ -285,7 +285,8 @@
         while (handlers_itr.hasNext()) {
             Handler hand = (Handler) handlers_itr.next();
             HandlerDescription handlerDesc = hand.getHandlerDesc();
-            if (handler.equals(handlerDesc)) {
+            if( handler.getName().getLocalPart().equals(handlerDesc.getName().getLocalPart())){
+//            if (handler.equals(handlerDesc)) {
                 //tryting to add the same handler twice to the phase
                 // this is can happen due to we are allowing service specifc module
                 //to add hndlers into gloal chain

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/phaseresolver/PhaseResolver.java Mon Nov 28 08:19:26 2005
@@ -16,12 +16,9 @@
 
 package org.apache.axis2.phaseresolver;
 
-import org.apache.axis2.AxisFault;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
 import org.apache.axis2.engine.Phase;
-import org.apache.axis2.phaseresolver.util.PhaseValidator;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -43,9 +40,6 @@
     private static final int IN_FLOW = 1;
     private static final int OUT_FAULT_FLOW = 5;
 
-    public PhaseResolver() {
-    }
-
     /**
      * default constructor , to obuild chains for GlobalDescription
      *
@@ -84,7 +78,7 @@
             throws PhaseException {
         Flow flow = null;
         Phase phase = null;
-        for (int type = IN_FLOW; type < 4; type++) {
+        for (int type = IN_FLOW; type < OUT_FAULT_FLOW; type++) {
             switch (type) {
                 case PhaseMetadata.IN_FLOW: {
                     flow = transport.getInFlow();
@@ -147,199 +141,6 @@
         }
     }
 
-
-    public void engageModuleGlobally(ModuleDescription module) throws AxisFault {
-        enageToGlobalChain(module);
-        Iterator servicegroups = axisConfig.getServiceGroups();
-        while (servicegroups.hasNext()) {
-            AxisServiceGroup serviceGroup = (AxisServiceGroup) servicegroups.next();
-            Iterator services = serviceGroup.getServices();
-            while (services.hasNext()) {
-                AxisService axisService = (AxisService) services.next();
-                axisService.addModuleOperations(module, axisConfig);
-                engageModuleToServiceFromGlobal(axisService, module);
-                axisService.addToEngagModuleList(module);
-            }
-            serviceGroup.addModule(module.getName());
-        }
-    }
-
-    /**
-     * To engage modules come form global
-     *
-     * @param service
-     * @param module
-     * @throws PhaseException
-     */
-    public void engageModuleToServiceFromGlobal(AxisService service,
-                                                ModuleDescription module) throws PhaseException {
-        HashMap opeartions = service.getOperations();
-        Collection opCol = opeartions.values();
-        boolean engaged = false;
-        for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
-            AxisOperation opDesc = (AxisOperation) iterator.next();
-            Collection modules = opDesc.getModules();
-            for (Iterator iterator1 = modules.iterator();
-                 iterator1.hasNext();) {
-                ModuleDescription description = (ModuleDescription) iterator1.next();
-                if (description.getName().equals(module.getName())) {
-                    engaged = true;
-                    break;
-                }
-            }
-            if (engaged) {
-                continue;
-            }
-            Flow flow = null;
-            for (int type = IN_FLOW; type < OUT_FAULT_FLOW; type++) {
-                switch (type) {
-                    case PhaseMetadata.IN_FLOW: {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getRemainingPhasesInFlow());
-                        break;
-                    }
-                    case PhaseMetadata.OUT_FLOW: {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getPhasesOutFlow());
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_IN_FLOW: {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getPhasesInFaultFlow());
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_OUT_FLOW: {
-                        phaseHolder =
-                                new PhaseHolder(opDesc.getPhasesOutFaultFlow());
-                        break;
-                    }
-                }
-                ////////////////////////////////////////////////////////////////////////////////////
-                /////////////////// Modules refered by axis2.xml //////////////////////////////////
-                ////////////////////////////////////////////////////////////////////////////////////
-                switch (type) {
-                    case PhaseMetadata.IN_FLOW: {
-                        flow = module.getInFlow();
-                        break;
-                    }
-                    case PhaseMetadata.OUT_FLOW: {
-                        flow = module.getOutFlow();
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_IN_FLOW: {
-                        flow = module.getFaultInFlow();
-                        break;
-                    }
-                    case PhaseMetadata.FAULT_OUT_FLOW: {
-                        flow = module.getFaultOutFlow();
-                        break;
-                    }
-                }
-                if (flow != null) {
-                    for (int j = 0; j < flow.getHandlerCount(); j++) {
-                        HandlerDescription metadata = flow.getHandler(j);
-                        if (!PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
-                            phaseHolder.addHandler(metadata);
-                        }
-                    }
-                }
-            }
-            opDesc.addToEngageModuleList(module);
-        }
-    }
-
-
-    private void enageToGlobalChain(ModuleDescription module) throws PhaseException {
-        Flow flow = null;
-        for (int type = IN_FLOW; type < OUT_FAULT_FLOW; type++) {
-            switch (type) {
-                case PhaseMetadata.IN_FLOW: {
-                    phaseHolder =
-                            new PhaseHolder(axisConfig.
-                                    getInPhasesUptoAndIncludingPostDispatch());
-                    break;
-                }
-                case PhaseMetadata.OUT_FLOW: {
-                    phaseHolder =
-                            new PhaseHolder(((AxisConfigurationImpl) axisConfig).getOutFlow());
-                    break;
-                }
-                case PhaseMetadata.FAULT_IN_FLOW: {
-                    phaseHolder =
-                            new PhaseHolder(axisConfig.getInFaultFlow());
-                    break;
-                }
-                case PhaseMetadata.FAULT_OUT_FLOW: {
-                    phaseHolder =
-                            new PhaseHolder(((AxisConfigurationImpl) axisConfig).getOutFaultFlow());
-                    break;
-                }
-            }
-            ////////////////////////////////////////////////////////////////////////////////////
-            /////////////////// Modules refered by axis2.xml //////////////////////////////////
-            ////////////////////////////////////////////////////////////////////////////////////
-            switch (type) {
-                case PhaseMetadata.IN_FLOW: {
-                    flow = module.getInFlow();
-                    break;
-                }
-                case PhaseMetadata.OUT_FLOW: {
-                    flow = module.getOutFlow();
-                    break;
-                }
-                case PhaseMetadata.FAULT_IN_FLOW: {
-                    flow = module.getFaultInFlow();
-                    break;
-                }
-                case PhaseMetadata.FAULT_OUT_FLOW: {
-                    flow = module.getFaultOutFlow();
-                    break;
-                }
-            }
-            if (flow != null) {
-                for (int j = 0; j < flow.getHandlerCount(); j++) {
-                    HandlerDescription metadata = flow.getHandler(j);
-                    if (PhaseValidator.isSystemPhases(metadata.getRules().getPhaseName())) {
-                        phaseHolder.addHandler(metadata);
-                    } else {
-                        /**
-                         * These handlers will go to operation's handler chains , since the module
-                         * try to add handlres to both sytem predefined phases and user defined phase
-                         * so global module can do that. here the global module are the module which are
-                         * reffred by axis2.xml
-                         */
-                    }
-                }
-            }
-        }
-    }
-
-
-    public void engageModuleToService(AxisService service,
-                                      ModuleDescription module) throws AxisFault {
-        HashMap opeartions = service.getOperations();
-        Collection opCol = opeartions.values();
-        boolean engaged = false;
-        service.addModuleOperations(module, axisConfig);
-        for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
-            AxisOperation opDesc = (AxisOperation) iterator.next();
-            Collection modules = opDesc.getModules();
-            for (Iterator iterator1 = modules.iterator();
-                 iterator1.hasNext();) {
-                ModuleDescription description = (ModuleDescription) iterator1.next();
-                if (description.getName().equals(module.getName())) {
-                    engaged = true;
-                    break;
-                }
-            }
-            if (!engaged) {
-                engageModuleToOperation(opDesc, module);
-                opDesc.addToEngageModuleList(module);
-            }
-        }
-    }
-
-
     public void engageModuleToOperation(AxisOperation axisOperation,
                                         ModuleDescription module) throws PhaseException {
         Flow flow = null;
@@ -348,7 +149,8 @@
                 case PhaseMetadata.IN_FLOW: {
                     ArrayList phases = new ArrayList();
                     if (axisConfig != null) {
-                        Iterator itr_axis_config = axisConfig.getInPhasesUptoAndIncludingPostDispatch().iterator();
+                        Iterator itr_axis_config =
+                                axisConfig.getInPhasesUptoAndIncludingPostDispatch().iterator();
                         while (itr_axis_config.hasNext()) {
                             Object o = itr_axis_config.next();
                             phases.add(o);
@@ -383,7 +185,7 @@
                         phases.add(o);
                     }
                     phaseHolder =
-                            new PhaseHolder(axisOperation.getPhasesInFaultFlow());
+                            new PhaseHolder(phases);
                     break;
                 }
                 case PhaseMetadata.FAULT_OUT_FLOW: {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java Mon Nov 28 08:19:26 2005
@@ -85,18 +85,16 @@
     /**
      * Field allowListServices
      */
-    private final boolean allowListServices = true;
 
     /**
      * Field allowListSingleService
      */
-    private final boolean allowListSingleService = true;
     private OutputStream out = null;
 
     public void handle(HttpServletRequest httpServletRequest,
                        HttpServletResponse httpServletResponse,
                        OutputStream out)
-            throws IOException,Exception {
+            throws IOException, Exception {
         this.out = out;
         String filePart = httpServletRequest.getRequestURL().toString();
         if ((filePart != null) &&
@@ -124,7 +122,7 @@
                 filePart.endsWith(Constants.ENGAGE_MODULE_TO_SERVICE)) {
             engageModulesToService(httpServletRequest, httpServletResponse);
             return;
-        }  else if ((filePart != null) &&
+        } else if ((filePart != null) &&
                 filePart.endsWith(Constants.ENGAGE_MODULE_TO_SERVICE_GROUP)) {
             engageModulesToServiceGroup(httpServletRequest, httpServletResponse);
             return;
@@ -158,7 +156,7 @@
                 filePart.endsWith(Constants.REMOVE_SERVICE)) {
             removeService(httpServletRequest, httpServletResponse);
             return;
-        }else if ((filePart != null) &&
+        } else if ((filePart != null) &&
                 filePart.endsWith(Constants.SELECT_SERVICE_FOR_PARA_EDIT)) {
             lsitServiceforParameterChanged(httpServletRequest, httpServletResponse);
             return;
@@ -166,15 +164,15 @@
                 filePart.endsWith(Constants.EDIR_SERVICE_PARA)) {
             chageParameters(httpServletRequest, httpServletResponse);
             return;
-        }else if ((filePart != null) &&
+        } else if ((filePart != null) &&
                 filePart.endsWith(Constants.LIST_SERVICE_GROUPS)) {
             listServiceGroups(httpServletRequest, httpServletResponse);
             return;
-        }else if ((filePart != null) &&
+        } else if ((filePart != null) &&
                 filePart.endsWith(Constants.LIST_CONTEXTS)) {
             listContexts(httpServletRequest, httpServletResponse);
             return;
-        }  else if ((filePart != null) &&
+        } else if ((filePart != null) &&
                 filePart.endsWith(Constants.LOGOUT)) {
             logout(httpServletRequest, httpServletResponse);
             return;
@@ -183,12 +181,8 @@
         if ((filePart != null) &&
                 filePart.endsWith(Constants.LIST_SERVICES)) {
             listServices(httpServletRequest, httpServletResponse);
-            return;
         } else {
-            if (allowListSingleService) {
-                listService(httpServletRequest, httpServletResponse, filePart);
-                return;
-            }
+            listService(httpServletRequest, httpServletResponse, filePart);
         }
     }
 
@@ -221,10 +215,11 @@
         res.sendRedirect("ViewContexts.jsp");
     }
 
-     private void logout(HttpServletRequest req, HttpServletResponse res) throws IOException {
+    private void logout(HttpServletRequest req, HttpServletResponse res) throws IOException {
         req.getSession().invalidate();
         res.sendRedirect("index.jsp");
     }
+
     /**
      * @param req
      * @param res
@@ -266,9 +261,7 @@
                 (String) configContext.getAxisConfiguration()
                         .getParameter(Constants.PASSWORD)
                         .getValue();
-        if (username != null
-                && password != null
-                && username.equals(adminUserName)
+        if (username.equals(adminUserName)
                 && password.equals(adminPassword)) {
             req.getSession().setAttribute(Constants.LOGGED, "Yes");
             res.sendRedirect(ADMIN_JSP_NAME);
@@ -355,9 +348,8 @@
     }
 
 
-
     private void engageModulesToServiceGroup(HttpServletRequest req,
-                                        HttpServletResponse res)
+                                             HttpServletResponse res)
             throws IOException {
         HashMap modules =
                 ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
@@ -370,18 +362,12 @@
         String serviceName = req.getParameter("service");
         req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
         if (serviceName != null && moduleName != null) {
-            try {
-
-                configContext.getAxisConfiguration().getServiceGroup(
-                        serviceName)
-                        .engageModuleToGroup(new QName(moduleName));
-                req.getSession().setAttribute(Constants.ENGAGE_STATUS,
-                        moduleName +
-                                " module engaged to the serviceGroup Successfully");
-            } catch (AxisFault axisFault) {
-                req.getSession().setAttribute(Constants.ENGAGE_STATUS,
-                        axisFault.getMessage());
-            }
+            configContext.getAxisConfiguration().getServiceGroup(
+                    serviceName)
+                    .engageModuleToGroup(new QName(moduleName));
+            req.getSession().setAttribute(Constants.ENGAGE_STATUS,
+                    moduleName +
+                            " module engaged to the serviceGroup Successfully");
         }
         req.getSession().setAttribute("service", null);
         res.sendRedirect(ENGAGING_MODULE_TO_SERVICE_GROUP_JSP_NAME);
@@ -407,7 +393,7 @@
                         serviceName)
                         .engageModule(
                                 configContext.getAxisConfiguration().getModule(
-                                        new QName(moduleName)),configContext.getAxisConfiguration());
+                                        new QName(moduleName)), configContext.getAxisConfiguration());
                 req.getSession().setAttribute(Constants.ENGAGE_STATUS,
                         moduleName +
                                 " module engaged to the service Successfully");
@@ -448,20 +434,19 @@
     }
 
 
-
     private void chageParameters(HttpServletRequest req,
                                  HttpServletResponse res)
             throws IOException {
-        if(req.getParameter("changePara")!=null){
+        if (req.getParameter("changePara") != null) {
             String serviceName = req.getParameter("service");
-            AxisService service =  configContext.getAxisConfiguration().
+            AxisService service = configContext.getAxisConfiguration().
                     getService(serviceName);
-            if(service !=null){
+            if (service != null) {
                 ArrayList service_para = service.getParameters();
                 for (int i = 0; i < service_para.size(); i++) {
                     Parameter parameter = (Parameter) service_para.get(i);
-                    String para =  req.getParameter(serviceName + "_" + parameter.getName());
-                    service.addParameter(new ParameterImpl(parameter.getName(),para));
+                    String para = req.getParameter(serviceName + "_" + parameter.getName());
+                    service.addParameter(new ParameterImpl(parameter.getName(), para));
                 }
                 HashMap operation = service.getOperations();
                 Collection op_col = operation.values();
@@ -472,9 +457,9 @@
                     ArrayList operation_para = axisOperation.getParameters();
                     for (int i = 0; i < operation_para.size(); i++) {
                         Parameter parameter = (Parameter) operation_para.get(i);
-                        String para =  req.getParameter(op_name + "_" + parameter.getName());
+                        String para = req.getParameter(op_name + "_" + parameter.getName());
                         axisOperation.addParameter(
-                                new ParameterImpl(parameter.getName(),para));
+                                new ParameterImpl(parameter.getName(), para));
                     }
                 }
             }
@@ -486,7 +471,7 @@
             req.getSession().removeAttribute(Constants.SERVICE);
             return;
 
-        }   else {
+        } else {
             String service = req.getParameter("service");
             if (service != null) {
                 req.getSession().setAttribute(Constants.SERVICE,
@@ -502,9 +487,9 @@
             throws IOException {
         if (req.getParameter("submit") != null) {
             String serviceName = req.getParameter("service");
-            String turnoff = req.getParameter("turnoff") ;
-            if(serviceName !=null){
-                if(turnoff !=null){
+            String turnoff = req.getParameter("turnoff");
+            if (serviceName != null) {
+                if (turnoff != null) {
                     configContext.getAxisConfiguration().removeService(serviceName);
                     res.setContentType("text/css");
                     PrintWriter out_writer = new PrintWriter(out);
@@ -584,7 +569,6 @@
                             filePart);
                     out.flush();
                     out.close();
-                    wsdl = null;
                     return;
                 } else {
                     req.getSession().setAttribute(Constants.SINGLE_SERVICE,

Modified: webservices/axis2/trunk/java/modules/core/webapp/ListServiceGroup.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/ListServiceGroup.jsp?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/ListServiceGroup.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/ListServiceGroup.jsp Mon Nov 28 08:19:26 2005
@@ -13,7 +13,7 @@
     while (axisServiceGroupIter.hasNext()) {
         AxisServiceGroup axisServiceGroup = (AxisServiceGroup) axisServiceGroupIter.next();
         String groupName = axisServiceGroup.getServiceGroupName();
-        ArrayList modules = axisServiceGroup.getServiceGroupModules();
+        ArrayList modules = axisServiceGroup.getEngagedModules();
         Iterator axisServiceIter = axisServiceGroup.getServices();
 %>
 <h2><%=groupName%></h2><ul>

Modified: webservices/axis2/trunk/java/modules/core/webapp/listGroupService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/listGroupService.jsp?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/listGroupService.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/listGroupService.jsp Mon Nov 28 08:19:26 2005
@@ -54,7 +54,7 @@
     <%--                 <br>Opeartion EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
     <%
         engagdeModules = null;
-        engagdeModules = axisOperation.getModules();
+        engagdeModules = axisOperation.getEngagedModules();
         moduleName = "";
         if(engagdeModules.size() >0){
     %>

Modified: webservices/axis2/trunk/java/modules/core/webapp/listService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/listService.jsp?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/listService.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/listService.jsp Mon Nov 28 08:19:26 2005
@@ -94,7 +94,7 @@
 <%--                 <br>Opeartion EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
                  <%
                      engagdeModules = null;
-                     engagdeModules = axisOperation.getModules();
+                     engagdeModules = axisOperation.getEngagedModules();
                      moduleName = "";
                      if(engagdeModules.size() >0){
                 %>

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MockFlow.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MockFlow.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MockFlow.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MockFlow.java Mon Nov 28 08:19:26 2005
@@ -19,12 +19,15 @@
 import org.apache.axis2.description.Flow;
 import org.apache.axis2.description.FlowImpl;
 
+import javax.xml.namespace.QName;
+
 public class MockFlow extends FlowImpl implements Flow {
     public MockFlow(String message, int length) {
         super();
         for (int i = 0; i < length; i++) {
             SpeakingHandler1 h1 = new SpeakingHandler1(
-                    "Executing " + i + " inside " + message);
+                    "Executing " + i + " inside " + message,new QName("SpeakingHandler" + i));
+            h1.setName(new QName("SpeakingHandler" + i));
             this.addHandler(h1.getHandlerDescription());
         }
     }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java?rev=349418&r1=349417&r2=349418&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java Mon Nov 28 08:19:26 2005
@@ -32,13 +32,15 @@
     private String message;
     private QName name;
 
-    public SpeakingHandler1(String message) {
+    public SpeakingHandler1(String message, QName name) {
         this.message = message;
         HandlerDescription handlerDesc = new HandlerDescription();
+        handlerDesc.setName(new QName("SpeakingHandler1"));
         PhaseRule rule = new PhaseRule();
         rule.setPhaseName(PhaseMetadata.PHASE_POLICY_DETERMINATION);
         handlerDesc.setRules(rule);
         handlerDesc.setHandler(this);
+        handlerDesc.setName(name);
         init(handlerDesc);
     }
 



Mime
View raw message