axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r168522 - /webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBuilder.java
Date Fri, 06 May 2005 05:16:54 GMT
Author: deepal
Date: Thu May  5 22:16:53 2005
New Revision: 168522

URL: http://svn.apache.org/viewcvs?rev=168522&view=rev
Log:
modified to engage modules for services

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBuilder.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBuilder.java?rev=168522&r1=168521&r2=168522&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBuilder.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBuilder.java
Thu May  5 22:16:53 2005
@@ -1,14 +1,21 @@
 package org.apache.axis.context;
 
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Collection;
+import java.util.Iterator;
 
 import javax.xml.namespace.QName;
 
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.DeploymentException;
 import org.apache.axis.description.AxisService;
+import org.apache.axis.description.AxisModule;
+import org.apache.axis.description.AxisOperation;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.engine.EngineConfiguration;
+import org.apache.axis.engine.EngineConfigurationImpl;
+import org.apache.axis.engine.ExecutionChain;
 import org.apache.axis.modules.Module;
 import org.apache.axis.phaseresolver.PhaseException;
 import org.apache.axis.phaseresolver.PhaseResolver;
@@ -55,15 +62,21 @@
             return engineContext;
         }
 
-
+   /**
+    * Is used to initilize the modules , if the module needs to so some recovery process
+    * it can do inside init and this is differnt form module.engage()
+    * @param context
+    * @throws DeploymentException
+    */
 
 
     private void initModules(EngineContext context) throws DeploymentException {
         try{
-            ArrayList modules = (ArrayList)context.getEngineConfig().getGlobal().getModules();
-            for (int i = 0; i < modules.size(); i++) {
-                QName name = (QName) modules.get(i);
-                Module module = context.getEngineConfig().getModule(name).getModule();
+            HashMap modules = ((EngineConfigurationImpl)context.getEngineConfig()).getModules();
+            Collection col = modules.values();
+            for (Iterator iterator = col.iterator(); iterator.hasNext();) {
+                AxisModule  axismodule = (AxisModule)iterator.next();
+                Module module = axismodule.getModule();
                 if(module != null ){
                     module.init(context);
                 }
@@ -78,11 +91,37 @@
             ServiceContext serviceContext = new ServiceContext(service,context);
             PhaseResolver reolve = new PhaseResolver(context.getEngineConfig(),serviceContext);
             context.addService(serviceContext);
-            return  serviceContext = reolve.buildchains();
+            serviceContext = reolve.buildchains();
+            engageModules(service,context);
+            return serviceContext;
         } catch (PhaseException e) {
             throw new PhaseException(e.getMessage()) ;
         } catch (AxisFault axisFault) {
             throw new PhaseException(axisFault.getMessage()) ;
         }
+    }
+
+    private void engageModules(AxisService service,EngineContext context) throws AxisFault
{
+       ArrayList servicemodules = (ArrayList)service.getModules();
+       ArrayList opModules ;
+       Module module ;
+       Collection operations = service.getOperations().values();
+       for (Iterator iterator = operations.iterator(); iterator.hasNext();) {
+           AxisOperation operation = (AxisOperation) iterator.next();
+           opModules = (ArrayList)operation.getModules();
+           for (int i = 0; i < servicemodules.size(); i++) {
+               QName moduleName = (QName) servicemodules.get(i);
+               module = context.getEngineConfig().getModule(moduleName).getModule();
+               //todo AxisOperation shoud have a method to get chains
+               /*ExecutionChain inchain = new ExecutionChain();
+               inchain.addPhases(operation.getPhases(EngineConfiguration.INFLOW));
+               module.engage(inchain);*/
+           }
+           for (int i = 0; i < opModules.size(); i++) {
+               QName moduleName = (QName) opModules.get(i);
+               module = context.getEngineConfig().getModule(moduleName).getModule();
+           }
+
+       }
     }
 }



Mime
View raw message