axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r111701 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/deployment java/org/apache/axis/deployment/metadata java/org/apache/axis/deployment/metadata/phaserule java/org/apache/axis/description java/org/apache/axis/engine test/org/apache/axis/deployment
Date Mon, 13 Dec 2004 10:25:09 GMT
Author: deepal
Date: Mon Dec 13 02:25:07 2004
New Revision: 111701

URL: http://svn.apache.org/viewcvs?view=rev&rev=111701
Log:
adding phaseRule Resolving module
Removed:
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/HandlerMetaData.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/HandlerChainMetaData.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/HandlerChainMetaDataImpl.java
Modified:
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/ServerMetaData.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseHolder.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseMetaData.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseResolver.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/PhaseRule.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/ServiceTest.java

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java
Mon Dec 13 02:25:07 2004
@@ -3,6 +3,7 @@
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.deployment.metadata.ServerMetaData;
 import org.apache.axis.deployment.metadata.phaserule.PhaseException;
+import org.apache.axis.deployment.metadata.phaserule.PhaseResolver;
 import org.apache.axis.deployment.repository.utill.HDFileItem;
 import org.apache.axis.deployment.repository.utill.UnZipJAR;
 import org.apache.axis.deployment.repository.utill.WSInfo;
@@ -167,7 +168,8 @@
     }
 
 
-    private void addnewService(AxisService serviceMetaData) throws AxisFault {
+    private void addnewService(AxisService serviceMetaData) throws AxisFault, PhaseException
{
+
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 
         Flow inflow = serviceMetaData.getInFlow();
@@ -184,7 +186,8 @@
         if(faultFlow != null) {
             addFlowHandlers(faultFlow,classLoader);
         }
-
+            PhaseResolver reolve = new PhaseResolver(engineRegistry,serviceMetaData);
+            reolve.buildchains();
     }
 
 
@@ -236,19 +239,19 @@
             throw new AxisFault(e.getMessage());
         }
 
-        try {
-            Handler handler = (Handler) handlerClass.newInstance();
-            MessageContext msgContext = null;
-            try {
-                handler.invoke(msgContext);
-            } catch (AxisFault axisFault) {
-                throw new AxisFault(axisFault.getMessage());
-            }
-        } catch (InstantiationException e) {
-            throw new AxisFault(e.getMessage());
-        } catch (IllegalAccessException e) {
-            throw new AxisFault(e.getMessage());
-        }
+//        try {
+//            Handler handler = (Handler) handlerClass.newInstance();
+//            MessageContext msgContext = null;
+//            try {
+//                handler.invoke(msgContext);
+//            } catch (AxisFault axisFault) {
+//                throw new AxisFault(axisFault.getMessage());
+//            }
+//        } catch (InstantiationException e) {
+//            throw new AxisFault(e.getMessage());
+//        } catch (IllegalAccessException e) {
+//            throw new AxisFault(e.getMessage());
+//        }
         return handlerClass;
     }
 
@@ -299,7 +302,11 @@
                             unZipJAR.unzipService(currentFileItem.getAbsolutePath(), this,
service);
                             try {
                                 if (service != null) {
-                                    addnewService(service);
+                                    try {
+                                        addnewService(service);
+                                    } catch (PhaseException e) {
+                                        e.printStackTrace();  //To change body of catch statement
use File | Settings | File Templates.
+                                    }
                                     log.info("Deployement WS Name  " + currentFileItem.getName());
                                     currentFileItem = null;
                                     break;

Deleted: /webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/HandlerMetaData.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/HandlerMetaData.java?view=auto&rev=111700
==============================================================================

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/ServerMetaData.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/ServerMetaData.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/ServerMetaData.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/ServerMetaData.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/ServerMetaData.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/ServerMetaData.java
Mon Dec 13 02:25:07 2004
@@ -92,7 +92,7 @@
     }
 
     public QName getModule(int index) {
-        if (index <= moduleCount) {
+        if (index < moduleCount) {
             return (QName) modules.get(index);
         } else
             return null;
@@ -121,10 +121,10 @@
         PhaseMetaData[] temppahse = new PhaseMetaData[phasesmetadats.length];
         int count = 0;
         for (int i = 0; i < phases.size(); i++) {
-            PhaseMetaData phasemetadata = (PhaseMetaData) phases.elementAt(i);
+            String phasemetadata = (String) phases.elementAt(i);
             for (int j = 0; j < phasesmetadats.length; j++) {
                 PhaseMetaData tempmetadata = phasesmetadats[j];
-                if (tempmetadata.getName().equals(phasemetadata.getName())) {
+                if (tempmetadata.getName().equals(phasemetadata)) {
                     temppahse[count] = tempmetadata;
                     count++;
                 }

Deleted: /webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/HandlerChainMetaData.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/HandlerChainMetaData.java?view=auto&rev=111700
==============================================================================

Deleted: /webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/HandlerChainMetaDataImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/HandlerChainMetaDataImpl.java?view=auto&rev=111700
==============================================================================

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseHolder.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseHolder.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseHolder.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseHolder.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseHolder.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseHolder.java
Mon Dec 13 02:25:07 2004
@@ -1,9 +1,13 @@
 package org.apache.axis.deployment.metadata.phaserule;
 
 import org.apache.axis.deployment.DeploymentConstants;
-import org.apache.axis.deployment.DeploymentEngine;
-import org.apache.axis.deployment.metadata.HandlerMetaData;
 import org.apache.axis.deployment.metadata.ServerMetaData;
+import org.apache.axis.description.HandlerMetaData;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.engine.ExecutionChain;
+import org.apache.axis.engine.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import java.util.Vector;
 
@@ -34,16 +38,19 @@
  */
 public class PhaseHolder implements DeploymentConstants {
 
+    private Log log = LogFactory.getLog(getClass());
     private Vector phaseholder = new Vector();
 
     /**
      * Referance to ServerMetaData inorder to get information about phases.
      */
-    ServerMetaData serverMetaData;// = new  ServerMetaData();
+    private ServerMetaData serverMetaData;// = new  ServerMetaData();
+    private AxisService service;
 
-    public PhaseHolder() {
-        this.serverMetaData = DeploymentEngine.getServerMetaData();
-        phaseholder.removeAllElements();
+
+    public PhaseHolder(ServerMetaData serverMetaDatain,AxisService serviceIN) {
+        this.serverMetaData = serverMetaDatain;
+        this.service = serviceIN;
     }
 
     private boolean isPhaseExist(String phaseName) {
@@ -58,16 +65,7 @@
     }
 
     public void addHandler(HandlerMetaData handler) throws PhaseException {
-        String phaseName = handler.getPhase();
-        /**
-         * if user dose not specify the phase that belong to service phase
-         * todo i have to check that before and after property of handers if they
-         * represent phases the default name should be change
-         */
-        if (phaseName.equals("")) {
-            phaseName = SERVICETAG;
-            handler.setPhase(SERVICETAG);
-        }
+        String phaseName = handler.getRules().getPhaseName();
 
         if (isPhaseExist(phaseName)) {
             getPhase(phaseName).addHandler(handler);
@@ -77,7 +75,7 @@
                 addPhase(newpPhase);
                 newpPhase.addHandler(handler);
             } else {
-                throw new PhaseException("Invalid Phase ," + phaseName + " dose not exit
in server.xml");
+                throw new PhaseException("Invalid Phase ," + phaseName + "for the handler
" + handler.getName()    + " dose not exit in server.xml");
             }
 
         }
@@ -98,7 +96,7 @@
         return null;
     }
 
-    private void OrderdPhases() {
+    private  void OrderdPhases() {
         //todo complet this using phaseordeer
         PhaseMetaData[] phase = new PhaseMetaData[phaseholder.size()];
         for (int i = 0; i < phaseholder.size(); i++) {
@@ -116,8 +114,15 @@
         }
     }
 
-
-    public HandlerMetaData[] getOrderdHandlers() throws PhaseException {
+    /**
+     * cahinType
+     *  1 : inFlowExcChain
+     *  2 : OutFlowExeChain
+     *  3 : FaultFlowExcechain
+     * @param chainType
+     * @throws PhaseException
+     */
+    public  void getOrderdHandlers(int chainType) throws PhaseException {
         OrderdPhases();
         Vector tempHander = new Vector();
         HandlerMetaData[] handlers;
@@ -136,7 +141,38 @@
             handler[i] = (HandlerMetaData) tempHander.elementAt(i);
 
         }
-        return handler;
+        switch (chainType) {
+            case 1 : {
+                ExecutionChain inChain =  new ExecutionChain();//       service.getExecutableInChain();
+                for (int i = 0; i < handler.length; i++) {
+                    HandlerMetaData handlerMetaData = handler[i];
+                    inChain.addHandler(handlerMetaData.getHandler());
+                    log.info("Phase Name " + handlerMetaData.getRules().getPhaseName() );
+                }
+                service.setExecutableInChain(inChain);
+                break;
+            }
+            case 2 : {
+                ExecutionChain outChain =new ExecutionChain();// service.getExecutableOutChain();
+                for (int i = 0; i < handler.length; i++) {
+                    HandlerMetaData handlerMetaData = handler[i];
+                    outChain.addHandler(handlerMetaData.getHandler());
+                    log.info("Phase Name " + handlerMetaData.getRules().getPhaseName() );
+                }
+                service.setExecutableOutChain(outChain);
+                break;
+            }
+            case 3 : {
+                ExecutionChain faultChain = new ExecutionChain();//service.getExecutableFaultChain();
+                for (int i = 0; i < handler.length; i++) {
+                    HandlerMetaData handlerMetaData = handler[i];
+                    faultChain.addHandler(handlerMetaData.getHandler());
+                    log.info("Phase Name " + handlerMetaData.getRules().getPhaseName() );
+                }
+                service.setExecutableFaultChain(faultChain);
+                break;
+            }
+        }
     }
 
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseMetaData.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseMetaData.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseMetaData.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseMetaData.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseMetaData.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseMetaData.java
Mon Dec 13 02:25:07 2004
@@ -1,6 +1,6 @@
 package org.apache.axis.deployment.metadata.phaserule;
 
-import org.apache.axis.deployment.metadata.HandlerMetaData;
+import org.apache.axis.description.HandlerMetaData;
 
 import java.util.Vector;
 
@@ -103,10 +103,16 @@
     }
 
     public void addHandler(HandlerMetaData handler) throws PhaseException {
+        /**
+         * for the M1 we are not going to care about phaseFirst , PhaseLast only thinh u
can do it
+         * insert it to a pahse.
+         * todo if you uncomment this will work fine for phase Conditions :)
+         */
+        /*
         if (isonehanlder) {
             throw new PhaseException(this.getName() + "can only have one handler, since there
is a handler with both phaseFirst and PhaseLast true ");
         } else {
-            if (handler.isPhaseFirst() && handler.isPhaseLast()) {
+            if (handler.getRules().isPhaseFirst() && handler.getRules().isPhaseLast())
{
                 if (phaseHandlers.size() > 0) {
                     throw new PhaseException(this.getName() + " PhaseMetaData already added
a hander so this operation not allowed  cannot add the handler " + handler.getName());
                 } else {
@@ -114,14 +120,16 @@
                     setPhaseLast(handler);
                     isonehanlder = true;
                 }
-            } else if (handler.isPhaseFirst()) {
+            } else if (handler.getRules().isPhaseFirst()) {
                 setPhaseFirst(handler);
-            } else if (handler.isPhaseLast()) {
+            } else if (handler.getRules().isPhaseLast()) {
                 setPhaseLast(handler);
             } else
                 phaseHandlers.add(handler);
 
         }
+        */
+         phaseHandlers.add(handler);
 
     }
 
@@ -137,26 +145,6 @@
         return 0;
     }
 
-    public void listOrderdHandlers() {
-        if (isonehanlder) {
-            getPhaseFirst().printMe();
-            return;
-        }
-
-        HandlerMetaData handler = getPhaseFirst();
-        if (handler != null) {
-            handler.printMe();
-        }
-        for (int i = 0; i < phaseHandlers.size(); i++) {
-            handler = (HandlerMetaData) phaseHandlers.elementAt(i);
-            handler.printMe();
-        }
-        handler = getPhaseLast();
-        if (handler != null) {
-            handler.printMe();
-        }
-    }
-
     public HandlerMetaData[] getOrderedHandlers() throws PhaseException {
         int size = 0;
         /**
@@ -208,10 +196,10 @@
      */
     private void validatebefore() throws PhaseException {
         if (getPhaseFirst() != null) {
-            String phasFirstname = getPhaseFirst().getName();
+            String phasFirstname = getPhaseFirst().getName().getLocalPart();
             for (int i = 0; i < phaseHandlers.size(); i++) {
                 HandlerMetaData handler = (HandlerMetaData) phaseHandlers.elementAt(i);
-                if (handler.getBefore().equals(phasFirstname)) {
+                if (handler.getRules().getBefore().equals(phasFirstname)) {
                     throw new PhaseException("Try to plase a Hander " + handler.getName()
+ " before phaseFirst " + phasFirstname);
                 }
             }
@@ -228,7 +216,7 @@
      */
     private void validateafter() throws PhaseException {
         if (getPhaseLast() != null) {
-            String phaseLastName = getPhaseLast().getName();
+            String phaseLastName = getPhaseLast().getName().getLocalPart();
             for (int i = 0; i < phaseHandlers.size(); i++) {
                 HandlerMetaData handler = (HandlerMetaData) phaseHandlers.elementAt(i);
                 if (handler.getName().equals(phaseLastName)) {
@@ -297,21 +285,21 @@
     }
 
     private int getBefoerAfter(HandlerMetaData handler) throws PhaseException {
-        if ((!handler.getBefore().equals("")) && (!handler.getAfter().equals("")))
{
-            if (handler.getBefore().equals(handler.getAfter())) {
+        if ((!handler.getRules().getBefore().equals("")) && (!handler.getRules().getAfter().equals("")))
{
+            if (handler.getRules().getBefore().equals(handler.getRules().getAfter())) {
                 throw new PhaseException("Both before and after cannot be the same for this
handler" + handler.getName());
             }
             return BOTH_BEFORE_AFTER;
-        } else if (!handler.getBefore().equals("")) {
+        } else if (!handler.getRules().getBefore().equals("")) {
             return BEORE;
-        } else if (!handler.getAfter().equals("")) {
+        } else if (!handler.getRules().getAfter().equals("")) {
             return AFTER;
         } else
             return ANYWHERE;
     }
 
     private boolean insertBefore(HandlerMetaData handler) {
-        String beforename = handler.getBefore();
+        String beforename = handler.getRules().getBefore();
         if (getPhaseLast() != null) {
             if (getPhaseLast().getName().equals(beforename)) {
                 orderHanders.add(handler);
@@ -329,7 +317,7 @@
     }
 
     private boolean insertAfter(HandlerMetaData handler) {
-        String afterName = handler.getAfter();
+        String afterName = handler.getRules().getAfter();
         if (getPhaseFirst() != null) {
             if (getPhaseFirst().getName().equals(afterName)) {
                 orderHanders.add(0, handler);
@@ -367,7 +355,8 @@
          * just add the entery to vector
          */
         if ((getPhaseFirst() != null) && (getPhaseLast() != null)) {
-            if ((getPhaseFirst().getName().equals(handler.getAfter())) && (getPhaseLast().getName().equals(handler.getBefore())))
{
+            if ((getPhaseFirst().getName().equals(handler.getRules().getAfter())) &&
+                    (getPhaseLast().getName().equals(handler.getRules().getBefore()))) {
                 orderHanders.add(handler);
                 return true;
             }
@@ -375,9 +364,9 @@
 
         for (int i = 0; i < orderHanders.size(); i++) {
             HandlerMetaData temphandler = (HandlerMetaData) orderHanders.elementAt(i);
-            if (handler.getAfter().equals(temphandler.getName())) {
+            if (handler.getRules().getAfter().equals(temphandler.getName())) {
                 after = i;
-            } else if (handler.getBefore().equals(temphandler.getName())) {
+            } else if (handler.getRules().getBefore().equals(temphandler.getName())) {
                 before = i;
             }
             if ((after >= 0) && (before >= 0)) {

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseResolver.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseResolver.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseResolver.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseResolver.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseResolver.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/metadata/phaserule/PhaseResolver.java
Mon Dec 13 02:25:07 2004
@@ -5,6 +5,7 @@
 import org.apache.axis.description.AxisService;
 import org.apache.axis.description.AxisModule;
 import org.apache.axis.description.Flow;
+import org.apache.axis.description.HandlerMetaData;
 import org.apache.axis.deployment.metadata.ServerMetaData;
 import org.apache.axis.deployment.DeploymentEngine;
 
@@ -32,30 +33,130 @@
  */
 public class PhaseResolver {
     private EngineRegistry engineRegistry ;
-    AxisService axisService;
+    private AxisService axisService;
+    private PhaseHolder phaseHolder ;
+
+
+    private ServerMetaData server = DeploymentEngine.getServerMetaData();
 
     public PhaseResolver(EngineRegistry engineRegistry, AxisService axisService ) {
         this.engineRegistry = engineRegistry;
         this.axisService = axisService;
     }
 
-    public AxisService buildExcutionChains() throws AxisFault {
+    public void buildchains() throws PhaseException, AxisFault {
+        for(int i =1 ; i < 4 ; i++) {
+                buildExcutionChains(i);
+
+        }
+
+    }
+
+    /**
+     * this opeartion is used to build all the three cahins ,
+     * so type varible is used to difrenciate them
+     *  type = 1 inflow
+     *  type = 2 out flow
+     *  type = 3 fault flow
+     * @param type
+     * @throws AxisFault
+     */
+    public  void buildExcutionChains(int type) throws AxisFault, PhaseException {
+        int flowtype =  type;
         Vector allHandlers = new Vector();
-        ServerMetaData server = DeploymentEngine.getServerMetaData();
         int count = server.getModuleCount();
         QName moduleName;
         AxisModule module;
-        Flow flow;
-        for(int intA=0 ; intA <= count; intA ++){
+        Flow flow = null;
+        //adding server specific handlers  . global
+        for(int intA=0 ; intA < count; intA ++){
             moduleName = server.getModule(intA);
             module = engineRegistry.getModule(moduleName);
-            flow = module.getInFlow();
-            for(int j= 0 ; j <= flow.getHandlerCount() ; j++ ){
-                allHandlers.add(flow.getHandler(j));
+            switch (flowtype){
+                case 1 : {
+                    flow = module.getInFlow();
+                    break;
+                }
+                case  2 : {
+                    flow = module.getOutFlow();
+                    break;
+                }
+                case 3 : {
+                    flow = module.getFaultFlow();
+                    break;
+                }
+            }
+            for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
+                HandlerMetaData metadata = flow.getHandler(j);
+                //todo change this in properway
+                if (metadata.getRules().getPhaseName().equals("")){
+                    metadata.getRules().setPhaseName("global");
+                }
+                allHandlers.add(metadata);
+            }
+        }
+
+        // service module handlers
+        Vector modules = (Vector)axisService.getModules();
+        for (int i = 0; i < modules.size(); i++) {
+            QName moduleref = (QName) modules.elementAt(i);
+            module = engineRegistry.getModule(moduleref);
+            switch (flowtype){
+                case 1 : {
+                    flow = module.getInFlow();
+                    break;
+                }
+                case  2 : {
+                    flow = module.getOutFlow();
+                    break;
+                }
+                case 3 : {
+                    flow = module.getFaultFlow();
+                    break;
+                }
+            }
+            for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
+                HandlerMetaData metadata = flow.getHandler(j);
+                //todo change this in properway
+                if (metadata.getRules().getPhaseName().equals("") ){
+                    metadata.getRules().setPhaseName("service");
+                }
+                allHandlers.add(metadata);
             }
+
+        }
+
+        switch (flowtype){
+            case 1 : {
+                flow = axisService.getInFlow();
+                break;
+            }
+            case  2 : {
+                flow = axisService.getOutFlow();
+                break;
+            }
+            case 3 : {
+                flow = axisService.getFaultFlow();
+                break;
+            }
+        }
+        for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
+            HandlerMetaData metadata = flow.getHandler(j);
+            //todo change this in properway
+            if (metadata.getRules().getPhaseName().equals("")){
+                metadata.getRules().setPhaseName("service");
+            }
+            allHandlers.add(metadata);
+        }
+
+        phaseHolder = new PhaseHolder(server,axisService);
+
+        for (int i = 0; i < allHandlers.size(); i++) {
+            HandlerMetaData handlerMetaData = (HandlerMetaData) allHandlers.elementAt(i);
+            phaseHolder.addHandler(handlerMetaData);
         }
+        phaseHolder.getOrderdHandlers(type);
 
-        return  axisService;
     }
 
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/PhaseRule.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/PhaseRule.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/PhaseRule.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/PhaseRule.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/PhaseRule.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/PhaseRule.java
Mon Dec 13 02:25:07 2004
@@ -1,18 +1,18 @@
 /*
- * Copyright 2003,2004 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 2003,2004 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 package org.apache.axis.description;
 
 /**
@@ -27,6 +27,12 @@
     private String phaseName;
     private boolean phaseFirst;
     private boolean phaseLast;
+
+    public PhaseRule() {
+        this.before = "";
+        this.after = "";
+        this.phaseName = "";
+    }
 
     public String getBefore() {
         return before;

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/ExecutionChain.java
Mon Dec 13 02:25:07 2004
@@ -35,10 +35,23 @@
         executionList = new ArrayList();
     }
 
+    /**
+     * to add handler directly to list ,
+     * for teh execution chain , it is no need to rember about phases :)
+     * @param handler
+     *
+     * addded by Deepal
+     */
+    
+    public void addHandler(Handler handler){
+       executionList.add(handler);
+    }
+
     public void addPhase(Phase phase) {
         phases.put(phase.getPhaseName(), phase);
         executionList.add(phase);
     }
+
 
     public void addHandlerDirectly(Handler directHandler, int index) {
         phases.put(directHandler.getName(), directHandler);

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/ServiceTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/ServiceTest.java?view=diff&rev=111701&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/ServiceTest.java&r1=111700&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/ServiceTest.java&r2=111701
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/ServiceTest.java
(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/ServiceTest.java
Mon Dec 13 02:25:07 2004
@@ -41,20 +41,20 @@
         }
     }
 
-//   public static void main(String args []){
-//       String filename = "./target/test-resources" ;
-//        DeploymentEngine deploymentEngine = new DeploymentEngine(filename);
-//        EngineRegistry er = null;
-//        try {
-//            er = deploymentEngine.start();
-//        } catch (AxisFault axisFault) {
-//            axisFault.printStackTrace();  //To change body of catch statement use Options
| File Templates.
-//        } catch (PhaseException e) {
-//            e.printStackTrace();  //To change body of catch statement use Options | File
Templates.
-//        } catch (DeploymentException e) {
-//            e.printStackTrace();  //To change body of catch statement use Options | File
Templates.
-//        } catch (XMLStreamException e) {
-//            e.printStackTrace();  //To change body of catch statement use Options | File
Templates.
-//        }
-//    }
+   public static void main(String args []){
+       String filename = "./target/test-resources" ;
+        DeploymentEngine deploymentEngine = new DeploymentEngine(filename);
+        EngineRegistry er = null;
+        try {
+            er = deploymentEngine.start();
+        } catch (AxisFault axisFault) {
+            axisFault.printStackTrace();  //To change body of catch statement use Options
| File Templates.
+        } catch (PhaseException e) {
+            e.printStackTrace();  //To change body of catch statement use Options | File
Templates.
+        } catch (DeploymentException e) {
+            e.printStackTrace();  //To change body of catch statement use Options | File
Templates.
+        } catch (XMLStreamException e) {
+            e.printStackTrace();  //To change body of catch statement use Options | File
Templates.
+        }
+    }
 }

Mime
View raw message