axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r365334 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/client/ core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/deployment/util/ core/src/org/apache/axis2/engine/ samples/src/userguide/clients/ wsdl/src...
Date Mon, 02 Jan 2006 11:43:17 GMT
Author: deepal
Date: Mon Jan  2 03:42:51 2006
New Revision: 365334

URL: http://svn.apache.org/viewcvs?rev=365334&view=rev
Log:
- coping default chain to default operations in service client operations
- started module versioning 
- fix ping client to work with Service Client 

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
    webservices/axis2/trunk/java/modules/samples/src/userguide/clients/PingClient.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/writer/WOMtoWSDL11Writer.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
Mon Jan  2 03:42:51 2006
@@ -4,6 +4,7 @@
 import org.apache.axis2.client.async.AsyncResult;
 import org.apache.axis2.client.async.Callback;
 import org.apache.axis2.context.*;
+import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
@@ -120,7 +121,7 @@
     /**
      * If the AxisService is null this will create an AnonymousService
      */
-    private AxisService createAnonymousService() {
+    private AxisService createAnonymousService() throws AxisFault {
         // since I have not been created with real service metadata, let's
         // create an anonymous service and add myself to a newly created default
         // (and lonely) world where I'm the only service around
@@ -128,10 +129,23 @@
         // add anonymous operations as well for use with the shortcut client
         // API. NOTE: We only add the ones we know we'll use later; if you use
         // this constructor then you can't expect any magic!
-        axisService.addOperation(new RobustOutOnlyAxisOperation(
-                ANON_ROBUST_OUT_ONLY_OP));
-        axisService.addOperation(new OutOnlyAxisOperation(ANON_OUT_ONLY_OP));
-        axisService.addOperation(new OutInAxisOperation(ANON_OUT_IN_OP));
+        PhasesInfo phasesInfo = configContext.getAxisConfiguration().getPhasesInfo();
+
+        RobustOutOnlyAxisOperation robustoutoonlyOperation = new RobustOutOnlyAxisOperation(
+                ANON_ROBUST_OUT_ONLY_OP);
+        // setting operation default chains
+        phasesInfo.setOperationPhases(robustoutoonlyOperation);
+        axisService.addOperation(robustoutoonlyOperation);
+
+        OutOnlyAxisOperation outOnlyOperation = new OutOnlyAxisOperation(ANON_OUT_ONLY_OP);
+        // setting operation default chains
+        phasesInfo.setOperationPhases(outOnlyOperation);
+        axisService.addOperation(outOnlyOperation);
+
+        OutInAxisOperation outInOperation = new OutInAxisOperation(ANON_OUT_IN_OP);
+        // setting operation default chains
+        phasesInfo.setOperationPhases(outInOperation);
+        axisService.addOperation(outInOperation);
         return axisService;
     }
 
@@ -435,7 +449,7 @@
         }
     }
 
-    private AxisService getAxisService() {
+    private AxisService getAxisService() throws AxisFault {
         if (axisService == null) {
             axisService = createAnonymousService();
             AxisConfiguration axisConfig = this.configContext
@@ -451,7 +465,7 @@
         return axisService;
     }
 
-    public void setAxisService(AxisService axisService) {
+    public void setAxisService(AxisService axisService) throws AxisFault {
         // adding service into system
         AxisConfiguration axisConfig = this.configContext
                 .getAxisConfiguration();

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
Mon Jan  2 03:42:51 2006
@@ -41,6 +41,7 @@
 import java.util.Iterator;
 
 public class AxisConfigBuilder extends DescriptionBuilder {
+
     private AxisConfiguration axisConfiguration;
     private DeploymentEngine engine;
 
@@ -107,25 +108,25 @@
             if (hostElement != null) {
                 processHostCongiguration(hostElement, axisConfiguration);
             }
-            
+
             // setting the PolicyInclude
             PolicyInclude policyInclude = new PolicyInclude();
             axisConfiguration.setPolicyInclude(policyInclude);
-            
+
             // processing <wsp:Policy> .. </..> elements
             Iterator policyElements = config_element.getChildrenWithName(new QName(POLICY_NS_URI,
TAG_POLICY));
-            
+
             if (policyElements != null) {
                 processPolicyElements(policyElements, axisConfiguration.getPolicyInclude());
             }
-            
+
             // processing <wsp:PolicyReference> .. </..> elements
             Iterator policyRefElements = config_element.getChildrenWithName(new QName(POLICY_NS_URI,
TAG_POLICY_REF));
-            
+
             if (policyRefElements != null) {
                 processPolicyRefElements(policyElements, axisConfiguration.getPolicyInclude());
             }
-            
+
         } catch (XMLStreamException e) {
             throw new DeploymentException(e);
         }
@@ -297,6 +298,24 @@
         }
     }
 
+    private void processDefaultModuleVersions(OMElement defaultVersions) throws DeploymentException
{
+        Iterator moduleVersions = defaultVersions.getChildrenWithName(new QName(TAG_MODULE));
+        while (moduleVersions.hasNext()) {
+            OMElement omElement = (OMElement) moduleVersions.next();
+            String name = omElement.getAttributeValue(new QName(ATTRIBUTE_NAME));
+            if (name == null) {
+                throw new DeploymentException("Module name can not be null in side" +
+                        " default module vresion element ");
+            }
+            String defaultVeriosn = omElement.getAttributeValue(new QName(ATTRIBUTE_DEFAULT_VERSION));
+            if (defaultVeriosn == null) {
+                throw new DeploymentException("Module vresion can not be null in side" +
+                        " default module vresion element ");
+            }
+        }
+
+    }
+
     private void processTransportReceivers(Iterator trs_senders) throws DeploymentException
{
         while (trs_senders.hasNext()) {
             TransportInDescription transportIN;
@@ -472,9 +491,7 @@
         if (className == null) {
             return new Phase();
         }
-
         Class phaseClass = axisConfiguration.getSystemClassLoader().loadClass(className);
-
         return (Phase) phaseClass.newInstance();
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
Mon Jan  2 03:42:51 2006
@@ -70,6 +70,7 @@
 
     // for parameters
     String ATTRIBUTE_NAME = "name";
+    String ATTRIBUTE_DEFAULT_VERSION = "version";
     String ATTRIBUTE_SCOPE = "scope";
     String ATTRIBUTE_LOCKED = "locked";
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
Mon Jan  2 03:42:51 2006
@@ -19,11 +19,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.deployment.util.PhasesInfo;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisOperationFactory;
-import org.apache.axis2.description.InOnlyAxisOperation;
-import org.apache.axis2.description.ModuleDescription;
-import org.apache.axis2.description.PolicyInclude;
+import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.i18n.Messages;
@@ -91,29 +87,29 @@
                     loadModuleClass(module, moduleClass);
                 }
             }
-            
+
             // setting the PolicyInclude
             PolicyInclude policyInclude;
-            
+
             if (axisConfig != null) {
                 PolicyInclude parent = axisConfig.getPolicyInclude();
                 policyInclude = new PolicyInclude(parent);
-                
+
             } else {
                 policyInclude = new PolicyInclude();
             }
             module.setPolicyInclude(policyInclude);
-            
+
             // processing <wsp:Policy> .. </..> elements
             Iterator policyElements = moduleElement.getChildrenWithName(new QName(POLICY_NS_URI,
TAG_POLICY));
-            
+
             if (policyElements != null) {
                 processPolicyElements(policyElements, module.getPolicyInclude());
             }
-            
+
             // processing <wsp:PolicyReference> .. </..> elements
             Iterator policyRefElements = moduleElement.getChildrenWithName(new QName(POLICY_NS_URI,
TAG_POLICY_REF));
-            
+
             if (policyRefElements != null) {
                 processPolicyRefElements(policyRefElements, module.getPolicyInclude());
             }
@@ -238,7 +234,11 @@
             // setting Operation phase
             PhasesInfo info = axisConfig.getPhasesInfo();
 
-            info.setOperationPhases(op_descrip);
+            try {
+                info.setOperationPhases(op_descrip);
+            } catch (AxisFault axisFault) {
+                throw new DeploymentException(axisFault);
+            }
 
             // adding the operation
             operations.add(op_descrip);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
Mon Jan  2 03:42:51 2006
@@ -17,6 +17,7 @@
 
 package org.apache.axis2.deployment.util;
 
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.deployment.DeploymentException;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.HandlerDescription;
@@ -215,12 +216,16 @@
         this.OUT_FaultPhases = OUT_FaultPhases;
     }
 
-    public void setOperationPhases(AxisOperation axisOperation) throws DeploymentException
{
+    public void setOperationPhases(AxisOperation axisOperation) throws AxisFault {
         if (axisOperation != null) {
-            axisOperation.setRemainingPhasesInFlow(getOperationInPhases());
-            axisOperation.setPhasesOutFlow(getOperationOutPhases());
-            axisOperation.setPhasesInFaultFlow(getOperationInFaultPhases());
-            axisOperation.setPhasesOutFaultFlow(getOperationOutFaultPhases());
+            try {
+                axisOperation.setRemainingPhasesInFlow(getOperationInPhases());
+                axisOperation.setPhasesOutFlow(getOperationOutPhases());
+                axisOperation.setPhasesInFaultFlow(getOperationInFaultPhases());
+                axisOperation.setPhasesOutFaultFlow(getOperationOutFaultPhases());
+            } catch (DeploymentException e) {
+                throw new AxisFault(e);
+            }
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
Mon Jan  2 03:42:51 2006
@@ -19,8 +19,8 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.deployment.DeploymentConstants;
+import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.description.*;
@@ -44,7 +44,14 @@
     /**
      * Field modules
      */
-    private final HashMap modules = new HashMap();
+    private final HashMap defaultModules = new HashMap();
+
+    //to store all the availble modules (including version)
+    private final HashMap allModules = new HashMap();
+
+    //to store mapping between default version to module name
+//    private final HashMap
+
     private final HashMap serviceGroups = new HashMap();
     private final HashMap transportsIn = new HashMap();
     private final HashMap transportsOut = new HashMap();
@@ -69,7 +76,7 @@
     private ArrayList inFaultPhases;
     private ArrayList inPhasesUptoAndIncludingPostDispatch;
     private HashMap messageReceivers;
-    
+
     // to store policies which are valid for entire system
     private PolicyInclude policyInclude;
 
@@ -97,9 +104,9 @@
         faultyModules = new Hashtable();
         observersList = new ArrayList();
         inPhasesUptoAndIncludingPostDispatch = new ArrayList();
-        
+
         policyInclude = new PolicyInclude();
-        
+
         systemClassLoader = Thread.currentThread().getContextClassLoader();
         serviceClassLoader = Thread.currentThread().getContextClassLoader();
         moduleClassLoader = Thread.currentThread().getContextClassLoader();
@@ -134,7 +141,7 @@
      */
     public void addModule(ModuleDescription module) throws AxisFault {
         module.setParent(this);
-        modules.put(module.getName(), module);
+        defaultModules.put(module.getName(), module);
     }
 
     /**
@@ -388,7 +395,7 @@
      * @return Returns ModuleDescription.
      */
     public ModuleDescription getModule(QName name) {
-        return (ModuleDescription) modules.get(name);
+        return (ModuleDescription) defaultModules.get(name);
     }
 
     // the class loder that become the parent of all the modules
@@ -404,7 +411,7 @@
      * @return Returns HashMap.
      */
     public HashMap getModules() {
-        return modules;
+        return defaultModules;
     }
 
     /**
@@ -561,21 +568,21 @@
     public void setSystemClassLoader(ClassLoader classLoader) {
         this.systemClassLoader = classLoader;
     }
-    
+
     public void setPolicyInclude(PolicyInclude policyInclude) {
         this.policyInclude = policyInclude;
     }
-    
+
     public PolicyInclude getPolicyInclude() {
         return policyInclude;
     }
-    
+
     public static String getAxis2HomeDirectory() {
         // if user has set the axis2 home variable try to get that from System properties
         String axis2home = System.getProperty(Constants.HOME_AXIS2);
-        if(axis2home == null) {
+        if (axis2home == null) {
             axis2home = System.getProperty(Constants.HOME_USER);
-            if(axis2home != null){
+            if (axis2home != null) {
                 axis2home = axis2home + '/' + DeploymentConstants.DIRECTORY_AXIS2_HOME;
             }
         }

Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/PingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/PingClient.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/PingClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/PingClient.java Mon
Jan  2 03:42:51 2006
@@ -17,8 +17,8 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.MessageSender;
 import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.om.OMElement;
 
 /**
@@ -31,14 +31,13 @@
     public static void main(String[] args) {
         try {
             OMElement payload = ClientUtil.getPingOMElement();
-
-            MessageSender msgSender = new MessageSender();
+            ServiceClient serviceClient = new ServiceClient();
 
             Options options = new Options();
-            msgSender.setClientOptions(options);
+            serviceClient.setOptions(options);
             options.setTo(targetEPR);
 
-            msgSender.send("ping", payload);
+            serviceClient.fireAndForget(payload);
 
         } catch (AxisFault axisFault) {
             axisFault.printStackTrace();

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/writer/WOMtoWSDL11Writer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/writer/WOMtoWSDL11Writer.java?rev=365334&r1=365333&r2=365334&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/writer/WOMtoWSDL11Writer.java
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/writer/WOMtoWSDL11Writer.java
Mon Jan  2 03:42:51 2006
@@ -66,9 +66,6 @@
     private String soapNsPrefix = null;
     private XMLStreamWriter writer;
 
-    private Writer rawWriter = null;
-
-
     public void setEncoding(String encoding) {
         this.encoding = encoding;
     }
@@ -116,7 +113,6 @@
     public void writeWOM(WSDLDescription wsdlDescription, OutputStream out) throws WriterException,
XMLStreamException {
         try {
             //create a writer from the stream
-            rawWriter = new OutputStreamWriter(out, encoding);
             writer = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
 
             writeStartDescripton(wsdlDescription, writer);
@@ -344,15 +340,13 @@
      * Our simple rule in the 'guessing game' for the message and it's parts.
      * Message name is the localpart of the QName suffixed by MESSAGE_NAME_SUFFIX
      * Partname is just 'part1' (wouldn't matter!)
-     * Element reference is again the localpart of the QName but prefixed with the target

+     * Element reference is again the localpart of the QName but prefixed with the target
      * namespaces prefix.
      */
 
     private void populateMessageSymbol(QName reference) {
-        if (messageMap.containsKey(reference)) {
+        if (!messageMap.containsKey(reference)) {
             //just return. The message is already there
-            return;
-        } else {
             //create a part with name part 1 and element ref to the QName value
             //these references need to be prefixed according to the correct target namespaces
             //of the schemas
@@ -586,7 +580,7 @@
 
     }
 
-    private void writeSOAPAddressExtensibilityElement(SOAPAddress address) throws IOException,
XMLStreamException {
+    private void writeSOAPAddressExtensibilityElement(SOAPAddress address) throws XMLStreamException
{
         writer.writeStartElement(soapNsPrefix, "address", WSDL1_1_SOAP_NAMESPACE_URI);
         writer.writeAttribute("location", address.getLocationURI());
         writer.writeEndElement();



Mime
View raw message