axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r159223 - in webservices/axis/trunk/java/modules: core/src/java/org/apache/axis/engine/ core/src/java/org/apache/axis/phaseresolver/ deployment/src/java/org/apache/axis/deployment/ deployment/src/samples/deployment/ deployment/src/test-resources/deployment/
Date Mon, 28 Mar 2005 04:29:50 GMT
Author: deepal
Date: Sun Mar 27 20:29:47 2005
New Revision: 159223

URL: http://svn.apache.org/viewcvs?view=rev&rev=159223
Log:
added phases order for all the three flows

Modified:
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseMetadata.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseResolver.java
    webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentConstants.java
    webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java
    webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentParser.java
    webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/server.xml
    webservices/axis/trunk/java/modules/deployment/src/samples/deployment/server.xml
    webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server-transport.xml
    webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server.xml

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java
Sun Mar 27 20:29:47 2005
@@ -103,13 +103,17 @@
      * @throws AxisFault
      */
     public HashMap getTransports() throws AxisFault;
-
     /**
-     * Ordred list of phases
-     *
-     * @return
+     * To store the order of the phases
+     * @param inPhases
      */
-    public ArrayList getPhases();
+    public void setInPhases(ArrayList inPhases);
+    public void setOutPhases(ArrayList outPhases);
+    public void setFaultPhases(ArrayList faultPhases);
+
+    public ArrayList getInPhases();
+    public ArrayList getOutPhases();
+    public ArrayList getFaultPhases();
 
     /**
      * Method getServices

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java
Sun Mar 27 20:29:47 2005
@@ -1,18 +1,18 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 package org.apache.axis.engine;
 
 import java.util.ArrayList;
@@ -50,9 +50,9 @@
      * Field transports
      */
     private final HashMap transports = new HashMap();
-    
+
     private final HashMap transportsIn = new HashMap();
-    
+
     private final HashMap transportsOut = new HashMap();
 
     /**
@@ -63,7 +63,9 @@
     /**
      * Field phases
      */
-    private ArrayList phases;
+    private ArrayList inPhases;
+    private ArrayList outPhases;
+    private ArrayList faultPhases;
 
     /**
      * Constructor EngineRegistryImpl
@@ -72,7 +74,9 @@
      */
     public EngineRegistryImpl(AxisGlobal global) throws AxisFault {
         this.global = global;
-        phases = new ArrayList();
+        inPhases = new ArrayList();
+        outPhases = new ArrayList();
+        faultPhases = new ArrayList();
         errornesServices = new Hashtable();
     }
 
@@ -151,7 +155,7 @@
         services.remove(name);
     }
 
- 
+
 
 
     public AxisTransportIn getTransportIn(QName name) throws AxisFault {
@@ -201,17 +205,28 @@
         return transports;
     }
 
-    /**
-     * @return
-     */
-    public ArrayList getPhases() {
-        return phases;
+    public void setInPhases(ArrayList inPhases) {
+        this.inPhases = inPhases;
     }
 
-    /**
-     * @param list
-     */
-    public void setPhases(ArrayList list) {
-        phases = list;
+    public void setOutPhases(ArrayList outPhases) {
+        this.outPhases = outPhases;
+    }
+
+    public void setFaultPhases(ArrayList faultPhases) {
+        this.faultPhases = faultPhases;
+    }
+
+    public ArrayList getInPhases() {
+        return inPhases;
+    }
+
+    public ArrayList getOutPhases() {
+        return outPhases;
+    }
+
+    public ArrayList getFaultPhases() {
+        return faultPhases;
     }
+  
 }

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseHolder.java
Sun Mar 27 20:29:47 2005
@@ -15,7 +15,10 @@
 */
 package org.apache.axis.phaseresolver;
 
-import org.apache.axis.description.*;
+import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.PhasesInclude;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.engine.EngineRegistry;
 import org.apache.axis.engine.Handler;
@@ -49,6 +52,12 @@
      */
     private final AxisService service;
 
+    private ArrayList inPhases;
+    private ArrayList outPhases;
+    private ArrayList faultPhases;
+
+    private int flowType = -1;
+
     /**
      * Constructor PhaseHolder
      *
@@ -58,6 +67,53 @@
     public PhaseHolder(EngineRegistry registry, AxisService serviceIN) {
         this.registry = registry;
         this.service = serviceIN;
+        fillFlowPhases();
+    }
+
+    public void setFlowType(int flowType) {
+        switch (flowType) {
+            case PhaseMetadata.IN_FLOW:
+                {
+                    phaseholder = inPhases;
+                    break;
+                }
+            case PhaseMetadata.OUT_FLOW:
+                {
+                    phaseholder = outPhases;
+                    break;
+                }
+            case PhaseMetadata.FAULT_FLOW:
+                {
+                    phaseholder = faultPhases;
+                    break;
+                }
+        }
+        this.flowType = flowType;
+    }
+
+    private void fillFlowPhases() {
+        inPhases = new ArrayList();
+        outPhases = new ArrayList();
+        faultPhases = new ArrayList();
+
+        ArrayList tempPhases = registry.getInPhases();
+        for (int i = 0; i < tempPhases.size(); i++) {
+            String name = (String) tempPhases.get(i);
+            PhaseMetadata pm = new PhaseMetadata(name);
+            inPhases.add(pm);
+        }
+        tempPhases = registry.getOutPhases();
+        for (int i = 0; i < tempPhases.size(); i++) {
+            String name = (String) tempPhases.get(i);
+            PhaseMetadata pm = new PhaseMetadata(name);
+            outPhases.add(pm);
+        }
+        tempPhases = registry.getFaultPhases();
+        for (int i = 0; i < tempPhases.size(); i++) {
+            String name = (String) tempPhases.get(i);
+            PhaseMetadata pm = new PhaseMetadata(name);
+            faultPhases.add(pm);
+        }
     }
 
     /**
@@ -77,23 +133,6 @@
     }
 
     /**
-     * Method isPhaseExistinER
-     *
-     * @param phaseName
-     * @return
-     */
-    private boolean isPhaseExistinER(String phaseName) {
-        ArrayList pahselist = registry.getPhases();
-        for (int i = 0; i < pahselist.size(); i++) {
-            String pahse = (String) pahselist.get(i);
-            if (pahse.equals(phaseName)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
      * Method addHandler
      *
      * @param handler
@@ -104,17 +143,24 @@
         if (isPhaseExist(phaseName)) {
             getPhase(phaseName).addHandler(handler);
         } else {
-            if (isPhaseExistinER(phaseName)) {
-                PhaseMetadata newpPhase = new PhaseMetadata(phaseName);
-                addPhase(newpPhase);
-                newpPhase.addHandler(handler);
-            } else {
-                throw new PhaseException("Invalid Phase ," + phaseName
-                        + "for the handler "
-                        + handler.getName()
-                        + " dose not exit in server.xml");
-            }
+            throw new PhaseException("Invalid Phase ," + phaseName
+                    + "for the handler "
+                    + handler.getName()
+                    + " dose not exit in server.xml or refering to phase in diffrent flow");
+        }
+        /*
+        else {
+        if (isPhaseExistinER(phaseName)) {
+        PhaseMetadata newpPhase = new PhaseMetadata(phaseName);
+        addPhase(newpPhase);
+        newpPhase.addHandler(handler);
+        } else {
+        throw new PhaseException("Invalid Phase ," + phaseName
+        + "for the handler "
+        + handler.getName()
+        + " dose not exit in server.xml");
         }
+        }*/
     }
 
     /**
@@ -142,52 +188,9 @@
         return null;
     }
 
-    /**
-     * Method OrderThePhases
-     */
-    private void OrderThePhases() {
-        // todo complete this using phaseorder
-        PhaseMetadata[] phase = new PhaseMetadata[phaseholder.size()];
-        for (int i = 0; i < phaseholder.size(); i++) {
-            PhaseMetadata tempphase = (PhaseMetadata) phaseholder.get(i);
-            phase[i] = tempphase;
-        }
-        phase = getOrderPhases(phase);
-
-        // remove all items inorder to rearrange them
-        phaseholder.clear();
-        for (int i = 0; i < phase.length; i++) {
-            PhaseMetadata phaseMetaData = phase[i];
-            phaseholder.add(phaseMetaData);
-        }
-    }
-
-    /**
-     * Method getOrderPhases
-     *
-     * @param phasesmetadats
-     * @return
-     */
-    private PhaseMetadata[] getOrderPhases(PhaseMetadata[] phasesmetadats) {
-        PhaseMetadata[] tempphase = new PhaseMetadata[phasesmetadats.length];
-        int count = 0;
-        ArrayList pahselist = registry.getPhases();
-        for (int i = 0; i < pahselist.size(); i++) {
-            String phasemetadata = (String) pahselist.get(i);
-            for (int j = 0; j < phasesmetadats.length; j++) {
-                PhaseMetadata tempmetadata = phasesmetadats[j];
-                if (tempmetadata.getName().equals(phasemetadata)) {
-                    tempphase[count] = tempmetadata;
-                    count++;
-                }
-            }
-        }
-        return tempphase;
-    }
-
     public ArrayList getOrderHandler() throws PhaseException {
         ArrayList handlerList = new ArrayList();
-        OrderThePhases();
+        //OrderThePhases();
         HandlerMetadata[] handlers;
         for (int i = 0; i < phaseholder.size(); i++) {
             PhaseMetadata phase =
@@ -198,7 +201,7 @@
             }
 
         }
-        return  handlerList;
+        return handlerList;
     }
 
 
@@ -215,11 +218,11 @@
      */
     public void getOrderedHandlers(int chainType) throws PhaseException {
         try {
-            OrderThePhases();
+            //OrderThePhases();
 
             HandlerMetadata[] handlers;
             switch (chainType) {
-                case 1:
+                case PhaseMetadata.IN_FLOW:
                     {
                         ArrayList inChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -235,7 +238,7 @@
                         service.setPhases(inChain, EngineRegistry.INFLOW);
                         break;
                     }
-                case 2:
+                case PhaseMetadata.OUT_FLOW:
                     {
                         ArrayList outChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -251,9 +254,9 @@
                         service.setPhases(outChain, EngineRegistry.OUTFLOW);
                         break;
                     }
-                case 3:
+                case PhaseMetadata.FAULT_FLOW:
                     {
-                        ArrayList faultChain = new ArrayList();  
+                        ArrayList faultChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
                             PhaseMetadata phase =
                                     (PhaseMetadata) phaseholder.get(i);
@@ -277,13 +280,13 @@
     public void buildTransportChain(PhasesInclude trnsport, int chainType)
             throws PhaseException {
         try {
-            OrderThePhases();
+            //OrderThePhases();
 
             HandlerMetadata[] handlers;
             Class handlerClass = null;
             Handler handler;
             switch (chainType) {
-                case 1:
+                case PhaseMetadata.IN_FLOW:
                     {
                         ArrayList inChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -293,8 +296,7 @@
                             handlers = phase.getOrderedHandlers();
                             for (int j = 0; j < handlers.length; j++) {
                                 try {
-                                    handlerClass = Class.forName(
-                                            handlers[j].getClassName(), true,
+                                    handlerClass = Class.forName(handlers[j].getClassName(),
true,
                                             Thread.currentThread().getContextClassLoader());
                                     handler =
                                             (Handler) handlerClass.newInstance();
@@ -314,7 +316,7 @@
                         trnsport.setPhases(inChain, EngineRegistry.INFLOW);
                         break;
                     }
-                case 2:
+                case PhaseMetadata.OUT_FLOW:
                     {
                         ArrayList outChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -324,8 +326,7 @@
                             handlers = phase.getOrderedHandlers();
                             for (int j = 0; j < handlers.length; j++) {
                                 try {
-                                    handlerClass = Class.forName(
-                                            handlers[j].getClassName(), true,
+                                    handlerClass = Class.forName(handlers[j].getClassName(),
true,
                                             Thread.currentThread().getContextClassLoader());
                                     handler =
                                             (Handler) handlerClass.newInstance();
@@ -345,7 +346,7 @@
                         trnsport.setPhases(outChain, EngineRegistry.OUTFLOW);
                         break;
                     }
-                case 3:
+                case PhaseMetadata.FAULT_FLOW:
                     {
                         ArrayList faultChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -355,8 +356,7 @@
                             handlers = phase.getOrderedHandlers();
                             for (int j = 0; j < handlers.length; j++) {
                                 try {
-                                    handlerClass = Class.forName(
-                                            handlers[j].getClassName(), true,
+                                    handlerClass = Class.forName(handlers[j].getClassName(),
true,
                                             Thread.currentThread().getContextClassLoader());
                                     handler =
                                             (Handler) handlerClass.newInstance();
@@ -393,10 +393,10 @@
     public void buildGlobalChain(AxisGlobal axisGlobal, int chainType)
             throws PhaseException {
         try {
-            OrderThePhases();
+            //OrderThePhases();
             HandlerMetadata[] handlers;
             switch (chainType) {
-                case 1:
+                case PhaseMetadata.IN_FLOW:
                     {
                         ArrayList inChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -412,7 +412,7 @@
                         axisGlobal.setPhases(inChain, EngineRegistry.INFLOW);
                         break;
                     }
-                case 2:
+                case PhaseMetadata.OUT_FLOW:
                     {
                         ArrayList outChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -428,7 +428,7 @@
                         axisGlobal.setPhases(outChain, EngineRegistry.OUTFLOW);
                         break;
                     }
-                case 3:
+                case PhaseMetadata.FAULT_FLOW:
                     {
                         ArrayList faultChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseMetadata.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseMetadata.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseMetadata.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseMetadata.java
Sun Mar 27 20:29:47 2005
@@ -23,6 +23,10 @@
  * Class PhaseMetadata
  */
 public class PhaseMetadata {
+
+    public static final int IN_FLOW = 1;
+    public static final int OUT_FLOW = 2;
+    public static final int FAULT_FLOW = 3;
     /**
      * Field BOTH_BEFORE_AFTER
      */
@@ -115,13 +119,11 @@
     public void setPhaseFirst(HandlerMetadata phaseFirst)
             throws PhaseException {
         if (phasefirstset) {
-            throw new PhaseException(
-                    "PhaseFirst alredy has been set, cannot have two phaseFirst Handler for
same phase "
+            throw new PhaseException("PhaseFirst alredy has been set, cannot have two phaseFirst
Handler for same phase "
                     + this.name);
         } else {
             if (getBeforeAfter(phaseFirst) != ANYWHERE) {
-                throw new PhaseException(
-                        "Handler with PhaseFirst can not have any before or after proprty
error in "
+                throw new PhaseException("Handler with PhaseFirst can not have any before
or after proprty error in "
                         + phaseFirst.getName());
             } else {
                 this.phaseFirst = phaseFirst;
@@ -147,13 +149,11 @@
      */
     public void setPhaseLast(HandlerMetadata phaseLast) throws PhaseException {
         if (phaselastset) {
-            throw new PhaseException(
-                    "PhaseLast already has been set, cannot have two PhaseLast Handler for
same phase "
+            throw new PhaseException("PhaseLast already has been set, cannot have two PhaseLast
Handler for same phase "
                     + this.name);
         } else {
             if (getBeforeAfter(phaseLast) != ANYWHERE) {
-                throw new PhaseException(
-                        "Handler with PhaseLast property can not have any before or after
property error in "
+                throw new PhaseException("Handler with PhaseLast property can not have any
before or after property error in "
                         + phaseLast.getName());
             } else {
                 this.phaseLast = phaseLast;
@@ -202,6 +202,7 @@
     public String getName() {
         return name;
     }
+
     /**
      * Method getOrderedHandlers
      *
@@ -248,7 +249,7 @@
     private void orderHandlers() throws PhaseException {
         validatebefore();
         validateafter();
-        arrangeHanders();
+        arrangeHandlers();
         phaseHandlers.clear();
         phaseHandlers = orderHanders;
     }
@@ -301,11 +302,11 @@
     }
 
     /**
-     * Method arrangeHanders
+     * Method arrangeHandlers
      *
      * @throws PhaseException
      */
-    private void arrangeHanders() throws PhaseException {
+    private void arrangeHandlers() throws PhaseException {
         int count = 0;
         int before_after = 0;
         boolean status = false;
@@ -318,7 +319,7 @@
             }
             status = false;
             if (count > phaseHandlers.size()) {
-                throw new PhaseException("Invalid pahse rule for "  + handler.getName());
+                throw new PhaseException("Invalid pahse rule for " + handler.getName());
             }
             before_after = getBeforeAfter(handler);
             switch (before_after) {
@@ -358,7 +359,7 @@
                         break;
                     }
             }
-            if(! status){
+            if (!status) {
                 count++;
             }
         }
@@ -374,10 +375,8 @@
     private int getBeforeAfter(HandlerMetadata handler) throws PhaseException {
         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"
+            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;
@@ -461,21 +460,19 @@
          * just add the entery to vector
          */
         if ((getPhaseFirst() != null) && (getPhaseLast() != null)) {
-            if ((getPhaseFirst().getName().getLocalPart().equals(
-                    handler.getRules().getAfter()))
-                    && (getPhaseLast().getName().getLocalPart().equals(
-                            handler.getRules().getBefore()))) {
+            if ((getPhaseFirst().getName().getLocalPart().equals(handler.getRules().getAfter()))
+                    && (getPhaseLast().getName().getLocalPart().equals(handler.getRules().getBefore())))
{
                 orderHanders.add(handler);
                 return true;
             }
         }
 
-        if(getPhaseFirst() != null &&
-                (getPhaseFirst().getName().getLocalPart().equals(handler.getRules().getAfter()))){
+        if (getPhaseFirst() != null &&
+                (getPhaseFirst().getName().getLocalPart().equals(handler.getRules().getAfter())))
{
             after = 0;
         }
-        if(getPhaseLast() != null &&
-                (getPhaseLast().getName().getLocalPart().equals(handler.getRules().getBefore()))){
+        if (getPhaseLast() != null &&
+                (getPhaseLast().getName().getLocalPart().equals(handler.getRules().getBefore())))
{
             before = orderHanders.size();
         }
 
@@ -483,8 +480,7 @@
             HandlerMetadata temphandler = (HandlerMetadata) orderHanders.get(i);
             if (handler.getRules().getAfter().equals(temphandler.getName().getLocalPart()))
{
                 after = i;
-            } else if (handler.getRules().getBefore().equals(
-                    temphandler.getName())) {
+            } else if (handler.getRules().getBefore().equals(temphandler.getName())) {
                 before = i;
             }
             if ((after >= 0) && (before >= 0)) {
@@ -493,7 +489,7 @@
                     throw new PhaseException("incorrect handler order for "
                             + handler.getName());
                 } else {
-                    if(after + 1 <= orderHanders.size()){
+                    if (after + 1 <= orderHanders.size()) {
                         orderHanders.add(after + 1, handler);
                     } else
                         orderHanders.add(after, handler);

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseResolver.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseResolver.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/phaseresolver/PhaseResolver.java
Sun Mar 27 20:29:47 2005
@@ -20,11 +20,7 @@
 import org.apache.axis.engine.EngineRegistry;
 
 import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 /**
  * Class PhaseResolver
@@ -141,17 +137,17 @@
             // QName moduleref = (QName) modules.elementAt(i);
             module = engineRegistry.getModule(moduleref);
             switch (flowtype) {
-                case 1:
+                case PhaseMetadata.IN_FLOW:
                     {
                         flow = module.getInFlow();
                         break;
                     }
-                case 2:
+                case PhaseMetadata.OUT_FLOW:
                     {
                         flow = module.getOutFlow();
                         break;
                     }
-                case 3:
+                case PhaseMetadata.FAULT_FLOW:
                     {
                         flow = module.getFaultFlow();
                         break;
@@ -170,17 +166,17 @@
             }
         }
         switch (flowtype) {
-            case 1:
+            case PhaseMetadata.IN_FLOW:
                 {
                     flow = axisService.getInFlow();
                     break;
                 }
-            case 2:
+            case PhaseMetadata.OUT_FLOW:
                 {
                     flow = axisService.getOutFlow();
                     break;
                 }
-            case 3:
+            case PhaseMetadata.FAULT_FLOW:
                 {
                     flow = axisService.getFaultFlow();
                     break;
@@ -198,6 +194,7 @@
             }
         }
         phaseHolder = new PhaseHolder(engineRegistry, axisService);
+        phaseHolder.setFlowType(flowtype);
         for (int i = 0; i < allHandlers.size(); i++) {
             HandlerMetadata handlerMetaData =
                     (HandlerMetadata) allHandlers.get(i);
@@ -236,13 +233,14 @@
         Flow flow = null;
         for (int type = 1; type < 4; type++) {
             phaseHolder = new PhaseHolder(engineRegistry, null);
+            phaseHolder.setFlowType(type);
             switch (type) {
-                case 1:
+                case PhaseMetadata.IN_FLOW:
                     {
                         flow = transport.getInFlow();
                         break;
                     }
-                case 3:
+                case PhaseMetadata.FAULT_FLOW:
                     {
                         flow = transport.getFaultFlow();
                         break;
@@ -275,13 +273,14 @@
         Flow flow = null;
         for (int type = 1; type < 4; type++) {
             phaseHolder = new PhaseHolder(engineRegistry, null);
+            phaseHolder.setFlowType(type);
             switch (type) {
-                case 2:
+                case PhaseMetadata.OUT_FLOW:
                     {
                         flow = transport.getOutFlow();
                         break;
                     }
-                case 3:
+                case PhaseMetadata.FAULT_FLOW:
                     {
                         flow = transport.getFaultFlow();
                         break;
@@ -318,21 +317,22 @@
         Flow flow = null;
         for (int type = 1; type < 4; type++) {
             phaseHolder = new PhaseHolder(engineRegistry, null);
+            phaseHolder.setFlowType(type);
             for (int intA = 0; intA < count; intA++) {
                 moduleName = (QName) modules.get(intA);
                 module = engineRegistry.getModule(moduleName);
                 switch (type) {
-                    case 1:
+                    case PhaseMetadata.IN_FLOW:
                         {
                             flow = module.getInFlow();
                             break;
                         }
-                    case 2:
+                    case PhaseMetadata.OUT_FLOW:
                         {
                             flow = module.getOutFlow();
                             break;
                         }
-                    case 3:
+                    case PhaseMetadata.FAULT_FLOW:
                         {
                             flow = module.getFaultFlow();
                             break;

Modified: webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentConstants.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentConstants.java
(original)
+++ webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentConstants.java
Sun Mar 27 20:29:47 2005
@@ -55,6 +55,7 @@
     // for parameters
     String ATTNAME = "name";
     String ATTLOCKED = "locked";
+    String TYPE = "type";
 
     // for operatiins
     String ATQNAME = "name";

Modified: webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java
(original)
+++ webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java
Sun Mar 27 20:29:47 2005
@@ -185,8 +185,7 @@
         if (hotdeployment) {
             startSearch(this);
         } else {
-            RepositoryListenerImpl repository =
-                    new RepositoryListenerImpl(folderName, this);
+            new RepositoryListenerImpl(folderName, this);
         }
         try {
             valideServerModule();

Modified: webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentParser.java?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentParser.java
(original)
+++ webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentParser.java
Sun Mar 27 20:29:47 2005
@@ -144,7 +144,27 @@
                             }
                         }
                     } else if (PHASE_ORDER.equals(ST)) {
-                        ((EngineRegistryImpl) dpengine.getEngineRegistry()).setPhases(processPhaseOrder());
+                       int attribCount = pullparser.getAttributeCount();
+                        if (attribCount > 0) {
+                            for (int i = 0; i < attribCount; i++) {
+                                String attname = pullparser.getAttributeLocalName(i);
+                                String attvalue = pullparser.getAttributeValue(i);
+                                if (TYPE.equals(attname)) {
+                                    if(INFLOWST.equals(attvalue)){
+                                        dpengine.getEngineRegistry().setInPhases(processPhaseOrder());
+                                    }   else if (OUTFLOWST.equals(attvalue)){
+                                         dpengine.getEngineRegistry().setOutPhases(processPhaseOrder());
+                                    }  else if (FAILTFLOWST.equals(attvalue)){
+                                          dpengine.getEngineRegistry().setFaultPhases(processPhaseOrder());
+                                    }  else {
+                                         throw new DeploymentException("un defined flow type
 "  + ST);
+                                    }
+                                }
+                            }
+                        } else {
+                            throw new DeploymentException("Flow type is a required attribute
in "  + ST);
+                        }
+                        //((EngineRegistryImpl) dpengine.getEngineRegistry()).setPhases(processPhaseOrder());
                     } else if (SERVERST.equals(ST)) {
                         //TODO process attributes
                     } else {

Modified: webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/server.xml?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/server.xml
(original)
+++ webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/server.xml
Sun Mar 27 20:29:47 2005
@@ -8,7 +8,19 @@
     </transportSender>
 
 
-    <phaseOrder>
+    <phaseOrder type="inflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="faultflow">
         <phase name="global"/>
         <phase name="transport"/>
         <phase name="Logging"/>

Modified: webservices/axis/trunk/java/modules/deployment/src/samples/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/samples/deployment/server.xml?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/samples/deployment/server.xml (original)
+++ webservices/axis/trunk/java/modules/deployment/src/samples/deployment/server.xml Sun Mar
27 20:29:47 2005
@@ -1,11 +1,20 @@
 <server name ="AxisJava2.0" >
-    <phaseOrder>
+    <phaseOrder type="inflow">
         <phase name="global"/>
         <phase name="transport"/>
-        <phase name="p2"/>
-        <phase name="p1"/>
-        <phase name="p3"/>
-        <phase name="anyhase"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="faultflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
         <phase name="service"/>
     </phaseOrder>
 </server>

Modified: webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server-transport.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server-transport.xml?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server-transport.xml
(original)
+++ webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server-transport.xml
Sun Mar 27 20:29:47 2005
@@ -19,10 +19,22 @@
         </faultflow>
     </transportSender>
 
-    <phaseOrder>
+    <phaseOrder type="inflow">
         <phase name="global"/>
         <phase name="transport"/>
-        <phase name="module"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="faultflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
         <phase name="service"/>
     </phaseOrder>
 </server>

Modified: webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server.xml?view=diff&r1=159222&r2=159223
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server.xml
(original)
+++ webservices/axis/trunk/java/modules/deployment/src/test-resources/deployment/server.xml
Sun Mar 27 20:29:47 2005
@@ -24,7 +24,20 @@
         <parameter name="para4" locked="xsd:false">LSF</parameter>
     </module>
    -->
-    <phaseOrder>
+
+    <phaseOrder type="inflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+    <phaseOrder type="faultflow">
         <phase name="global"/>
         <phase name="transport"/>
         <phase name="Logging"/>



Mime
View raw message