axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r366342 [1/2] - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/description/ xml/src/org/apache/axis2/soap/impl/llom/ xml/src/org/apache/axis2/soap/impl/llom/soap11/ xml/src/org/apache/axis2/soap/impl/llom/soap12/
Date Thu, 05 Jan 2006 23:40:29 GMT
Author: dims
Date: Thu Jan  5 15:40:11 2006
New Revision: 366342

URL: http://svn.apache.org/viewcvs?rev=366342&view=rev
Log:
javadoc changes

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/DescriptionConstants.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Flow.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowImpl.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowInclude.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowIncludeImpl.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Parameter.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterInclude.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultCodeImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap12/SOAP12FaultCodeImpl.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java Thu Jan  5 15:40:11 2006
@@ -1,133 +1,133 @@
-package org.apache.axis2.description;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.om.OMElement;
-import org.apache.wsdl.MessageReference;
-import org.apache.wsdl.impl.MessageReferenceImpl;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-
-/*
-* 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.
-*
-*/
-
-/**
- * This class represent the messages in WSDL , and there can be message element in services.xml
- * those will be representd by this class
- */
-public class AxisMessage implements ParameterInclude {
-    private ArrayList handlerChain;
-    private ParameterInclude parameterinclude;
-    private AxisOperation parent;
-    //to keep data in WSDL message refference and to keep the Java2WSDL data
-    // such as SchemaElementName , direction etc.
-    private MessageReference messageReference;
-    
-    private PolicyInclude policyInclude;
-
-    public AxisMessage() {
-        parameterinclude = new ParameterIncludeImpl();
-        handlerChain = new ArrayList();
-        messageReference = new MessageReferenceImpl();
-        policyInclude = new PolicyInclude();
-    }
-
-    public void addParameter(Parameter param) throws AxisFault {
-        if (param == null) {
-            return;
-        }
-
-        if (isParameterLocked(param.getName())) {
-            throw new AxisFault("Parmter is locked can not overide: " + param.getName());
-        } else {
-            parameterinclude.addParameter(param);
-        }
-    }
-
-    public void deserializeParameters(OMElement parameterElement) throws AxisFault {
-        parameterinclude.deserializeParameters(parameterElement);
-    }
-
-    public ArrayList getMessageFlow() {
-        return handlerChain;
-    }
-
-    public Parameter getParameter(String name) {
-        return parameterinclude.getParameter(name);
-    }
-
-    public ArrayList getParameters() {
-        return parameterinclude.getParameters();
-    }
-
-    public AxisOperation getParent() {
-        return parent;
-    }
-
-    public boolean isParameterLocked(String parameterName) {
-
-        // checking the locked value of parent
-        boolean loscked = false;
-
-        if (getParent() != null) {
-            loscked = getParent().isParameterLocked(parameterName);
-        }
-
-        if (loscked) {
-            return true;
-        } else {
-            Parameter parameter = getParameter(parameterName);
-
-            return (parameter != null) && parameter.isLocked();
-        }
-    }
-
-    public void setMessageFlow(ArrayList operationFlow) {
-        this.handlerChain = operationFlow;
-    }
-
-    public void setParent(AxisOperation parent) {
-        this.parent = parent;
-        if (parent.getPolicyInclude() != null) {
-            policyInclude.setParent(parent.getPolicyInclude());
-        }
-    }
-
-    public String getDirection() {
-        return messageReference.getDirection();
-    }
-
-    public void setDirection(String direction) {
-        messageReference.setDirection(direction);
-    }
-
-    public QName getElementQName() {
-        return messageReference.getElementQName();
-    }
-
-    public void setElementQName(QName element) {
-        messageReference.setElementQName(element);
-    }
-    
-    public void setPolicyInclude(PolicyInclude policyInclude) {
-        this.policyInclude = policyInclude;
-    }
-    
-    public PolicyInclude getPolicyInclude() {
-        return policyInclude;
-    }
-}
+package org.apache.axis2.description;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.om.OMElement;
+import org.apache.wsdl.MessageReference;
+import org.apache.wsdl.impl.MessageReferenceImpl;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+
+/*
+* 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.
+*
+*/
+
+/**
+ * This class represents the messages in WSDL. There can be message element in services.xml
+ * which are representd by this class.
+ */
+public class AxisMessage implements ParameterInclude {
+    private ArrayList handlerChain;
+    private ParameterInclude parameterinclude;
+    private AxisOperation parent;
+    //to keep data in WSDL message refference and to keep the Java2WSDL data
+    // such as SchemaElementName , direction etc.
+    private MessageReference messageReference;
+    
+    private PolicyInclude policyInclude;
+
+    public AxisMessage() {
+        parameterinclude = new ParameterIncludeImpl();
+        handlerChain = new ArrayList();
+        messageReference = new MessageReferenceImpl();
+        policyInclude = new PolicyInclude();
+    }
+
+    public void addParameter(Parameter param) throws AxisFault {
+        if (param == null) {
+            return;
+        }
+
+        if (isParameterLocked(param.getName())) {
+            throw new AxisFault("Parmter is locked can not overide: " + param.getName());
+        } else {
+            parameterinclude.addParameter(param);
+        }
+    }
+
+    public void deserializeParameters(OMElement parameterElement) throws AxisFault {
+        parameterinclude.deserializeParameters(parameterElement);
+    }
+
+    public ArrayList getMessageFlow() {
+        return handlerChain;
+    }
+
+    public Parameter getParameter(String name) {
+        return parameterinclude.getParameter(name);
+    }
+
+    public ArrayList getParameters() {
+        return parameterinclude.getParameters();
+    }
+
+    public AxisOperation getParent() {
+        return parent;
+    }
+
+    public boolean isParameterLocked(String parameterName) {
+
+        // checking the locked value of parent
+        boolean loscked = false;
+
+        if (getParent() != null) {
+            loscked = getParent().isParameterLocked(parameterName);
+        }
+
+        if (loscked) {
+            return true;
+        } else {
+            Parameter parameter = getParameter(parameterName);
+
+            return (parameter != null) && parameter.isLocked();
+        }
+    }
+
+    public void setMessageFlow(ArrayList operationFlow) {
+        this.handlerChain = operationFlow;
+    }
+
+    public void setParent(AxisOperation parent) {
+        this.parent = parent;
+        if (parent.getPolicyInclude() != null) {
+            policyInclude.setParent(parent.getPolicyInclude());
+        }
+    }
+
+    public String getDirection() {
+        return messageReference.getDirection();
+    }
+
+    public void setDirection(String direction) {
+        messageReference.setDirection(direction);
+    }
+
+    public QName getElementQName() {
+        return messageReference.getElementQName();
+    }
+
+    public void setElementQName(QName element) {
+        messageReference.setElementQName(element);
+    }
+    
+    public void setPolicyInclude(PolicyInclude policyInclude) {
+        this.policyInclude = policyInclude;
+    }
+    
+    public PolicyInclude getPolicyInclude() {
+        return policyInclude;
+    }
+}

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java Thu Jan  5 15:40:11 2006
@@ -72,12 +72,12 @@
     public abstract void addMessage(AxisMessage message, String label);
 
     /**
-     * To add a message Context into a operation context depending on MEPs this method has to
-     * be overided.
-     * Depending on the mep operation description know how to fill the message conetxt map
+     * Adds a message context into an operation context. Depending on MEPs, this
+     * method has to be overridden.
+     * Depending on the mep operation description know how to fill the message context map
      * in operationContext.
-     * As an exmple if the MEP is IN-OUT then depending on messagelbl operation description
-     * should know how to keep them in corret locations
+     * As an example, if the MEP is IN-OUT then depending on messagable operation description
+     * should know how to keep them in correct locations.
      *
      * @param msgContext <code>MessageContext</code>
      * @param opContext  <code>OperationContext</code>
@@ -91,7 +91,7 @@
     }
 
     /**
-     * Adding module configuration , if there is moduleConfig tag in operation
+     * Adds module configuration, if there is moduleConfig tag in operation.
      *
      * @param moduleConfiguration
      */
@@ -100,9 +100,9 @@
     }
 
     /**
-     * Method addParameter
+     * Method addParameter.
      *
-     * @param param Parameter that will be added
+     * @param param Parameter that is added
      */
     public void addParameter(Parameter param) throws AxisFault {
         if (param == null) {
@@ -121,7 +121,7 @@
     }
 
     /**
-     * To ebgage a module it is reuired to use this method
+     * Engages a module. It is required to use this method.
      *
      * @param moduleref
      * @throws AxisFault
@@ -154,10 +154,10 @@
     }
 
     /**
-     * This will not create a new operation context if there is no one already.
+     * Creates a new operation context if there is not one already.
      *
      * @param msgContext
-     * @return
+     * @return Returns OperationContext.
      * @throws AxisFault
      */
     public OperationContext findForExistingOperationContext(MessageContext msgContext)
@@ -188,8 +188,8 @@
     }
 
     /**
-     * This method is responsible for finding a MEPContext for an incomming
-     * messages. An incomming message can be of two states.
+     * Finds a MEPContext for an incoming message. An incoming message can be 
+     * of two states.
      * <p/>
      * 1)This is a new incomming message of a given MEP. 2)This message is a
      * part of an MEP which has already begun.
@@ -251,9 +251,9 @@
     }
 
     /**
-     * This method will simply map the String URI of the Message exchange
-     * pattern to a integer. Further in the first lookup it will cash the looked
-     * up value so that the subsequent method calls will be extremely efficient.
+     * Maps the String URI of the Message exchange pattern to a integer. 
+     * Further, in the first lookup, it will cache the looked
+     * up value so that the subsequent method calls are extremely efficient.
      */
     public int getAxisSpecifMEPConstant() {
         if (this.mep != MEP_CONSTANT_INVALID) {
@@ -296,7 +296,7 @@
      */
 
     /**
-     * Method getEngadgedModules
+     * Method getEngagedModules.
      */
     public Collection getEngagedModules() {
         return engagedModules;
@@ -325,7 +325,7 @@
     }
 
     /**
-     * Method getParameter
+     * Method getParameter.
      *
      * @param name Name of the parameter
      */
@@ -365,13 +365,13 @@
     public boolean isParameterLocked(String parameterName) {
 
         // checking the locked value of parent
-        boolean loscked = false;
+        boolean locked = false;
 
         if (getParent() != null) {
-            loscked = getParent().isParameterLocked(parameterName);
+            locked = getParent().isParameterLocked(parameterName);
         }
 
-        if (loscked) {
+        if (locked) {
             return true;
         } else {
             Parameter parameter = getParameter(parameterName);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Thu Jan  5 15:40:11 2006
@@ -92,7 +92,7 @@
     private PolicyInclude policyInclude;
 
     /**
-     * Constructor AxisService
+     * Constructor AxisService.
      */
     public AxisService() {
         this.parameterInclude = new ParameterIncludeImpl();
@@ -105,7 +105,7 @@
     }
 
     /**
-     * Constructor AxisService
+     * Constructor AxisService.
      */
     public AxisService(String name) {
         this();
@@ -121,7 +121,7 @@
     }
 
     /**
-     * Adding module configuration , if there is moduleConfig tag in service
+     * Adds module configuration , if there is moduleConfig tag in service.
      *
      * @param moduleConfiguration
      */
@@ -130,7 +130,7 @@
     }
 
     /**
-     * To add a operation to a service if a module requird to do so
+     * Adds an operation to a service if a module is required to do so.
      *
      * @param module
      */
@@ -166,7 +166,7 @@
      */
 
     /**
-     * Method addOperation
+     * Method addOperation.
      *
      * @param axisOperation
      */
@@ -197,7 +197,7 @@
     }
 
     /**
-     * Method addParameter
+     * Method addParameter.
      *
      * @param param
      */
@@ -214,10 +214,10 @@
     }
 
     /**
-     * To get a copy from module operation
+     * Gets a copy from module operation.
      *
      * @param axisOperation
-     * @return
+     * @return Returns AxisOperation.
      * @throws AxisFault
      */
     private AxisOperation copyOperation(AxisOperation axisOperation) throws AxisFault {
@@ -255,7 +255,7 @@
      */
 
     /**
-     * To ebgage a module it is reuired to use this method
+     * Engages a module. It is required to use this method.
      *
      * @param moduleref
      */
@@ -296,7 +296,7 @@
     }
 
     /**
-     * Map an action (ala WSA action) to the given operation. This is used by
+     * Maps an action (aka WSA action) to the given operation. This is used by
      * addressing based dispatching to figure out which operation it is that a
      * given message is for.
      *
@@ -367,9 +367,9 @@
     }
 
     /**
-     * To get the description about the service which is sepcified in services.xml
+     * Gets the description about the service which is specified in services.xml.
      *
-     * @return String
+     * @return Returns String.
      */
     public String getServiceDescription() {
         return serviceDescription;
@@ -382,16 +382,16 @@
      */
 
     /**
-     * Method getClassLoader
+     * Method getClassLoader.
      *
-     * @return ClassLoader
+     * @return Returns ClassLoader.
      */
     public ClassLoader getClassLoader() {
         return this.serviceClassLoader;
     }
 
     /**
-     * To get the control operation which are added by module like RM
+     * Gets the control operation which are added by module like RM.
      */
     public ArrayList getControlOperations() {
         Iterator op_itr = getOperations().values().iterator();
@@ -409,9 +409,9 @@
     }
 
     /**
-     * Method getEngadgedModules
+     * Method getEngagedModules.
      *
-     * @return Collection
+     * @return Returns Collection.
      */
     public Collection getEngagedModules() {
         return engagedModules;
@@ -438,10 +438,10 @@
     }
 
     /**
-     * Method getOperation
+     * Method getOperation.
      *
      * @param operationName
-     * @return AxisOperation
+     * @return Returns AxisOperation.
      */
     public AxisOperation getOperation(QName operationName) {
         AxisOperation axisOperation = (AxisOperation) operations.get(operationName);
@@ -454,25 +454,25 @@
     }
 
     /**
-     * Return the AxisOperation which has been mapped to the given action.
+     * Returns the AxisOperation which has been mapped to the given action.
      *
      * @param action the action key
-     * @return the corresponding AxisOperation or null if it isn't found
+     * @return Returns the corresponding AxisOperation or null if it isn't found.
      */
     public AxisOperation getOperationByAction(String action) {
         return (AxisOperation) operationsAliasesMap.get(action);
     }
 
     /**
-     * This method will return the operation given particular SOAP Action. This
-     * method should only be called if there is only one Endpoint is defined for
-     * this Service. If more than one Endpoint exists one of them will be
+     * Returns the operation given a SOAP Action. This
+     * method should be called if only one Endpoint is defined for
+     * this Service. If more than one Endpoint exists, one of them will be
      * picked. If more than one Operation is found with the given SOAP Action;
-     * null will be ruturned. If no particular Operation is found with the given
+     * null will be returned. If no particular Operation is found with the given
      * SOAP Action; null will be returned.
      *
      * @param soapAction SOAP Action defined for the particular Operation
-     * @return A AxisOperation if a unque Operation can be found with the given
+     * @return Returns an AxisOperation if a unique Operation can be found with the given
      *         SOAP Action otherwise will return null.
      */
     public AxisOperation getOperationBySOAPAction(String soapAction) {
@@ -492,9 +492,9 @@
     }
 
     /**
-     * Method getOperations
+     * Method getOperations.
      *
-     * @return HashMap
+     * @return Returns HashMap
      */
     public HashMap getOperations() {
         return operations;
@@ -507,10 +507,10 @@
      */
 
     /**
-     * Method getParameter
+     * Method getParameter.
      *
      * @param name
-     * @return Parameter
+     * @return Returns Parameter.
      */
     public Parameter getParameter(String name) {
         return parameterInclude.getParameter(name);
@@ -521,16 +521,16 @@
     }
 
     /**
-     * To get the parent (which is AxisConfiguration in this case)
+     * Gets the parent. (AxisConfiguration in this case)
      *
-     * @return <code>AxisConfiguration</code>
+     * @return Returns <code>AxisConfiguration</code>
      */
     public AxisServiceGroup getParent() {
         return parent;
     }
 
     /**
-     * To get only the publish operations
+     * Gets only the published operations.
      */
     public ArrayList getPublishedOperations() {
         Iterator op_itr = getOperations().values().iterator();
@@ -571,7 +571,7 @@
     }
 
     /**
-     * Set the description about the service wchih is specified in services.xml
+     * Sets the description about the service whish is specified in services.xml
      *
      * @param serviceDescription
      */
@@ -586,7 +586,7 @@
      */
 
     /**
-     * Method setClassLoader
+     * Method setClassLoader.
      *
      * @param classLoader
      */
@@ -599,7 +599,7 @@
     }
 
     /**
-     * This method will set the current time as last update time of the service
+     * Sets the current time as last update time of the service.
      */
     public void setLastupdate() {
         lastupdate = new Date().getTime();

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java Thu Jan  5 15:40:11 2006
@@ -76,7 +76,7 @@
     }
 
     /**
-     * Adding module configuration , if there is moduleConfig tag in service
+     * Adds module configuration , if there is moduleConfig tag in service.
      *
      * @param moduleConfiguration
      */

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/DescriptionConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/DescriptionConstants.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/DescriptionConstants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/DescriptionConstants.java Thu Jan  5 15:40:11 2006
@@ -45,7 +45,7 @@
     public static final String OPERATION_KEY = "OPERATION_KEY";
 
     /**
-     * Field PROVIDER_KEY
+     * Field MESSAGE_RECEIVER_KEY
      */
     public static final String MESSAGE_RECEIVER_KEY = "PROVIDER_KEY";
 
@@ -91,7 +91,7 @@
     public static final String OUTFLOW_KEY = "OUTFLOW_KEY";
 
     /**
-     * Field FAULTFLOW_KEY
+     * Field IN_FAULTFLOW_KEY
      */
     public static final String IN_FAULTFLOW_KEY = "IN_FAULTFLOW_KEY";
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Flow.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Flow.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Flow.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/Flow.java Thu Jan  5 15:40:11 2006
@@ -24,24 +24,24 @@
 public interface Flow {
 
     /**
-     * Method addHandler
+     * Method addHandler.
      *
      * @param handler
      */
     public void addHandler(HandlerDescription handler);
 
     /**
-     * Method getHandler
+     * Method getHandler.
      *
      * @param index
-     * @return
+     * @return Returns HandlerDescription.
      */
     public HandlerDescription getHandler(int index);
 
     /**
      * Method getHandlerCount
      *
-     * @return
+     * @return Returns int.
      */
     public int getHandlerCount();
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowImpl.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowImpl.java Thu Jan  5 15:40:11 2006
@@ -38,7 +38,7 @@
     }
 
     /**
-     * Method addHandler
+     * Method addHandler.
      *
      * @param handler
      */
@@ -47,19 +47,19 @@
     }
 
     /**
-     * Method getHandler
+     * Method getHandler.
      *
      * @param index
-     * @return
+     * @return Returns HandlerDescription.
      */
     public HandlerDescription getHandler(int index) {
         return (HandlerDescription) list.get(index);
     }
 
     /**
-     * Method getHandlerCount
+     * Method getHandlerCount.
      *
-     * @return
+     * @return Returns int.
      */
     public int getHandlerCount() {
         return list.size();

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowInclude.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowInclude.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowInclude.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowInclude.java Thu Jan  5 15:40:11 2006
@@ -23,51 +23,51 @@
 public interface FlowInclude {
 
     /**
-     * Method getFaultInFlow
+     * Method getFaultInFlow.
      *
-     * @return
+     * @return Returns Flow.
      */
     public Flow getFaultInFlow();
 
     public Flow getFaultOutFlow();
 
     /**
-     * Method getInFlow
+     * Method getInFlow.
      *
-     * @return
+     * @return Returns Flow.
      */
     public Flow getInFlow();
 
     /**
-     * Method getOutFlow
+     * Method getOutFlow.
      *
-     * @return
+     * @return Returns Flow.
      */
     public Flow getOutFlow();
 
     /**
-     * Method setFaultInFlow
+     * Method setFaultInFlow.
      *
      * @param faultFlow
      */
     public void setFaultInFlow(Flow faultFlow);
 
     /**
-     * Method setFaultInFlow
+     * Method setFaultOutFlow.
      *
      * @param faultFlow
      */
     public void setFaultOutFlow(Flow faultFlow);
 
     /**
-     * Method setInFlow
+     * Method setInFlow.
      *
      * @param inFlow
      */
     public void setInFlow(Flow inFlow);
 
     /**
-     * Method setOutFlow
+     * Method setOutFlow.
      *
      * @param outFlow
      */

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowIncludeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowIncludeImpl.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowIncludeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/FlowIncludeImpl.java Thu Jan  5 15:40:11 2006
@@ -39,9 +39,9 @@
     private Flow out;
 
     /**
-     * Method getFaultInFlow
+     * Method getFaultInFlow.
      *
-     * @return
+     * @return Returns Flow.
      */
     public Flow getFaultInFlow() {
         return In_fault;
@@ -52,25 +52,25 @@
     }
 
     /**
-     * Method getInFlow
+     * Method getInFlow.
      *
-     * @return
+     * @return Returns Flow.
      */
     public Flow getInFlow() {
         return in;
     }
 
     /**
-     * Method getOutFlow
+     * Method getOutFlow. 
      *
-     * @return
+     * @return Returns Flow.
      */
     public Flow getOutFlow() {
         return out;
     }
 
     /**
-     * Method setFaultInFlow
+     * Method setFaultInFlow.
      *
      * @param flow
      */
@@ -83,7 +83,7 @@
     }
 
     /**
-     * Method setInFlow
+     * Method setInFlow.
      *
      * @param flow
      */
@@ -92,7 +92,7 @@
     }
 
     /**
-     * Method setOutFlow
+     * Method setOutFlow.
      *
      * @param flow
      */

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/HandlerDescription.java Thu Jan  5 15:40:11 2006
@@ -25,7 +25,7 @@
 import java.util.ArrayList;
 
 /**
- * represent the deployment information about the handler
+ * Represents the deployment information about the handler
  */
 public class HandlerDescription implements ParameterInclude {
 
@@ -56,7 +56,7 @@
     private PhaseRule rules;
 
     /**
-     * Constructor HandlerDescription
+     * Constructor HandlerDescription.
      */
     public HandlerDescription() {
         this.parameterInclude = new ParameterIncludeImpl();
@@ -64,7 +64,7 @@
     }
 
     /**
-     * Constructor HandlerDescription
+     * Constructor HandlerDescription.
      *
      * @param name
      */
@@ -89,23 +89,23 @@
     }
 
     /**
-     * Method getClassName
+     * Method getClassName.
      *
-     * @return
+     * @return Returns String.
      */
     public String getClassName() {
         return className;
     }
 
     /**
-     * @return
+     * @return Returns Handler.
      */
     public Handler getHandler() {
         return handler;
     }
 
     /**
-     * @return
+     * @return Returns QName.
      */
     public QName getName() {
         return name;
@@ -113,7 +113,7 @@
 
     /**
      * @param name
-     * @return
+     * @return Returns Parameter.
      */
     public Parameter getParameter(String name) {
         return parameterInclude.getParameter(name);
@@ -128,9 +128,9 @@
     }
 
     /**
-     * Method getRules
+     * Method getRules.
      *
-     * @return
+     * @return Returns PhaseRule.
      */
     public PhaseRule getRules() {
         return rules;
@@ -148,7 +148,7 @@
     }
 
     /**
-     * Method setClassName
+     * Method setClassName.
      *
      * @param className
      */
@@ -175,7 +175,7 @@
     }
 
     /**
-     * Method setRules
+     * Method setRules.
      *
      * @param rules
      */

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleConfiguration.java Thu Jan  5 15:40:11 2006
@@ -29,8 +29,7 @@
  * <parameter> ....</parameter>
  * </moduleConfig>
  * <p/>
- * for the initilal stage this just keep set of parameters , but when the time
- * bean will be store more
+ * Right now this just keeps stores the set of parameters 
  */
 public class ModuleConfiguration implements ParameterInclude {
     private QName moduleName;

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ModuleDescription.java Thu Jan  5 15:40:11 2006
@@ -32,7 +32,7 @@
  * <li>parameters<li>
  * <li>handlers<li>
  * <ol>
- * <p>Handler are registered once they are avlible but they avalibe to all services if axis2.xml
+ * <p>Handler are registered once they are available. They are available to all services if axis2.xml
  * has a module ref="." or avalible to a single service if services.xml have module ref=".."</p>
  */
 public class ModuleDescription implements FlowInclude, ParameterInclude {
@@ -64,7 +64,7 @@
     private PolicyInclude policyInclude;
 
     /**
-     * Constructor ModuleDescription
+     * Constructor ModuleDescription.
      */
     public ModuleDescription() {
         operations = new HashMap();
@@ -72,7 +72,7 @@
     }
 
     /**
-     * Constructor ModuleDescription
+     * Constructor ModuleDescription.
      *
      * @param name
      */
@@ -101,7 +101,7 @@
     }
 
     /**
-     * @return
+     * @return Returns Flow.
      */
     public Flow getFaultInFlow() {
         return flowInclude.getFaultInFlow();
@@ -112,14 +112,14 @@
     }
 
     /**
-     * @return
+     * @return Returns Flow.
      */
     public Flow getInFlow() {
         return flowInclude.getInFlow();
     }
 
     /**
-     * @return
+     * @return Returns Module.
      */
     public Module getModule() {
         return module;
@@ -130,7 +130,7 @@
     }
 
     /**
-     * @return
+     * @return Returns QName.
      */
     public QName getName() {
         return name;
@@ -141,7 +141,7 @@
     }
 
     /**
-     * @return
+     * @return Returns Flow.
      */
     public Flow getOutFlow() {
         return flowInclude.getOutFlow();
@@ -149,7 +149,7 @@
 
     /**
      * @param name
-     * @return
+     * @return Returns Parameter.
      */
     public Parameter getParameter(String name) {
         return parameters.getParameter(name);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java Thu Jan  5 15:40:11 2006
@@ -1,394 +1,394 @@
-package org.apache.axis2.description;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.ListenerManager;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.async.AsyncResult;
-import org.apache.axis2.client.async.Callback;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.engine.AxisEngine;
-import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.soap.SOAPBody;
-import org.apache.axis2.soap.SOAPEnvelope;
-import org.apache.axis2.soap.SOAPFault;
-import org.apache.axis2.transport.TransportUtils;
-import org.apache.axis2.util.CallbackReceiver;
-import org.apache.wsdl.WSDLConstants;
-
-import javax.xml.namespace.QName;
-import java.util.HashMap;
-
-/**
- * Author: Deepal Jayasinghe Date: Oct 3, 2005 Time: 6:01:33 PM
- */
-public class OutInAxisOperation extends InOutAxisOperation {
-    public OutInAxisOperation() {
-        super();
-    }
-
-    public OutInAxisOperation(QName name) {
-        super(name);
-    }
-
-    public void addMessageContext(MessageContext msgContext,
-                                  OperationContext opContext) throws AxisFault {
-        HashMap mep = opContext.getMessageContexts();
-        MessageContext immsgContext = (MessageContext) mep
-                .get(MESSAGE_LABEL_IN_VALUE);
-        MessageContext outmsgContext = (MessageContext) mep
-                .get(MESSAGE_LABEL_OUT_VALUE);
-
-        if ((immsgContext != null) && (outmsgContext != null)) {
-            throw new AxisFault(
-                    "Invalid message addition , operation context completed");
-        }
-
-        if (outmsgContext == null) {
-            mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
-        } else {
-            mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
-            opContext.setComplete(true);
-        }
-    }
-
-    /**
-     * Return a MEP client for an Out-IN operation. This client can be used to
-     * interact with a server which is offering an In-Out operation. To use the
-     * client, you must call addMessageContext() with a message context and then
-     * call execute() to execute the client.
-     *
-     * @param sc      The service context for this client to live within. Cannot be
-     *                null.
-     * @param options Options to use as defaults for this client. If any options are
-     *                set specifically on the client then those override options
-     *                here.
-     */
-    public OperationClient createClient(ServiceContext sc, Options options) {
-        return new OutInAxisOperationClient(this, sc, options);
-    }
-}
-
-/**
- * MEP client for moi.
- */
-class OutInAxisOperationClient implements OperationClient {
-
-    private OutInAxisOperation axisOp;
-
-    private ServiceContext sc;
-
-    private Options options;
-
-    private OperationContext oc;
-
-    private Callback callback;
-
-    /*
-     * indicates whether the MEP execution has completed (and hence ready for
-     * resetting)
-     */
-    boolean completed;
-
-    OutInAxisOperationClient(OutInAxisOperation axisOp, ServiceContext sc,
-                             Options options) {
-        this.axisOp = axisOp;
-        this.sc = sc;
-        this.options = new Options(options);
-        this.completed = false;
-        this.oc = new OperationContext(axisOp);
-        this.oc.setParent(this.sc);
-    }
-
-    /**
-     * Sets the options that should be used for this particular client. This
-     * resets the entire set of options to use the new options - so you'd lose
-     * any option cascading that may have been set up.
-     *
-     * @param options the options
-     */
-    public void setOptions(Options options) {
-        this.options = options;
-    }
-
-    /**
-     * Return the options used by this client. If you want to set a single
-     * option, then the right way is to do getOptions() and set specific
-     * options.
-     *
-     * @return the options, which will never be null.
-     */
-    public Options getOptions() {
-        return options;
-    }
-
-    /**
-     * Adding message context to operation context , so that it will handle the
-     * logic correctly if the OperationContext is null then new one will be
-     * created , and oc will become null when some one call reset()
-     *
-     * @param mc
-     * @throws AxisFault
-     */
-    public void addMessageContext(MessageContext mc) throws AxisFault {
-        axisOp.registerOperationContext(mc, oc);
-        mc.setServiceContext(sc);
-        mc.setConfigurationContext(sc.getConfigurationContext());
-    }
-
-    /**
-     * Retun the message context for a given message lebel
-     *
-     * @param messageLabel :
-     *                     label of the message and that can be either "Out" or "In" and
-     *                     nothing else
-     * @return
-     * @throws AxisFault
-     */
-    public MessageContext getMessageContext(String messageLabel)
-            throws AxisFault {
-        return oc.getMessageContext(messageLabel);
-    }
-
-    public void setCallback(Callback callback) {
-        this.callback = callback;
-    }
-
-    /**
-     * Execute the MEP. What this does depends on the specific MEP client. The
-     * basic idea is to have the MEP client execute and do something with the
-     * messages that have been added to it so far. For example, if its an Out-In
-     * MEP, then if the Out message has been set, then executing the client asks
-     * it to send the message and get the In message, possibly using a different
-     * thread.
-     *
-     * @param block Indicates whether execution should block or return ASAP. What
-     *              block means is of course a function of the specific MEP
-     *              client. IGNORED BY THIS MEP CLIENT.
-     * @throws AxisFault if something goes wrong during the execution of the MEP.
-     */
-    public void execute(boolean block) throws AxisFault {
-        if (completed) {
-            throw new AxisFault(
-                    "MEP is already completed- need to reset() before re-executing.");
-        }
-        ConfigurationContext cc = sc.getConfigurationContext();
-
-        // copy interesting info from options to message context.
-        MessageContext mc = oc
-                .getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-        if (mc == null) {
-            throw new AxisFault(
-                    "Out message context is null ,"
-                            + " please set the out message context before calling this method");
-        }
-        mc.setOperationContext(oc);
-        mc.setAxisOperation(axisOp);
-        mc.setServiceContext(sc);
-        mc.setOptions(options);
-
-        // if the transport to use for sending is not specified, try to find it
-        // from the URL
-        TransportOutDescription transportOut = options.getTranportOut();
-        if (transportOut == null) {
-            EndpointReference toEPR = (options.getTo() != null) ? options
-                    .getTo() : mc.getTo();
-            transportOut = ClientUtils.inferOutTransport(cc
-                    .getAxisConfiguration(), toEPR);
-        }
-        mc.setTransportOut(transportOut);
-        if (mc.getTransportIn() == null) {
-            TransportInDescription transportIn = options.getTransportIn();
-            if (transportIn == null) {
-                mc.setTransportIn(ClientUtils.inferInTransport(cc
-                        .getAxisConfiguration(), options, mc
-                        .getServiceContext()));
-            } else {
-                mc.setTransportIn(transportIn);
-            }
-        }
-
-        if (options.isUseSeparateListener()) {
-            CallbackReceiver callbackReceiver = (CallbackReceiver) axisOp
-                    .getMessageReceiver();
-            callbackReceiver.addCallback(mc.getMessageID(), callback);
-            EndpointReference replyToFromTransport = ListenerManager
-                    .replyToEPR(cc, sc.getAxisService().getName() + "/"
-                            + axisOp.getName().getLocalPart(), options
-                            .getTransportIn().getName()
-                            .getLocalPart());
-
-            if (mc.getReplyTo() == null) {
-                mc.setReplyTo(replyToFromTransport);
-            } else {
-                mc.getReplyTo().setAddress(replyToFromTransport.getAddress());
-            }
-            AxisEngine engine = new AxisEngine(cc);
-            engine.send(mc);
-        }
-
-        else
-
-        {
-            if (block) {
-                // Send the SOAP Message and receive a response
-                MessageContext response = send(mc, options
-                        .getTransportIn());
-                // check for a fault and return the result
-                SOAPEnvelope resenvelope = response.getEnvelope();
-                if (resenvelope.getBody().hasFault()) {
-                    SOAPFault soapFault = resenvelope.getBody().getFault();
-                    Exception ex = soapFault.getException();
-
-                    if (options.isExceptionToBeThrownOnSOAPFault()) {
-
-                        // does the SOAPFault has a detail element for Excpetion
-                        if (ex != null) {
-                            throw new AxisFault(ex);
-                        } else {
-
-                            // if detail element not present create a new
-                            // Exception from the detail
-                            String message = "";
-
-                            message = (message + "Code =" + soapFault.getCode() == null) ? ""
-                                    : (soapFault.getCode().getValue() == null) ? ""
-                                    : soapFault.getCode().getValue()
-                                    .getText();
-                            message = (message + "Reason ="
-                                    + soapFault.getReason() == null) ? ""
-                                    : (soapFault.getReason().getSOAPText() == null) ? ""
-                                    : soapFault.getReason()
-                                    .getSOAPText().getText();
-
-                            throw new AxisFault(message);
-                        }
-                    }
-                }
-                completed = true;
-            } else {
-                sc.getConfigurationContext().getThreadPool().execute(
-                        new NonBlockingInvocationWorker(callback, mc));
-            }
-        }
-    }
-
-    /**
-     * Sends the message using a two way transport and waits for a response
-     *
-     * @param msgctx
-     * @param transportIn
-     * @return
-     * @throws AxisFault
-     */
-    public MessageContext send(MessageContext msgctx,
-                               TransportInDescription transportIn) throws AxisFault {
-        AxisEngine engine = new AxisEngine(msgctx.getConfigurationContext());
-
-        engine.send(msgctx);
-
-        // create the responseMessageContext
-        MessageContext responseMessageContext = new MessageContext();
-
-        responseMessageContext.setConfigurationContext(msgctx.getConfigurationContext());
-        responseMessageContext.setSessionContext(msgctx.getSessionContext());
-        responseMessageContext.setTransportIn(msgctx.getTransportIn());
-        responseMessageContext.setTransportOut(msgctx.getTransportOut());
-
-        responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgctx
-                .getProperty(MessageContext.TRANSPORT_IN));
-        addMessageContext(responseMessageContext);
-        responseMessageContext.setServerSide(false);
-        responseMessageContext.setServiceContext(msgctx.getServiceContext());
-        responseMessageContext.setServiceGroupContext(msgctx
-                .getServiceGroupContext());
-
-        // If request is REST we assume the responseMessageContext is REST, so
-        // set the variable
-        responseMessageContext.setDoingREST(msgctx.isDoingREST());
-
-        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(
-                responseMessageContext, msgctx.getEnvelope().getNamespace()
-                .getName());
-
-        if (resenvelope != null) {
-            responseMessageContext.setEnvelope(resenvelope);
-            engine = new AxisEngine(msgctx.getConfigurationContext());
-            engine.receive(responseMessageContext);
-        } else {
-            throw new AxisFault(Messages
-                    .getMessage("blockingInvocationExpectsResponse"));
-        }
-        return responseMessageContext;
-    }
-
-    /**
-     * Reset the MEP client to a clean status after the MEP has completed. This
-     * is how you can reuse a MEP client. NOTE: this does not reset the options;
-     * only the internal state so the client can be used again.
-     *
-     * @throws AxisFault if reset is called before the MEP client has completed an
-     *                   interaction.
-     */
-    public void reset() throws AxisFault {
-        if (!completed) {
-            throw new AxisFault("MEP is not yet complete: cannot reset");
-        }
-        oc = null;
-        completed = false;
-    }
-
-    /**
-     * This class is the workhorse for a non-blocking invocation that uses a two
-     * way transport.
-     */
-    private class NonBlockingInvocationWorker implements Runnable {
-        private Callback callback;
-
-        private MessageContext msgctx;
-
-        public NonBlockingInvocationWorker(Callback callback,
-                                           MessageContext msgctx) {
-            this.callback = callback;
-            this.msgctx = msgctx;
-        }
-
-        public void run() {
-            try {
-
-                // send the request and wait for reponse
-                MessageContext response = send(msgctx, options
-                        .getTransportIn());
-
-                // call the callback
-                SOAPEnvelope resenvelope = response.getEnvelope();
-                SOAPBody body = resenvelope.getBody();
-
-                if (body.hasFault()) {
-                    Exception ex = body.getFault().getException();
-
-                    if (ex != null) {
-                        callback.onError(ex);
-                    } else {
-
-                        // todo this needs to be fixed
-                        callback.onError(new Exception(body.getFault()
-                                .getReason().getText()));
-                    }
-                } else {
-                    AsyncResult asyncResult = new AsyncResult(response);
-
-                    callback.onComplete(asyncResult);
-                }
-
-                callback.setComplete(true);
-            } catch (Exception e) {
-                callback.onError(e);
-            }
-        }
-    }
-}
+package org.apache.axis2.description;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.ListenerManager;
+import org.apache.axis2.client.OperationClient;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.soap.SOAPBody;
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.axis2.soap.SOAPFault;
+import org.apache.axis2.transport.TransportUtils;
+import org.apache.axis2.util.CallbackReceiver;
+import org.apache.wsdl.WSDLConstants;
+
+import javax.xml.namespace.QName;
+import java.util.HashMap;
+
+/**
+ * Author: Deepal Jayasinghe Date: Oct 3, 2005 Time: 6:01:33 PM
+ */
+public class OutInAxisOperation extends InOutAxisOperation {
+    public OutInAxisOperation() {
+        super();
+    }
+
+    public OutInAxisOperation(QName name) {
+        super(name);
+    }
+
+    public void addMessageContext(MessageContext msgContext,
+                                  OperationContext opContext) throws AxisFault {
+        HashMap mep = opContext.getMessageContexts();
+        MessageContext immsgContext = (MessageContext) mep
+                .get(MESSAGE_LABEL_IN_VALUE);
+        MessageContext outmsgContext = (MessageContext) mep
+                .get(MESSAGE_LABEL_OUT_VALUE);
+
+        if ((immsgContext != null) && (outmsgContext != null)) {
+            throw new AxisFault(
+                    "Invalid message addition , operation context completed");
+        }
+
+        if (outmsgContext == null) {
+            mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
+        } else {
+            mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
+            opContext.setComplete(true);
+        }
+    }
+
+    /**
+     * Returns a MEP client for an Out-IN operation. This client can be used to
+     * interact with a server which is offering an In-Out operation. To use the
+     * client, you must call addMessageContext() with a message context and then
+     * call execute() to execute the client.
+     *
+     * @param sc      The service context for this client to live within. Cannot be
+     *                null.
+     * @param options Options to use as defaults for this client. If any options are
+     *                set specifically on the client then those override options
+     *                here.
+     */
+    public OperationClient createClient(ServiceContext sc, Options options) {
+        return new OutInAxisOperationClient(this, sc, options);
+    }
+}
+
+/**
+ * MEP client for moi.
+ */
+class OutInAxisOperationClient implements OperationClient {
+
+    private OutInAxisOperation axisOp;
+
+    private ServiceContext sc;
+
+    private Options options;
+
+    private OperationContext oc;
+
+    private Callback callback;
+
+    /*
+     * indicates whether the MEP execution has completed (and hence ready for
+     * resetting)
+     */
+    boolean completed;
+
+    OutInAxisOperationClient(OutInAxisOperation axisOp, ServiceContext sc,
+                             Options options) {
+        this.axisOp = axisOp;
+        this.sc = sc;
+        this.options = new Options(options);
+        this.completed = false;
+        this.oc = new OperationContext(axisOp);
+        this.oc.setParent(this.sc);
+    }
+
+    /**
+     * Sets the options that should be used for this particular client. This
+     * resets the entire set of options to use the new options - so you'd lose
+     * any option cascading that may have been set up.
+     *
+     * @param options the options
+     */
+    public void setOptions(Options options) {
+        this.options = options;
+    }
+
+    /**
+     * Returns the options used by this client. If you want to set a single
+     * option, then the right way is to call getOptions() and set specific
+     * options.
+     *
+     * @return Returns the options, which will never be null.
+     */
+    public Options getOptions() {
+        return options;
+    }
+
+    /**
+     * Adds message context to operation context , so that it will handle the
+     * logic correctly if the OperationContext is null then new one will be
+     * created , and Operation Context will become null when some one calls reset().
+     *
+     * @param mc
+     * @throws AxisFault
+     */
+    public void addMessageContext(MessageContext mc) throws AxisFault {
+        axisOp.registerOperationContext(mc, oc);
+        mc.setServiceContext(sc);
+        mc.setConfigurationContext(sc.getConfigurationContext());
+    }
+
+    /**
+     * Returns the message context for a given message label.
+     *
+     * @param messageLabel :
+     *                     label of the message and that can be either "Out" or "In" and
+     *                     nothing else
+     * @return Returns MessageContext.
+     * @throws AxisFault
+     */
+    public MessageContext getMessageContext(String messageLabel)
+            throws AxisFault {
+        return oc.getMessageContext(messageLabel);
+    }
+
+    public void setCallback(Callback callback) {
+        this.callback = callback;
+    }
+
+    /**
+     * Executes the MEP. What this does depends on the specific MEP client. The
+     * basic idea is to have the MEP client execute and do something with the
+     * messages that have been added to it so far. For example, if its an Out-In
+     * MEP, then if the Out message has been set, then executing the client asks
+     * it to send the message and get the In message, possibly using a different
+     * thread.
+     *
+     * @param block Indicates whether execution should block or return ASAP. What
+     *              block means is of course a function of the specific MEP
+     *              client. IGNORED BY THIS MEP CLIENT.
+     * @throws AxisFault if something goes wrong during the execution of the MEP.
+     */
+    public void execute(boolean block) throws AxisFault {
+        if (completed) {
+            throw new AxisFault(
+                    "MEP is already completed- need to reset() before re-executing.");
+        }
+        ConfigurationContext cc = sc.getConfigurationContext();
+
+        // copy interesting info from options to message context.
+        MessageContext mc = oc
+                .getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+        if (mc == null) {
+            throw new AxisFault(
+                    "Out message context is null ,"
+                            + " please set the out message context before calling this method");
+        }
+        mc.setOperationContext(oc);
+        mc.setAxisOperation(axisOp);
+        mc.setServiceContext(sc);
+        mc.setOptions(options);
+
+        // if the transport to use for sending is not specified, try to find it
+        // from the URL
+        TransportOutDescription transportOut = options.getTranportOut();
+        if (transportOut == null) {
+            EndpointReference toEPR = (options.getTo() != null) ? options
+                    .getTo() : mc.getTo();
+            transportOut = ClientUtils.inferOutTransport(cc
+                    .getAxisConfiguration(), toEPR);
+        }
+        mc.setTransportOut(transportOut);
+        if (mc.getTransportIn() == null) {
+            TransportInDescription transportIn = options.getTransportIn();
+            if (transportIn == null) {
+                mc.setTransportIn(ClientUtils.inferInTransport(cc
+                        .getAxisConfiguration(), options, mc
+                        .getServiceContext()));
+            } else {
+                mc.setTransportIn(transportIn);
+            }
+        }
+
+        if (options.isUseSeparateListener()) {
+            CallbackReceiver callbackReceiver = (CallbackReceiver) axisOp
+                    .getMessageReceiver();
+            callbackReceiver.addCallback(mc.getMessageID(), callback);
+            EndpointReference replyToFromTransport = ListenerManager
+                    .replyToEPR(cc, sc.getAxisService().getName() + "/"
+                            + axisOp.getName().getLocalPart(), options
+                            .getTransportIn().getName()
+                            .getLocalPart());
+
+            if (mc.getReplyTo() == null) {
+                mc.setReplyTo(replyToFromTransport);
+            } else {
+                mc.getReplyTo().setAddress(replyToFromTransport.getAddress());
+            }
+            AxisEngine engine = new AxisEngine(cc);
+            engine.send(mc);
+        }
+
+        else
+
+        {
+            if (block) {
+                // Send the SOAP Message and receive a response
+                MessageContext response = send(mc, options
+                        .getTransportIn());
+                // check for a fault and return the result
+                SOAPEnvelope resenvelope = response.getEnvelope();
+                if (resenvelope.getBody().hasFault()) {
+                    SOAPFault soapFault = resenvelope.getBody().getFault();
+                    Exception ex = soapFault.getException();
+
+                    if (options.isExceptionToBeThrownOnSOAPFault()) {
+
+                        // does the SOAPFault has a detail element for Excpetion
+                        if (ex != null) {
+                            throw new AxisFault(ex);
+                        } else {
+
+                            // if detail element not present create a new
+                            // Exception from the detail
+                            String message = "";
+
+                            message = (message + "Code =" + soapFault.getCode() == null) ? ""
+                                    : (soapFault.getCode().getValue() == null) ? ""
+                                    : soapFault.getCode().getValue()
+                                    .getText();
+                            message = (message + "Reason ="
+                                    + soapFault.getReason() == null) ? ""
+                                    : (soapFault.getReason().getSOAPText() == null) ? ""
+                                    : soapFault.getReason()
+                                    .getSOAPText().getText();
+
+                            throw new AxisFault(message);
+                        }
+                    }
+                }
+                completed = true;
+            } else {
+                sc.getConfigurationContext().getThreadPool().execute(
+                        new NonBlockingInvocationWorker(callback, mc));
+            }
+        }
+    }
+
+    /**
+     * Sends the message using a two way transport and waits for a response
+     *
+     * @param msgctx
+     * @param transportIn
+     * @return Returns MessageContext.
+     * @throws AxisFault
+     */
+    public MessageContext send(MessageContext msgctx,
+                               TransportInDescription transportIn) throws AxisFault {
+        AxisEngine engine = new AxisEngine(msgctx.getConfigurationContext());
+
+        engine.send(msgctx);
+
+        // create the responseMessageContext
+        MessageContext responseMessageContext = new MessageContext();
+
+        responseMessageContext.setConfigurationContext(msgctx.getConfigurationContext());
+        responseMessageContext.setSessionContext(msgctx.getSessionContext());
+        responseMessageContext.setTransportIn(msgctx.getTransportIn());
+        responseMessageContext.setTransportOut(msgctx.getTransportOut());
+
+        responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgctx
+                .getProperty(MessageContext.TRANSPORT_IN));
+        addMessageContext(responseMessageContext);
+        responseMessageContext.setServerSide(false);
+        responseMessageContext.setServiceContext(msgctx.getServiceContext());
+        responseMessageContext.setServiceGroupContext(msgctx
+                .getServiceGroupContext());
+
+        // If request is REST we assume the responseMessageContext is REST, so
+        // set the variable
+        responseMessageContext.setDoingREST(msgctx.isDoingREST());
+
+        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(
+                responseMessageContext, msgctx.getEnvelope().getNamespace()
+                .getName());
+
+        if (resenvelope != null) {
+            responseMessageContext.setEnvelope(resenvelope);
+            engine = new AxisEngine(msgctx.getConfigurationContext());
+            engine.receive(responseMessageContext);
+        } else {
+            throw new AxisFault(Messages
+                    .getMessage("blockingInvocationExpectsResponse"));
+        }
+        return responseMessageContext;
+    }
+
+    /**
+     * Resets the MEP client to a clean status after the MEP has completed. This
+     * is how you can reuse a MEP client. NOTE: this does not reset the options;
+     * only the internal state so the client can be used again.
+     *
+     * @throws AxisFault if reset is called before the MEP client has completed an
+     *                   interaction.
+     */
+    public void reset() throws AxisFault {
+        if (!completed) {
+            throw new AxisFault("MEP is not yet complete: cannot reset");
+        }
+        oc = null;
+        completed = false;
+    }
+
+    /**
+     * This class is the workhorse for a non-blocking invocation that uses a two
+     * way transport.
+     */
+    private class NonBlockingInvocationWorker implements Runnable {
+        private Callback callback;
+
+        private MessageContext msgctx;
+
+        public NonBlockingInvocationWorker(Callback callback,
+                                           MessageContext msgctx) {
+            this.callback = callback;
+            this.msgctx = msgctx;
+        }
+
+        public void run() {
+            try {
+
+                // send the request and wait for reponse
+                MessageContext response = send(msgctx, options
+                        .getTransportIn());
+
+                // call the callback
+                SOAPEnvelope resenvelope = response.getEnvelope();
+                SOAPBody body = resenvelope.getBody();
+
+                if (body.hasFault()) {
+                    Exception ex = body.getFault().getException();
+
+                    if (ex != null) {
+                        callback.onError(ex);
+                    } else {
+
+                        // todo this needs to be fixed
+                        callback.onError(new Exception(body.getFault()
+                                .getReason().getText()));
+                    }
+                } else {
+                    AsyncResult asyncResult = new AsyncResult(response);
+
+                    callback.onComplete(asyncResult);
+                }
+
+                callback.setComplete(true);
+            } catch (Exception e) {
+                callback.onError(e);
+            }
+        }
+    }
+}

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java?rev=366342&r1=366341&r2=366342&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java Thu Jan  5 15:40:11 2006
@@ -1,290 +1,290 @@
-package org.apache.axis2.description;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.async.Callback;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.engine.AxisEngine;
-import org.apache.wsdl.WSDLConstants;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-
-public class OutOnlyAxisOperation extends AxisOperation {
-    private AxisMessage inFaultMessage;
-
-    // just to keep the inflow , there wont be any usage
-    private ArrayList inPhases;
-
-    private AxisMessage outFaultMessage;
-
-    private AxisMessage outMessage;
-
-    public OutOnlyAxisOperation() {
-        super();
-        createMessage();
-    }
-
-    public OutOnlyAxisOperation(QName name) {
-        super(name);
-        createMessage();
-    }
-
-    public void addMessage(AxisMessage message, String label) {
-        if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
-            outMessage = message;
-        } else {
-            throw new UnsupportedOperationException("Not yet implemented");
-        }
-    }
-
-    public void addMessageContext(MessageContext msgContext,
-            OperationContext opContext) throws AxisFault {
-        if (!opContext.isComplete()) {
-            opContext.getMessageContexts().put(MESSAGE_LABEL_OUT_VALUE,
-                    msgContext);
-            opContext.setComplete(true);
-        } else {
-            throw new AxisFault(
-                    "Invalid message addition , operation context completed");
-        }
-    }
-
-    private void createMessage() {
-        outMessage = new AxisMessage();
-        outMessage.setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
-        inFaultMessage = new AxisMessage();
-        outFaultMessage = new AxisMessage();
-        inPhases = new ArrayList();
-    }
-
-    public AxisMessage getMessage(String label) {
-        if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
-            return outMessage;
-        } else {
-            throw new UnsupportedOperationException("Not yet implemented");
-        }
-    }
-
-    public ArrayList getPhasesInFaultFlow() {
-        return inFaultMessage.getMessageFlow();
-    }
-
-    public ArrayList getPhasesOutFaultFlow() {
-        return outFaultMessage.getMessageFlow();
-    }
-
-    public ArrayList getPhasesOutFlow() {
-        return outMessage.getMessageFlow();
-    }
-
-    public ArrayList getRemainingPhasesInFlow() {
-        return inPhases;
-    }
-
-    public void setPhasesInFaultFlow(ArrayList list) {
-        inFaultMessage.setMessageFlow(list);
-    }
-
-    public void setPhasesOutFaultFlow(ArrayList list) {
-        outFaultMessage.setMessageFlow(list);
-    }
-
-    public void setPhasesOutFlow(ArrayList list) {
-        outMessage.setMessageFlow(list);
-    }
-
-    public void setRemainingPhasesInFlow(ArrayList list) {
-        inPhases = list;
-    }
-
-    /**
-     * Return a MEP client for an Out-only operation. This client can be used to
-     * interact with a server which is offering an In-only operation. To use the
-     * client, you must call addMessageContext() with a message context and then
-     * call execute() to execute the client. Note that the execute method's
-     * block parameter is ignored by this client and also the setMessageReceiver
-     * method cannot be used.
-     *
-     * @param sc
-     *            The service context for this client to live within. Cannot be
-     *            null.
-     * @param options
-     *            Options to use as defaults for this client. If any options are
-     *            set specifically on the client then those override options
-     *            here.
-     */
-    public OperationClient createClient(ServiceContext sc, Options options) {
-        return new OutOnlyAxisOperationClient(this, sc, options);
-    }
-}
-
-/**
- * MEP client for moi.
- */
-class OutOnlyAxisOperationClient implements OperationClient {
-    OutOnlyAxisOperation axisOp;
-
-    ServiceContext sc;
-
-    Options options;
-
-    MessageContext mc;
-
-    /*
-     * indicates whether the MEP execution has completed (and hence ready for
-     * resetting)
-     */
-    boolean completed;
-
-    OutOnlyAxisOperationClient(OutOnlyAxisOperation axisOp, ServiceContext sc,
-            Options options) {
-        this.axisOp = axisOp;
-        this.sc = sc;
-        this.options = new Options(options);
-        this.completed = false;
-    }
-
-    /**
-     * Sets the options that should be used for this particular client. This
-     * resets the entire set of options to use the new options - so you'd lose
-     * any option cascading that may have been set up.
-     *
-     * @param options
-     *            the options
-     */
-    public void setOptions(Options options) {
-        this.options = options;
-    }
-
-    /**
-     * Return the options used by this client. If you want to set a single
-     * option, then the right way is to do getOptions() and set specific
-     * options.
-     *
-     * @return the options, which will never be null.
-     */
-    public Options getOptions() {
-        return options;
-    }
-
-    /**
-     * Add a message context to the client for processing. This method must not
-     * process the message - it only records it in the MEP client. Processing
-     * only occurs when execute() is called.
-     *
-     * @param mc
-     *            the message context
-     * @throws AxisFault
-     *             if this is called inappropriately.
-     */
-    public void addMessageContext(MessageContext mc) throws AxisFault {
-        if (this.mc != null) {
-            throw new AxisFault(
-                    "Can't add message context again until client has been executed");
-        }
-        this.mc = mc;
-        this.completed = false;
-    }
-
-    /**
-     * Return a message from the client - will return null if the requested
-     * message is not available.
-     *
-     * @param messageLabel
-     *            the message label of the desired message context
-     * @return the desired message context or null if its not available.
-     * @throws AxisFault
-     *             if the message label is invalid
-     */
-    public MessageContext getMessageContext(String messageLabel)
-            throws AxisFault {
-        if (messageLabel.equals(WSDLConstants.MESSAGE_LABEL_OUT_VALUE)) {
-            return mc;
-        }
-        throw new AxisFault("Unknown message label: '" + messageLabel + "'");
-    }
-
-    /**
-     * Set the message receiver to be executed when a message comes into the MEP
-     * and the MEP is executed. This is the way the MEP client provides
-     * notification that a message has been received by it. Exactly when its
-     * executed and under what conditions is a function of the specific MEP
-     * client.
-     */
-    public void setCallback(Callback callback) {
-        throw new UnsupportedOperationException(
-                "This feature is not supported by this MEP");
-    }
-
-    /**
-     * Execute the MEP. What this does depends on the specific MEP client. The
-     * basic idea is to have the MEP client execute and do something with the
-     * messages that have been added to it so far. For example, if its an Out-In
-     * MEP, then if the Out message has been set, then executing the client asks
-     * it to send the message and get the In message, possibly using a different
-     * thread.
-     *
-     * @param block
-     *            Indicates whether execution should block or return ASAP. What
-     *            block means is of course a function of the specific MEP
-     *            client. IGNORED BY THIS MEP CLIENT.
-     * @throws AxisFault
-     *             if something goes wrong during the execution of the MEP.
-     */
-    public void execute(boolean block) throws AxisFault {
-        if (completed) {
-            throw new AxisFault(
-                    "MEP is already completed- need to reset() before re-executing.");
-        }
-        ConfigurationContext cc = sc.getConfigurationContext();
-
-        // set options on the message context
-        mc.setOptions(options);
-
-        // if the transport to use for sending is not specified, try to find it
-        // from the URL
-        TransportOutDescription senderTransport = options.getTranportOut();
-        if (senderTransport == null) {
-            EndpointReference toEPR = (options.getTo() != null) ? options
-                    .getTo() : mc.getTo();
-            senderTransport = ClientUtils.inferOutTransport(cc
-                    .getAxisConfiguration(), toEPR);
-        }
-        mc.setTransportOut(senderTransport);
-
-        // create the operation context for myself
-        OperationContext oc = new OperationContext(axisOp, sc);
-        oc.addMessageContext(mc);
-        mc.setOperationContext(oc);
-
-        // ship it out
-        AxisEngine engine = new AxisEngine(cc);
-        engine.send(mc);
-
-        // all done
-        completed = true;
-    }
-
-    /**
-     * Reset the MEP client to a clean status after the MEP has completed. This
-     * is how you can reuse a MEP client. NOTE: this does not reset the options;
-     * only the internal state so the client can be used again.
-     *
-     * @throws AxisFault
-     *             if reset is called before the MEP client has completed an
-     *             interaction.
-     */
-    public void reset() throws AxisFault {
-        if (!completed) {
-            throw new AxisFault("MEP is not yet complete: cannot reset");
-        }
-        mc = null;
-        completed = false;
-    }
-}
+package org.apache.axis2.description;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.OperationClient;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.wsdl.WSDLConstants;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+
+public class OutOnlyAxisOperation extends AxisOperation {
+    private AxisMessage inFaultMessage;
+
+    // just to keep the inflow , there wont be any usage
+    private ArrayList inPhases;
+
+    private AxisMessage outFaultMessage;
+
+    private AxisMessage outMessage;
+
+    public OutOnlyAxisOperation() {
+        super();
+        createMessage();
+    }
+
+    public OutOnlyAxisOperation(QName name) {
+        super(name);
+        createMessage();
+    }
+
+    public void addMessage(AxisMessage message, String label) {
+        if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+            outMessage = message;
+        } else {
+            throw new UnsupportedOperationException("Not yet implemented");
+        }
+    }
+
+    public void addMessageContext(MessageContext msgContext,
+            OperationContext opContext) throws AxisFault {
+        if (!opContext.isComplete()) {
+            opContext.getMessageContexts().put(MESSAGE_LABEL_OUT_VALUE,
+                    msgContext);
+            opContext.setComplete(true);
+        } else {
+            throw new AxisFault(
+                    "Invalid message addition , operation context completed");
+        }
+    }
+
+    private void createMessage() {
+        outMessage = new AxisMessage();
+        outMessage.setDirection(WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
+        inFaultMessage = new AxisMessage();
+        outFaultMessage = new AxisMessage();
+        inPhases = new ArrayList();
+    }
+
+    public AxisMessage getMessage(String label) {
+        if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+            return outMessage;
+        } else {
+            throw new UnsupportedOperationException("Not yet implemented");
+        }
+    }
+
+    public ArrayList getPhasesInFaultFlow() {
+        return inFaultMessage.getMessageFlow();
+    }
+
+    public ArrayList getPhasesOutFaultFlow() {
+        return outFaultMessage.getMessageFlow();
+    }
+
+    public ArrayList getPhasesOutFlow() {
+        return outMessage.getMessageFlow();
+    }
+
+    public ArrayList getRemainingPhasesInFlow() {
+        return inPhases;
+    }
+
+    public void setPhasesInFaultFlow(ArrayList list) {
+        inFaultMessage.setMessageFlow(list);
+    }
+
+    public void setPhasesOutFaultFlow(ArrayList list) {
+        outFaultMessage.setMessageFlow(list);
+    }
+
+    public void setPhasesOutFlow(ArrayList list) {
+        outMessage.setMessageFlow(list);
+    }
+
+    public void setRemainingPhasesInFlow(ArrayList list) {
+        inPhases = list;
+    }
+
+    /**
+     * Returns a MEP client for an Out-only operation. This client can be used to
+     * interact with a server which is offering an In-only operation. To use the
+     * client, you must call addMessageContext() with a message context and then
+     * call execute() to execute the client. Note that the execute method's
+     * block parameter is ignored by this client and also the setMessageReceiver
+     * method cannot be used.
+     *
+     * @param sc
+     *            The service context for this client to live within. Cannot be
+     *            null.
+     * @param options
+     *            Options to use as defaults for this client. If any options are
+     *            set specifically on the client then those override options
+     *            here.
+     */
+    public OperationClient createClient(ServiceContext sc, Options options) {
+        return new OutOnlyAxisOperationClient(this, sc, options);
+    }
+}
+
+/**
+ * MEP client for moi.
+ */
+class OutOnlyAxisOperationClient implements OperationClient {
+    OutOnlyAxisOperation axisOp;
+
+    ServiceContext sc;
+
+    Options options;
+
+    MessageContext mc;
+
+    /*
+     * indicates whether the MEP execution has completed (and hence ready for
+     * resetting)
+     */
+    boolean completed;
+
+    OutOnlyAxisOperationClient(OutOnlyAxisOperation axisOp, ServiceContext sc,
+            Options options) {
+        this.axisOp = axisOp;
+        this.sc = sc;
+        this.options = new Options(options);
+        this.completed = false;
+    }
+
+    /**
+     * Sets the options that should be used for this particular client. This
+     * resets the entire set of options to use the new options - so you'd lose
+     * any option cascading that may have been set up.
+     *
+     * @param options
+     *            the options
+     */
+    public void setOptions(Options options) {
+        this.options = options;
+    }
+
+    /**
+     * Returns the options used by this client. If you want to set a single
+     * option, then the right way is to do getOptions() and set specific
+     * options.
+     *
+     * @return Returns the options, which will never be null.
+     */
+    public Options getOptions() {
+        return options;
+    }
+
+    /**
+     * Adds a message context to the client for processing. This method must not
+     * process the message - it only records it in the MEP client. Processing
+     * only occurs when execute() is called.
+     *
+     * @param mc
+     *            the message context
+     * @throws AxisFault
+     *             if this is called inappropriately.
+     */
+    public void addMessageContext(MessageContext mc) throws AxisFault {
+        if (this.mc != null) {
+            throw new AxisFault(
+                    "Can't add message context again until client has been executed");
+        }
+        this.mc = mc;
+        this.completed = false;
+    }
+
+    /**
+     * Returns a message from the client - will return null if the requested
+     * message is not available.
+     *
+     * @param messageLabel
+     *            the message label of the desired message context
+     * @return Returns the desired message context or null if its not available.
+     * @throws AxisFault
+     *             if the message label is invalid
+     */
+    public MessageContext getMessageContext(String messageLabel)
+            throws AxisFault {
+        if (messageLabel.equals(WSDLConstants.MESSAGE_LABEL_OUT_VALUE)) {
+            return mc;
+        }
+        throw new AxisFault("Unknown message label: '" + messageLabel + "'");
+    }
+
+    /**
+     * Sets the message receiver to be executed when a message comes into the MEP
+     * and the MEP is executed. This is the way the MEP client provides
+     * notification that a message has been received by it. Exactly when its
+     * executed and under what conditions is a function of the specific MEP
+     * client.
+     */
+    public void setCallback(Callback callback) {
+        throw new UnsupportedOperationException(
+                "This feature is not supported by this MEP");
+    }
+
+    /**
+     * Executes the MEP. What this does depends on the specific MEP client. The
+     * basic idea is to have the MEP client execute and do something with the
+     * messages that have been added to it so far. For example, if its an Out-In
+     * MEP, then if the Out message has been set, then executing the client asks
+     * it to send the message and get the In message, possibly using a different
+     * thread.
+     *
+     * @param block
+     *            Indicates whether execution should block or return ASAP. What
+     *            block means is of course a function of the specific MEP
+     *            client. IGNORED BY THIS MEP CLIENT.
+     * @throws AxisFault
+     *             if something goes wrong during the execution of the MEP.
+     */
+    public void execute(boolean block) throws AxisFault {
+        if (completed) {
+            throw new AxisFault(
+                    "MEP is already completed- need to reset() before re-executing.");
+        }
+        ConfigurationContext cc = sc.getConfigurationContext();
+
+        // set options on the message context
+        mc.setOptions(options);
+
+        // if the transport to use for sending is not specified, try to find it
+        // from the URL
+        TransportOutDescription senderTransport = options.getTranportOut();
+        if (senderTransport == null) {
+            EndpointReference toEPR = (options.getTo() != null) ? options
+                    .getTo() : mc.getTo();
+            senderTransport = ClientUtils.inferOutTransport(cc
+                    .getAxisConfiguration(), toEPR);
+        }
+        mc.setTransportOut(senderTransport);
+
+        // create the operation context for myself
+        OperationContext oc = new OperationContext(axisOp, sc);
+        oc.addMessageContext(mc);
+        mc.setOperationContext(oc);
+
+        // ship it out
+        AxisEngine engine = new AxisEngine(cc);
+        engine.send(mc);
+
+        // all done
+        completed = true;
+    }
+
+    /**
+     * Resets the MEP client to a clean status after the MEP has completed. This
+     * is how you can reuse a MEP client. NOTE: this does not reset the options;
+     * only the internal state so the client can be used again.
+     *
+     * @throws AxisFault
+     *             if reset is called before the MEP client has completed an
+     *             interaction.
+     */
+    public void reset() throws AxisFault {
+        if (!completed) {
+            throw new AxisFault("MEP is not yet complete: cannot reset");
+        }
+        mc = null;
+        completed = false;
+    }
+}



Mime
View raw message