You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2005/05/05 13:39:38 UTC

svn commit: r168321 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/context/ core/src/org/apache/axis/deployment/ core/src/org/apache/axis/deployment/listener/ core/src/org/apache/axis/deployment/repository/utill/ core/src/org/apache/axis/deployment/scheduler/ core/src/org/apache/axis/description/ core/src/org/apache/axis/phaseresolver/ samples/

Author: deepal
Date: Thu May  5 04:39:38 2005
New Revision: 168321

URL: http://svn.apache.org/viewcvs?rev=168321&view=rev
Log:
reafactoring , removed handler chain form serviceContext

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentConstants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
    webservices/axis/trunk/java/modules/samples/project.xml

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java Thu May  5 04:39:38 2005
@@ -1,27 +1,29 @@
 package org.apache.axis.context;
 
 /*
- * 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.
+*
+*
+*/
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.axis.description.AxisOperation;
+import org.apache.axis.description.PhasesInclude;
+import org.apache.axis.description.PhasesIncludeImpl;
 import org.apache.axis.engine.AxisFault;
 import org.apache.wsdl.WSDLConstants;
 
@@ -34,129 +36,130 @@
 
 public class OperationContext extends AbstractContext {
 
-	private ArrayList messageContextList;
+    private ArrayList messageContextList;
+
+    private String MepId;
 
-	private String MepId;
+    private AxisOperation axisOperation;
 
-	private AxisOperation axisOperation;
 
-	public OperationContext(AxisOperation axisOperation,
-			ServiceContext serviceContext) {
-		super(serviceContext);
-		this.axisOperation = axisOperation;
-
-		// Most frequently used MEPs are IN ONLY and IN-OUT MEP. So the number
-		// of messagecontext for those MEPs are at most 2. Setting the initial
-		// capacity of the arrayList to 2.
-		messageContextList = new ArrayList(2);
-	}
-
-	/**
-	 * 
-	 * When a new message is added to the <code>MEPContext</code> the logic
-	 * should be included remove the MEPContext from the table in the
-	 * <code>EngineContext</code>. Example: IN_IN_OUT At the second IN
-	 * message the MEPContext should be removed from the AxisOperation
-	 * 
-	 * @param msgContext
-	 */
-	public void addMessageContext(MessageContext msgContext) throws AxisFault {
-		if (WSDLConstants.MEP_URI_IN_ONLY.equals(this.axisOperation
-				.getMessageExchangePattern())) {
-			messageContextList.add(msgContext);
-		} else if (WSDLConstants.MEP_URI_IN_OUT.equals(this.axisOperation
-				.getMessageExchangePattern())) {
-			messageContextList.add(msgContext);
-		}
-
-		if (this.isComplete())
-			msgContext.getEngineContext().removeMEP(this);
-
-	}
-
-	/**
-	 * @param index
-	 * @return
-	 */
-	public MessageContext getMessageContext(int index) {
-		return (MessageContext) messageContextList.get(index);
-	}
-
-	public MessageContext removeMessageContext(MessageContext ctxt) {
-		messageContextList.remove(ctxt.getMessageID());
-		return ctxt;
-	}
-
-	public List getAllMessageContexts() {
-		return this.messageContextList;
-	}
-
-	public MessageContext getMessageContext(String messageID) throws AxisFault {
-		if (null != messageID) {
-			for (int i = 0; i < this.messageContextList.size(); i++) {
-				if (messageID.equals(((MessageContext) (this.messageContextList
-						.get(i))).getMessageID())) {
-					return ((MessageContext) (this.messageContextList.get(i)));
-				}
-			}
-		}
-
-		throw new AxisFault(
-				" Message does not exist in the current MEP : Invalid MessageID :"
-						+ messageID);
-	}
-
-	public void addMessageContext(String messageLabel, MessageContext msgContext)
-			throws AxisFault {
-		// TODO : Chathura
-		throw new UnsupportedOperationException();
-
-	}
-
-	/**
-	 * @return Returns the mepId.
-	 */
-	public String getMepId() {
-		return MepId;
-	}
-
-	/**
-	 * @param mepId
-	 *            The mepId to set.
-	 */
-	public void setMepId(String mepId) {
-		MepId = mepId;
-	}
-
-	/**
-	 * Chathura, please implement this method to return the last in message of
-	 * the MEP. I want this for addressing - Chinthaka
-	 * 
-	 * @return
-	 */
-	public MessageContext getLastInMessageContext() {
-		throw new UnsupportedOperationException();
-
-	}
-
-	public void cleanup() throws AxisFault {
-		//TODO Chathura
-		throw new UnsupportedOperationException();
-	}
-
-	public boolean isComplete() {
-		if (WSDLConstants.MEP_URI_IN_ONLY.equals(this.axisOperation
-				.getMessageExchangePattern())) {
-			if (1 == this.messageContextList.size())
-				return true;
-		} else if (WSDLConstants.MEP_URI_IN_OUT.equals(this.axisOperation
-				.getMessageExchangePattern())) {
-			if (2 == this.messageContextList.size())
-				return true;
-		}
+    public OperationContext(AxisOperation axisOperation,
+                            ServiceContext serviceContext) {
+        super(serviceContext);
+        this.axisOperation = axisOperation;
+
+        // Most frequently used MEPs are IN ONLY and IN-OUT MEP. So the number
+        // of messagecontext for those MEPs are at most 2. Setting the initial
+        // capacity of the arrayList to 2.
+        messageContextList = new ArrayList(2);
+    }
+
+    /**
+     *
+     * When a new message is added to the <code>MEPContext</code> the logic
+     * should be included remove the MEPContext from the table in the
+     * <code>EngineContext</code>. Example: IN_IN_OUT At the second IN
+     * message the MEPContext should be removed from the AxisOperation
+     *
+     * @param msgContext
+     */
+    public void addMessageContext(MessageContext msgContext) throws AxisFault {
+        if (WSDLConstants.MEP_URI_IN_ONLY.equals(this.axisOperation
+                .getMessageExchangePattern())) {
+            messageContextList.add(msgContext);
+        } else if (WSDLConstants.MEP_URI_IN_OUT.equals(this.axisOperation
+                .getMessageExchangePattern())) {
+            messageContextList.add(msgContext);
+        }
+
+        if (this.isComplete())
+            msgContext.getEngineContext().removeMEP(this);
+
+    }
+
+    /**
+     * @param index
+     * @return
+     */
+    public MessageContext getMessageContext(int index) {
+        return (MessageContext) messageContextList.get(index);
+    }
+
+    public MessageContext removeMessageContext(MessageContext ctxt) {
+        messageContextList.remove(ctxt.getMessageID());
+        return ctxt;
+    }
+
+    public List getAllMessageContexts() {
+        return this.messageContextList;
+    }
+
+    public MessageContext getMessageContext(String messageID) throws AxisFault {
+        if (null != messageID) {
+            for (int i = 0; i < this.messageContextList.size(); i++) {
+                if (messageID.equals(((MessageContext) (this.messageContextList
+                        .get(i))).getMessageID())) {
+                    return ((MessageContext) (this.messageContextList.get(i)));
+                }
+            }
+        }
+
+        throw new AxisFault(
+                " Message does not exist in the current MEP : Invalid MessageID :"
+                + messageID);
+    }
+
+    public void addMessageContext(String messageLabel, MessageContext msgContext)
+            throws AxisFault {
+        // TODO : Chathura
+        throw new UnsupportedOperationException();
+
+    }
+
+    /**
+     * @return Returns the mepId.
+     */
+    public String getMepId() {
+        return MepId;
+    }
+
+    /**
+     * @param mepId
+     *            The mepId to set.
+     */
+    public void setMepId(String mepId) {
+        MepId = mepId;
+    }
+
+    /**
+     * Chathura, please implement this method to return the last in message of
+     * the MEP. I want this for addressing - Chinthaka
+     *
+     * @return
+     */
+    public MessageContext getLastInMessageContext() {
+        throw new UnsupportedOperationException();
+
+    }
+
+    public void cleanup() throws AxisFault {
+        //TODO Chathura
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean isComplete() {
+        if (WSDLConstants.MEP_URI_IN_ONLY.equals(this.axisOperation
+                .getMessageExchangePattern())) {
+            if (1 == this.messageContextList.size())
+                return true;
+        } else if (WSDLConstants.MEP_URI_IN_OUT.equals(this.axisOperation
+                .getMessageExchangePattern())) {
+            if (2 == this.messageContextList.size())
+                return true;
+        }
 
-		return false;
-	}
+        return false;
+    }
     public ServiceContext getServiceContext(){
         return (ServiceContext)super.parent;
     }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentConstants.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentConstants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentConstants.java Thu May  5 04:39:38 2005
@@ -24,7 +24,7 @@
     int MODULE = 1; // if it is a module
 
     String SERVICEXML = "META-INF/service.xml";
-    String SERVICEWSDL ="META-INF/service.wsdl";
+    String SERVICEWSDL = "META-INF/service.wsdl";
     String MODULEXML = "META-INF/module.xml";
     String PARAMETERST = "parameter";// paramater start tag
     String HANDERST = "handler";

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java Thu May  5 04:39:38 2005
@@ -16,19 +16,6 @@
 
 package org.apache.axis.deployment;
 
-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.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-
 import org.apache.axis.deployment.listener.RepositoryListenerImpl;
 import org.apache.axis.deployment.repository.utill.ArchiveReader;
 import org.apache.axis.deployment.repository.utill.HDFileItem;
@@ -36,12 +23,7 @@
 import org.apache.axis.deployment.scheduler.DeploymentIterator;
 import org.apache.axis.deployment.scheduler.Scheduler;
 import org.apache.axis.deployment.scheduler.SchedulerTask;
-import org.apache.axis.description.AxisGlobal;
-import org.apache.axis.description.AxisModule;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.Flow;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.description.Parameter;
+import org.apache.axis.description.*;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.engine.EngineConfiguration;
 import org.apache.axis.engine.EngineConfigurationImpl;
@@ -50,6 +32,13 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 
 public class DeploymentEngine implements DeploymentConstants {
 
@@ -323,15 +312,13 @@
     }
 
 
- 
-
     private void loadModuleClass(AxisModule module) throws AxisFault {
         Class moduleClass = null;
         try {
             String readInClass = currentFileItem.getModuleClass();
             if (readInClass != null && !"".equals(readInClass)) {
-                moduleClass = Class.forName(readInClass, true,currentFileItem.getClassLoader());
-                module.setModule((Module)moduleClass.newInstance());
+                moduleClass = Class.forName(readInClass, true, currentFileItem.getClassLoader());
+                module.setModule((Module) moduleClass.newInstance());
             }
         } catch (Exception e) {
             throw new AxisFault(e.getMessage(), e);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java Thu May  5 04:39:38 2005
@@ -16,26 +16,7 @@
 
 package org.apache.axis.deployment;
 
-import java.io.InputStream;
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axis.description.AxisGlobal;
-import org.apache.axis.description.AxisModule;
-import org.apache.axis.description.AxisOperation;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.AxisTransportIn;
-import org.apache.axis.description.AxisTransportOut;
-import org.apache.axis.description.Flow;
-import org.apache.axis.description.FlowImpl;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.description.Parameter;
-import org.apache.axis.description.ParameterImpl;
+import org.apache.axis.description.*;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.engine.EngineConfigurationImpl;
 import org.apache.axis.engine.MessageReceiver;
@@ -43,6 +24,14 @@
 import org.apache.axis.transport.TransportReceiver;
 import org.apache.axis.transport.TransportSender;
 
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.InputStream;
+import java.util.ArrayList;
+
 
 /**
  * This class is used to parse the following xml douments
@@ -126,22 +115,22 @@
                         dpengine.getEngineconfig().addTransportIn(transportin);
                     } else if (TYPEMAPPINGST.equals(ST)) {
                         throw new UnsupportedOperationException("Type Mappings are not allowed in server.xml");
-                    } else if (MESSAGERECEIVER.equals(ST)){
+                    } else if (MESSAGERECEIVER.equals(ST)) {
                         int attribCount = pullparser.getAttributeCount();
                         if (attribCount == 2) {
                             String attname = pullparser.getAttributeLocalName(0);
                             String attvalue = pullparser.getAttributeValue(0);
-                            if(MEP.equals(attname)){
+                            if (MEP.equals(attname)) {
                                 String name = attvalue;
                                 attname = pullparser.getAttributeLocalName(1);
                                 attvalue = pullparser.getAttributeValue(1);
-                                if(CLASSNAME.equals(attname)){
+                                if (CLASSNAME.equals(attname)) {
                                     try {
                                         Class messageReceiver = null;
                                         ClassLoader loader1 = Thread.currentThread().getContextClassLoader();
                                         if (attvalue != null && !"".equals(attvalue)) {
                                             messageReceiver = Class.forName(attvalue, true, loader1);
-                                            axisGlobal.addMessageReceiver(name,(MessageReceiver)messageReceiver.newInstance());
+                                            axisGlobal.addMessageReceiver(name, (MessageReceiver) messageReceiver.newInstance());
                                         }
                                     } catch (ClassNotFoundException e) {
                                         throw new DeploymentException("Error in loading messageRecivers " + e.getMessage());
@@ -150,11 +139,11 @@
                                     } catch (InstantiationException e) {
                                         throw new DeploymentException("Error in loading messageRecivers " + e.getMessage());
                                     }
-                                }  else
+                                } else
                                     throw new UnsupportedOperationException("invalid attributes in server.xml (messageReceiver elemet) " + attname);
-                            }  else
+                            } else
                                 throw new UnsupportedOperationException("invalid attributes in server.xml (messageReceiver elemet) " + attname);
-                        }else
+                        } else
                             throw new UnsupportedOperationException("invalid attributes in server.xml (messageReceiver elemet)");
 
                     } else if (MODULEST.equals(ST)) {
@@ -346,9 +335,9 @@
                 String attname = pullparser.getAttributeLocalName(i);
                 String attvalue = pullparser.getAttributeValue(i);
                 if (ATQNAME.equals(attname)) {
-                    if(attvalue == null || attvalue.trim().equals("")) {
+                    if (attvalue == null || attvalue.trim().equals("")) {
                         axisService.setName(new QName(getAxisServiceName(dpengine.getCurrentFileItem().getServiceName())));
-                    }  else{
+                    } else {
                         axisService.setName(new QName(attvalue));
                     }
                 } else {
@@ -616,13 +605,13 @@
         //  String name = pullparser.getLocalName();
         AxisOperation operation = new AxisOperation();
         int attribCount = pullparser.getAttributeCount();
-        if (attribCount >0) {  // there should be two attributes
+        if (attribCount > 0) {  // there should be two attributes
             for (int i = 0; i < attribCount; i++) {
                 String attname = pullparser.getAttributeLocalName(i);
                 String attvalue = pullparser.getAttributeValue(i);
                 if (ATTNAME.equals(attname)) {
                     operation.setName(new QName(attvalue));
-                }  else
+                } else
                     throw new DeploymentException("bad attribute in operation " + attname);
             }
         }
@@ -654,18 +643,18 @@
                         throw new UnsupportedOperationException("nexted elements are not allowed for M1");
                     } else if (OUTFLOWST.equals(ST)) {
                         throw new UnsupportedOperationException("nexted elements are not allowed for M1");
-                    }else if (MESSAGERECEIVER.equals(ST)){
+                    } else if (MESSAGERECEIVER.equals(ST)) {
                         attribCount = pullparser.getAttributeCount();
-                        if(attribCount > 0){
+                        if (attribCount > 0) {
                             String attname = pullparser.getAttributeLocalName(0);
                             String attvalue = pullparser.getAttributeValue(0);
-                            if(CLASSNAME.equals(attname)){
+                            if (CLASSNAME.equals(attname)) {
                                 try {
                                     Class messageReceiver = null;
                                     ClassLoader loader1 = Thread.currentThread().getContextClassLoader();
                                     if (attvalue != null && !"".equals(attvalue)) {
                                         messageReceiver = Class.forName(attvalue, true, loader1);
-                                        operation.setMessageReciever((MessageReceiver)messageReceiver.newInstance());
+                                        operation.setMessageReciever((MessageReceiver) messageReceiver.newInstance());
                                     }
                                 } catch (ClassNotFoundException e) {
                                     throw new DeploymentException("Error in loading messageRecivers " + e.getMessage());
@@ -675,9 +664,9 @@
                                     throw new DeploymentException("Error in loading messageRecivers " + e.getMessage());
                                 }
                             } else {
-                                throw new UnsupportedOperationException(attname +   " is not allowed in messageRecievr element");
+                                throw new UnsupportedOperationException(attname + " is not allowed in messageRecievr element");
                             }
-                        }  else {
+                        } else {
                             //todo   if user dose not specify the messageReciever then the defaullt one has to be used
                         }
                     }
@@ -692,7 +681,7 @@
             }
         } catch (XMLStreamException e) {
             throw new DeploymentException("parser Exception", e);
-        } catch (AxisFault e){
+        } catch (AxisFault e) {
             throw new DeploymentException("Axis fault , loading module", e);
         }
         return operation;
@@ -747,11 +736,10 @@
                         module.setName(new QName(attvalue));
                         ref_name = true;
                     }
-                }else if (CLASSNAME.equals(attname)) {
+                } else if (CLASSNAME.equals(attname)) {
                     foundClass = true;
                     dpengine.getCurrentFileItem().setModuleClass(attvalue);
-                }
-                else if (REF.equals(attname)) {
+                } else if (REF.equals(attname)) {
                     if (ref_name) {
                         throw new DeploymentException("Module canot have both name and ref  " + attvalue);
                     } else {
@@ -964,9 +952,9 @@
                         String attname = pullparser.getAttributeLocalName(0);
                         String attvalue = pullparser.getAttributeValue(0);
                         if (ATTNAME.equals(attname)) {
-                            if(attvalue.equals(PhaseMetadata.PRE_DISPATCH)){
+                            if (attvalue.equals(PhaseMetadata.PRE_DISPATCH)) {
                                 throw new DeploymentException(attvalue + " is a reserved phase");
-                            }else {
+                            } else {
                                 pahseList.add(attvalue);
                             }
                         }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java Thu May  5 04:39:38 2005
@@ -16,13 +16,13 @@
 
 package org.apache.axis.deployment.listener;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.axis.deployment.DeploymentConstants;
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.repository.utill.WSInfoList;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
 
 public class RepositoryListenerImpl implements RepositoryListener, DeploymentConstants {
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java Thu May  5 04:39:38 2005
@@ -16,10 +16,6 @@
 
 package org.apache.axis.deployment.repository.utill;
 
-import java.io.FileInputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
 import org.apache.axis.deployment.DeploymentConstants;
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.DeploymentException;
@@ -29,8 +25,12 @@
 import org.apache.axis.description.AxisService;
 import org.apache.axis.wsdl.builder.wsdl4j.WSDL1ToWOMBuilder;
 
+import java.io.FileInputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
 public class ArchiveReader implements DeploymentConstants {
-    
+
     public AxisService createService(String filename) throws DeploymentException {
         WSDL1ToWOMBuilder builder = new WSDL1ToWOMBuilder();
         String strArchive = filename;
@@ -42,7 +42,7 @@
             ZipEntry entry;
             while ((entry = zin.getNextEntry()) != null) {
                 if (entry.getName().equals(SERVICEWSDL)) {
-                    service = (AxisService) builder.build(zin,new AxisDescWSDLComponentFactory());
+                    service = (AxisService) builder.build(zin, new AxisDescWSDLComponentFactory());
                     foundwsdl = true;
                     break;
                 }
@@ -56,6 +56,7 @@
         }
         return service;
     }
+
     /**
      * This method will readServiceArchive the given jar or aar.
      * it take two arguments filename and refereance to DeployEngine

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java Thu May  5 04:39:38 2005
@@ -16,12 +16,12 @@
 
 package org.apache.axis.deployment.repository.utill;
 
+import org.apache.axis.engine.AxisFault;
+
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
-
-import org.apache.axis.engine.AxisFault;
 
 /**
  * HDFileItem = Hot Deployment File Item , to store infromation of the module or servise

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java Thu May  5 04:39:38 2005
@@ -16,13 +16,13 @@
 
 package org.apache.axis.deployment.repository.utill;
 
+import org.apache.axis.deployment.DeploymentConstants;
+import org.apache.axis.deployment.DeploymentEngine;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-
-import org.apache.axis.deployment.DeploymentConstants;
-import org.apache.axis.deployment.DeploymentEngine;
 
 public class WSInfoList implements DeploymentConstants {
     /**

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java Thu May  5 04:39:38 2005
@@ -16,11 +16,11 @@
 
 package org.apache.axis.deployment.scheduler;
 
-import java.util.TimerTask;
-
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.listener.RepositoryListener;
 import org.apache.axis.deployment.listener.RepositoryListenerImpl;
+
+import java.util.TimerTask;
 
 public class SchedulerTask implements Runnable {
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml Thu May  5 04:39:38 2005
@@ -2,7 +2,7 @@
     <parameter name="hotdeployment" locked="xsd:false">true</parameter>
     <parameter name="hotupdate" locked="xsd:false">true</parameter>
 
-    <messageReceiver mep="INOUT"  class="org.apache.axis.receivers.RawXMLINOutMessageRecevier"/>
+    <messageReceiver mep="INOUT" class="org.apache.axis.receivers.RawXMLINOutMessageRecevier"/>
 
     <transportReceiver name="http">
     </transportReceiver>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisOperation.java Thu May  5 04:39:38 2005
@@ -18,7 +18,7 @@
  *
  */
 public class AxisOperation extends WSDLOperationImpl implements
-		ParameterInclude, WSDLOperation,DescriptionConstants {
+		ParameterInclude, WSDLOperation,DescriptionConstants ,PhasesInclude{
 
 
 
@@ -28,6 +28,7 @@
         this.setMessageExchangePattern(MEP_URI_IN_OUT);
 		this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());        
         this.setComponentProperty(MODULEREF_KEY, new ArrayList());
+        this.setComponentProperty(PHASES_KEY, new PhasesIncludeImpl());
 	}
 	
 	public AxisOperation(QName name){
@@ -153,5 +154,31 @@
         this.messageReceiver = messageReceiver;
     }
 
+   public void setPhases(ArrayList phases, int flow) throws AxisFault {
+        if (phases == null) {
+            return;
+        }
+        PhasesIncludeImpl phaseInclude =
+                (PhasesIncludeImpl) this.getComponentProperty(PHASES_KEY);
+        phaseInclude.setPhases(phases, flow);
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.axis.description.PhasesInclude#getPhases(int)
+     */
+
+    /**
+     * Method getPhases
+     *
+     * @param flow
+     * @return
+     * @throws AxisFault
+     */
+    public ArrayList getPhases(int flow) throws AxisFault {
+        PhasesIncludeImpl phaseInclude =
+                (PhasesIncludeImpl) this.getComponentProperty(PHASES_KEY);
+        return (ArrayList) phaseInclude.getPhases(flow);
+    }
 }
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java Thu May  5 04:39:38 2005
@@ -15,11 +15,7 @@
 */
 package org.apache.axis.phaseresolver;
 
-import java.util.ArrayList;
-
 import org.apache.axis.context.EngineContext;
-import org.apache.axis.context.ServiceContext;
-import org.apache.axis.description.AxisService;
 import org.apache.axis.description.HandlerMetadata;
 import org.apache.axis.description.PhasesInclude;
 import org.apache.axis.engine.AxisFault;
@@ -29,6 +25,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.util.ArrayList;
+
 /**
  * This class hold all the phases found in the service.xml and server.xml
  */
@@ -48,12 +46,7 @@
      */
     private final EngineConfiguration registry;    // = new  ServerMetaData();
 
-    /**
-     * Field service
-     */
-    private final AxisService service;
-
-    private ServiceContext serviceContext;
+    private PhasesInclude phaseInclude;
 
     private ArrayList inPhases;
     private ArrayList outPhases;
@@ -66,19 +59,16 @@
      * Constructor PhaseHolder
      *
      * @param registry
-     * @param serviceIN
      */
-    public PhaseHolder(EngineConfiguration registry, AxisService serviceIN, ServiceContext context) {
+    public PhaseHolder(EngineConfiguration registry, PhasesInclude phaseInclude) {
         this.registry = registry;
-        this.service = serviceIN;
-        this.serviceContext = context;
+        this.phaseInclude = phaseInclude;
         fillFlowPhases();
     }
 
     public PhaseHolder(EngineConfiguration registry) {
         this.registry = registry;
-        this.service = null;
-        this.serviceContext = null;
+        this.phaseInclude = null;
         fillFlowPhases();
     }
 
@@ -121,7 +111,7 @@
             PhaseMetadata pm = new PhaseMetadata(name);
             inPhases.add(pm);
         }
-        inPhases.add(0,new PhaseMetadata(PhaseMetadata.PRE_DISPATCH));
+        inPhases.add(0, new PhaseMetadata(PhaseMetadata.PRE_DISPATCH));
         tempPhases = registry.getOutPhases();
         for (int i = 0; i < tempPhases.size(); i++) {
             String name = (String) tempPhases.get(i);
@@ -131,7 +121,7 @@
         outPhases.add(new PhaseMetadata(PhaseMetadata.PRE_DISPATCH));
 
         tempPhases = registry.getInFaultPhases();
-        faultInPhases.add(0,new PhaseMetadata(PhaseMetadata.PRE_DISPATCH));
+        faultInPhases.add(0, new PhaseMetadata(PhaseMetadata.PRE_DISPATCH));
         for (int i = 0; i < tempPhases.size(); i++) {
             String name = (String) tempPhases.get(i);
             PhaseMetadata pm = new PhaseMetadata(name);
@@ -247,86 +237,83 @@
      * @throws PhaseException
      */
     public void getOrderedHandlers(int chainType) throws PhaseException {
+        try {
+            //OrderThePhases();
 
-        // TODO : Fix me Deepal
-                throw new UnsupportedOperationException();
-//        try {
-//            //OrderThePhases();
-//
-//            HandlerMetadata[] handlers;
-//            switch (chainType) {
-//                case PhaseMetadata.IN_FLOW:
-//                    {
-//                        ArrayList inChain = new ArrayList();
-//                        for (int i = 0; i < phaseholder.size(); i++) {
-//                            PhaseMetadata phase =
-//                                    (PhaseMetadata) phaseholder.get(i);
-//                            SimplePhase axisPhase = new SimplePhase(phase.getName());
-//                            handlers = phase.getOrderedHandlers();
-//                            for (int j = 0; j < handlers.length; j++) {
-//                                axisPhase.addHandler(handlers[j].getHandler());
-//                            }
-//                            inChain.add(axisPhase);
-//                        }
-//                        serviceContext.setPhases(inChain, EngineConfiguration.INFLOW);
-//                        // service.setPhases(inChain, EngineConfiguration.INFLOW);
-//                        break;
-//                    }
-//                case PhaseMetadata.OUT_FLOW:
-//                    {
-//                        ArrayList outChain = new ArrayList();
-//                        for (int i = 0; i < phaseholder.size(); i++) {
-//                            PhaseMetadata phase =
-//                                    (PhaseMetadata) phaseholder.get(i);
-//                            SimplePhase axisPhase = new SimplePhase(phase.getName());
-//                            handlers = phase.getOrderedHandlers();
-//                            for (int j = 0; j < handlers.length; j++) {
-//                                axisPhase.addHandler(handlers[j].getHandler());
-//                            }
-//                            outChain.add(axisPhase);
-//                        }
-//                        //service.setPhases(outChain, EngineConfiguration.OUTFLOW);
-//                        serviceContext.setPhases(outChain, EngineConfiguration.OUTFLOW);
-//                        break;
-//                    }
-//                case PhaseMetadata.FAULT_IN_FLOW:
-//                    {
-//                        ArrayList faultInChain = new ArrayList();
-//                        for (int i = 0; i < phaseholder.size(); i++) {
-//                            PhaseMetadata phase =
-//                                    (PhaseMetadata) phaseholder.get(i);
-//                            SimplePhase axisPhase = new SimplePhase(phase.getName());
-//                            handlers = phase.getOrderedHandlers();
-//                            for (int j = 0; j < handlers.length; j++) {
-//                                axisPhase.addHandler(handlers[j].getHandler());
-//                            }
-//                            faultInChain.add(axisPhase);
-//                        }
-//                        serviceContext.setPhases(faultInChain, EngineConfiguration.FAULT_IN_FLOW);
-//                        // service.setPhases(faultInChain, EngineConfiguration.FAULT_IN_FLOW);
-//                        break;
-//                    }
-//                case PhaseMetadata.FAULT_OUT_FLOW:
-//                    {
-//                        ArrayList faultOutChain = new ArrayList();
-//                        for (int i = 0; i < phaseholder.size(); i++) {
-//                            PhaseMetadata phase =
-//                                    (PhaseMetadata) phaseholder.get(i);
-//                            SimplePhase axisPhase = new SimplePhase(phase.getName());
-//                            handlers = phase.getOrderedHandlers();
-//                            for (int j = 0; j < handlers.length; j++) {
-//                                axisPhase.addHandler(handlers[j].getHandler());
-//                            }
-//                            faultOutChain.add(axisPhase);
-//                        }
-//                        serviceContext.setPhases(faultOutChain, EngineConfiguration.FAULT_OUT_FLOW);
-//                        //   service.setPhases(faultOutChain, EngineConfiguration.FAULT_IN_FLOW);
-//                        break;
-//                    }
-//            }
-//        } catch (AxisFault e) {
-//            throw new PhaseException(e);
-//        }
+            HandlerMetadata[] handlers;
+            switch (chainType) {
+                case PhaseMetadata.IN_FLOW:
+                    {
+                        ArrayList inChain = new ArrayList();
+                        for (int i = 0; i < phaseholder.size(); i++) {
+                            PhaseMetadata phase =
+                                    (PhaseMetadata) phaseholder.get(i);
+                            SimplePhase axisPhase = new SimplePhase(phase.getName());
+                            handlers = phase.getOrderedHandlers();
+                            for (int j = 0; j < handlers.length; j++) {
+                                axisPhase.addHandler(handlers[j].getHandler());
+                            }
+                            inChain.add(axisPhase);
+                        }
+                        phaseInclude.setPhases(inChain, EngineConfiguration.INFLOW);
+                        // service.setPhases(inChain, EngineConfiguration.INFLOW);
+                        break;
+                    }
+                case PhaseMetadata.OUT_FLOW:
+                    {
+                        ArrayList outChain = new ArrayList();
+                        for (int i = 0; i < phaseholder.size(); i++) {
+                            PhaseMetadata phase =
+                                    (PhaseMetadata) phaseholder.get(i);
+                            SimplePhase axisPhase = new SimplePhase(phase.getName());
+                            handlers = phase.getOrderedHandlers();
+                            for (int j = 0; j < handlers.length; j++) {
+                                axisPhase.addHandler(handlers[j].getHandler());
+                            }
+                            outChain.add(axisPhase);
+                        }
+                        //service.setPhases(outChain, EngineConfiguration.OUTFLOW);
+                        phaseInclude.setPhases(outChain, EngineConfiguration.OUTFLOW);
+                        break;
+                    }
+                case PhaseMetadata.FAULT_IN_FLOW:
+                    {
+                        ArrayList faultInChain = new ArrayList();
+                        for (int i = 0; i < phaseholder.size(); i++) {
+                            PhaseMetadata phase =
+                                    (PhaseMetadata) phaseholder.get(i);
+                            SimplePhase axisPhase = new SimplePhase(phase.getName());
+                            handlers = phase.getOrderedHandlers();
+                            for (int j = 0; j < handlers.length; j++) {
+                                axisPhase.addHandler(handlers[j].getHandler());
+                            }
+                            faultInChain.add(axisPhase);
+                        }
+                        phaseInclude.setPhases(faultInChain, EngineConfiguration.FAULT_IN_FLOW);
+                        // service.setPhases(faultInChain, EngineConfiguration.FAULT_IN_FLOW);
+                        break;
+                    }
+                case PhaseMetadata.FAULT_OUT_FLOW:
+                    {
+                        ArrayList faultOutChain = new ArrayList();
+                        for (int i = 0; i < phaseholder.size(); i++) {
+                            PhaseMetadata phase =
+                                    (PhaseMetadata) phaseholder.get(i);
+                            SimplePhase axisPhase = new SimplePhase(phase.getName());
+                            handlers = phase.getOrderedHandlers();
+                            for (int j = 0; j < handlers.length; j++) {
+                                axisPhase.addHandler(handlers[j].getHandler());
+                            }
+                            faultOutChain.add(axisPhase);
+                        }
+                        phaseInclude.setPhases(faultOutChain, EngineConfiguration.FAULT_OUT_FLOW);
+                        //   service.setPhases(faultOutChain, EngineConfiguration.FAULT_IN_FLOW);
+                        break;
+                    }
+            }
+        } catch (AxisFault e) {
+            throw new PhaseException(e);
+        }
     }
 
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java Thu May  5 04:39:38 2005
@@ -15,9 +15,9 @@
 */
 package org.apache.axis.phaseresolver;
 
-import java.util.ArrayList;
-
 import org.apache.axis.description.HandlerMetadata;
+
+import java.util.ArrayList;
 
 /**
  * Class PhaseMetadata

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java Thu May  5 04:39:38 2005
@@ -15,27 +15,16 @@
 */
 package org.apache.axis.phaseresolver;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
 import org.apache.axis.context.EngineContext;
 import org.apache.axis.context.ServiceContext;
-import org.apache.axis.description.AxisGlobal;
-import org.apache.axis.description.AxisModule;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.AxisTransportIn;
-import org.apache.axis.description.AxisTransportOut;
-import org.apache.axis.description.Flow;
-import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.*;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.engine.EngineConfiguration;
 import org.apache.axis.engine.EngineConfigurationImpl;
 
+import javax.xml.namespace.QName;
+import java.util.*;
+
 /**
  * Class PhaseResolver
  */
@@ -86,8 +75,13 @@
      * @throws AxisFault
      */
     public ServiceContext buildchains() throws PhaseException, AxisFault {
-        for (int i = 1; i < 5; i++) {
-            buildExcutionChains(i);
+        HashMap operations = axisService.getOperations();
+        Collection col = operations.values();
+        for (Iterator iterator = col.iterator(); iterator.hasNext();) {
+            AxisOperation operation = (AxisOperation) iterator.next();
+            for (int i = 1; i < 5; i++) {
+                buildExcutionChains(i, operation);
+            }
         }
         return this.serviceContext;
     }
@@ -103,18 +97,19 @@
      * @throws AxisFault
      * @throws PhaseException
      */
-    private void buildExcutionChains(int type)
+    private void buildExcutionChains(int type, AxisOperation operation)
             throws AxisFault, PhaseException {
         int flowtype = type;
         ArrayList allHandlers = new ArrayList();
         AxisModule module;
         Flow flow = null;
-        ArrayList modules = (ArrayList)axisService.getModules();//   (ArrayList)engineConfig.getGlobal().getModules());
-        //Global modules
+        ArrayList modules = (ArrayList) axisService.getModules();
+        ///////////////////////////////////////////////////////////////////////////////////////
+        ///////////////////// GLOBAL HANDLERS ////////////////////////////////////////////////
         for (int i = 0; i < modules.size(); i++) {
             QName name = (QName) modules.get(i);
             module = engineConfig.getModule(name);
-            if(module != null){
+            if (module != null) {
                 switch (flowtype) {
                     case PhaseMetadata.IN_FLOW:
                         {
@@ -144,21 +139,22 @@
                          * If the phase property of a handler is pre-dispatch then those handlers
                          * should go to the global chain , to the pre-dispatch phase
                          */
-                        if(PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())){
+                        if (PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())) {
                             continue;
                         }
                         if (metadata.getRules().getPhaseName().equals("")) {
-                            metadata.getRules().setPhaseName("service");
+                            metadata.getRules().setPhaseName("global");
                         }
                         allHandlers.add(metadata);
                     }
                 }
             } else {
-                throw new PhaseException("Referred module is NULL " +  name.getLocalPart());
+                throw new PhaseException("Referred module is NULL " + name.getLocalPart());
             }
         }
 
-        // service module handlers
+        ///////////////////////////////////////////////////////////////////////////////////////
+        ///////////////////// SERVICE HANDLERS ////////////////////////////////////////////////
         Collection collection = axisService.getModules();
         Iterator itr = collection.iterator();
         while (itr.hasNext()) {
@@ -194,7 +190,7 @@
                      * If the phase property of a handler is pre-dispatch then those handlers
                      * should go to the global chain , to the pre-dispatch phase
                      */
-                    if(PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())){
+                    if (PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())) {
                         continue;
                     }
                     if (metadata.getRules().getPhaseName().equals("")) {
@@ -204,40 +200,55 @@
                 }
             }
         }
-        switch (flowtype) {
-            case PhaseMetadata.IN_FLOW:
-                {
-                    flow = axisService.getInFlow();
-                    break;
-                }
-            case PhaseMetadata.OUT_FLOW:
-                {
-                    flow = axisService.getOutFlow();
-                    break;
-                }
-            case PhaseMetadata.FAULT_IN_FLOW:
-                {
-                    flow = axisService.getFaultInFlow();
-                    break;
-                }
-            case PhaseMetadata.FAULT_OUT_FLOW:
-                {
-                    flow = axisService.getFaultOutFlow();
-                    break;
-                }
-        }
-        if (flow != null) {
-            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");
+        ///////////////////////////////////////////////////////////////////////////////////////
+        ///////////////////// OPERATION HANDLERS ////////////////////////////////////////////////
+        Collection opmodule = operation.getModules();
+        Iterator opitr = opmodule.iterator();
+        while (opitr.hasNext()) {
+            QName moduleref = (QName) opitr.next();
+            module = engineConfig.getModule(moduleref);
+            switch (flowtype) {
+                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++) {
+                    HandlerMetadata metadata = flow.getHandler(j);
+
+                    /**
+                     * If the phase property of a handler is pre-dispatch then those handlers
+                     * should go to the global chain , to the pre-dispatch phase
+                     */
+                    if (PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())) {
+                        continue;
+                    }
+                    if (metadata.getRules().getPhaseName().equals("")) {
+                        metadata.getRules().setPhaseName("service");
+                    }
+                    allHandlers.add(metadata);
                 }
-                allHandlers.add(metadata);
             }
         }
-        phaseHolder = new PhaseHolder(engineConfig, axisService, serviceContext);
+
+        phaseHolder = new PhaseHolder(engineConfig, operation);
         phaseHolder.setFlowType(flowtype);
         for (int i = 0; i < allHandlers.size(); i++) {
             HandlerMetadata handlerMetaData =
@@ -360,10 +371,10 @@
         QName moduleName;
         AxisModule module;
         Flow flow = null;
-        for (int type = 1; type < 4; type++) {
+        for (int type = 1; type < 5; type++) {
             phaseHolder = new PhaseHolder(engineConfig);
             phaseHolder.setFlowType(type);
-            Collection col = ((EngineConfigurationImpl)engineConfig).getModules().values();
+            Collection col = ((EngineConfigurationImpl) engineConfig).getModules().values();
             for (Iterator iterator = col.iterator(); iterator.hasNext();) {
                 AxisModule axismodule = (AxisModule) iterator.next();
                 switch (type) {
@@ -395,9 +406,9 @@
                          * If the phase property of a handler is pre-dispatch then those handlers
                          * should go to the global chain , to the pre-dispatch phase
                          */
-                        if(PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())){
+                        if (PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())) {
                             phaseHolder.addHandler(metadata);
-                        }  else {
+                        } else {
                             continue;
                         }
                     }
@@ -432,9 +443,9 @@
                 if (flow != null) {
                     for (int j = 0; j < flow.getHandlerCount(); j++) {
                         HandlerMetadata metadata = flow.getHandler(j);
-                        if(! PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())){
+                        if (!PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())) {
                             phaseHolder.addHandler(metadata);
-                        }  else {
+                        } else {
                             continue;
                         }
                     }

Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=168321&r1=168320&r2=168321&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Thu May  5 04:39:38 2005
@@ -80,6 +80,14 @@
             </properties>
 		<url>http://dist.codehaus.org/stax/jars/</url>
         </dependency>
+        <dependency>
+            <groupId>axis</groupId>
+            <artifactId>axis-wsdl4j</artifactId>
+            <version>1.2-RC3</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
     </dependencies>
 
     <!-- build information for the project -->