You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2007/06/29 20:54:51 UTC

svn commit: r551999 [6/9] - in /webservices/axis2/branches/java/jaxws21: modules/adb-codegen/src/org/apache/axis2/schema/ modules/adb-codegen/src/org/apache/axis2/schema/template/ modules/adb-codegen/test-resources/testsuite/ modules/adb-codegen/test/o...

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/AxisFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/AxisFault.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/AxisFault.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/AxisFault.java Fri Jun 29 11:54:44 2007
@@ -32,6 +32,7 @@
 
 import java.io.Serializable;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.UndeclaredThrowableException;
 import java.rmi.RemoteException;
 import java.util.ArrayList;
 import java.util.List;
@@ -387,8 +388,12 @@
     public static AxisFault makeFault(Throwable e) {
         if (e instanceof InvocationTargetException) {
             return makeFault(((InvocationTargetException) e).getTargetException());
+        } else if (e instanceof UndeclaredThrowableException) {
+            Throwable t = ((UndeclaredThrowableException) e).getCause();
+            if (t instanceof Exception) {
+                e = (Exception) t;
+            }
         }
-
         if (e instanceof AxisFault) {
             return (AxisFault) e;
         }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java Fri Jun 29 11:54:44 2007
@@ -223,6 +223,7 @@
     public static final String COOKIE_STRING = "Cookie";
     public static final String SESSION_COOKIE = "axis_session";
     public static final String SESSION_COOKIE_JSESSIONID = "JSESSIONID";
+    public static final String CUSTOM_COOKIE_ID = "customCookieID";
 
     /**
      * Addressing Constants
@@ -330,6 +331,13 @@
          * This will be used as a key for storing transport information.
          */
         public static final String TRANSPORT_INFO_MAP = "TransportInfoMap";
+        
+        /**
+         * If this is set to a Boolean 'true' value, then RequestResponseTransport instances will
+         * not be signalled by the Dispatch phase. This is useful for modules that add wish to
+         * send extra messages in the backchannel.
+         */
+        public static final String DISABLE_RESPONSE_ACK = "DisableResponseAck";
         
     }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Options.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Options.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Options.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Options.java Fri Jun 29 11:54:44 2007
@@ -949,7 +949,7 @@
 
             if ((!isTransportsEqual || !isATwoWaytransport)) {
                 throw new AxisFault(Messages
-                        .getMessage("useSeparateListenerLimited"));
+                        .getMessage("useSeparateListenerLimited", senderTransport, listenerTransport));
             }
         } else {
             setUseSeparateListener(useSeparateListener);

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java Fri Jun 29 11:54:44 2007
@@ -129,9 +129,12 @@
     }
 
     private synchronized void addPropertyDifference(String key) {
+        ConfigurationContext cc = getRootContext();
+        if (cc == null) return;
+
         // Add the property differences only if Context replication is enabled,
         // and there are members in the cluster
-        ClusterManager clusterManager = getRootContext().getAxisConfiguration().getClusterManager();
+        ClusterManager clusterManager = cc.getAxisConfiguration().getClusterManager();
         if (clusterManager != null &&
             clusterManager.getContextManager() != null) {
             propertyDifferences.put(key, new PropertyDifference(key, false));

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java Fri Jun 29 11:54:44 2007
@@ -194,7 +194,7 @@
      * </pre>
      *
      * @param messageContext : MessageContext
-     * @throws org.apache.axis2.AxisFault : If something goes wrong
+     * @throws AxisFault : If something goes wrong
      */
     public void fillServiceContextAndServiceGroupContext(MessageContext messageContext)
             throws AxisFault {
@@ -296,7 +296,7 @@
      */
     public void unregisterOperationContext(String key) {
         synchronized (operationContextMap) {
-            OperationContext opCtx = (OperationContext)operationContextMap.get(key);
+            OperationContext opCtx = (OperationContext) operationContextMap.get(key);
             operationContextMap.remove(key);
             contextRemoved(opCtx);
         }
@@ -343,6 +343,7 @@
      * Gets a OperationContext given a Message ID.
      *
      * @return Returns OperationContext <code>OperationContext<code>
+     * @param id
      */
     public OperationContext getOperationContext(String id) {
         OperationContext opCtx;
@@ -385,8 +386,7 @@
                     valueServiceName = value.getServiceName();
                     valueServiceGroupName = value.getServiceGroupName();
 
-                    if ((valueOperationName != null) && (valueOperationName.equals(operationName)))
-                    {
+                    if ((valueOperationName != null) && (valueOperationName.equals(operationName))) {
                         if ((valueServiceName != null) && (valueServiceName.equals(serviceName))) {
                             if ((valueServiceGroupName != null) && (serviceGroupName != null)
                                 && (valueServiceGroupName.equals(serviceGroupName))) {
@@ -438,6 +438,7 @@
      * Allows users to resolve the path relative to the root diretory.
      *
      * @param path
+     * @return
      */
     public File getRealPath(String path) {
         URL repository = axisConfiguration.getRepository();
@@ -505,12 +506,12 @@
         int index = 0;
         for (Iterator iter = serviceGroupContextMap.keySet().iterator(); iter.hasNext();) {
             ids[index] = (String) iter.next();
-            index ++;
+            index++;
         }
         for (Iterator iter = applicationSessionServiceGroupContexts.keySet().iterator();
              iter.hasNext();) {
             ids[index] = (String) iter.next();
-            index ++;
+            index++;
         }
         return ids;
     }
@@ -546,7 +547,8 @@
     /**
      * Sets the thread factory.
      *
-     * @param pool
+     * @param pool The thread pool
+     * @throws AxisFault If a thread pool has already been set
      */
     public void setThreadPool(ThreadFactory pool) throws AxisFault {
         if (threadPool == null) {
@@ -556,6 +558,21 @@
         }
     }
 
+    /**
+     * Remove a ServiceGroupContext
+     *
+     * @param serviceGroupContextId The ID of the ServiceGroupContext
+     */
+    public void removeServiceGroupContext(String serviceGroupContextId) {
+        if (serviceGroupContextMap == null) {
+            return;
+        }
+        ServiceGroupContext serviceGroupContext =
+                (ServiceGroupContext) serviceGroupContextMap.get(serviceGroupContextId);
+        serviceGroupContextMap.remove(serviceGroupContextId);
+        cleanupServiceContexts(serviceGroupContext);
+    }
+
     private void cleanupServiceGroupContexts() {
         if (serviceGroupContextMap == null) {
             return;
@@ -736,4 +753,4 @@
     public ConfigurationContext getRootContext() {
         return this;
     }
-}
+}
\ No newline at end of file

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Fri Jun 29 11:54:44 2007
@@ -73,7 +73,10 @@
         axisConfigurator.engageGlobalModules();
         axisConfigurator.loadServices();
         addModuleService(configContext);
-//        initApplicationScopeServices(configContext);
+
+        // TODO: THIS NEEDS A TEST CASE!
+        initApplicationScopeServices(configContext);
+
         axisConfig.setStart(true);
         return configContext;
     }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/MessageContext.java Fri Jun 29 11:54:44 2007
@@ -324,6 +324,12 @@
     private int currentPhaseIndex;
 
     /**
+     * If we're processing this MC due to flowComplete() being called in the case
+     * of an Exception, this will hold the Exception which caused the problem.
+     */
+    private Exception failureReason;
+
+    /**
      * @serial SOAP envelope
      */
     private SOAPEnvelope envelope;
@@ -849,18 +855,6 @@
     }
 
     /**
-     * Set a property for this message context.
-     *
-     * @param name  name of the property
-     * @param value the value to set
-     */
-    public void setProperty(String name, Object value) {
-        // we override this method here to make sure the properties are set on
-        // options rather than in the inherited property bag.
-        options.setProperty(name, value);
-    }
-
-    /**
      * Retrieves a property value. The order of search is as follows: search in
      * my own options and then look in my context hierarchy. Since its possible
      * that the entire hierarchy is not present, I will start at whatever level
@@ -875,7 +869,12 @@
         }
 
         // search in my own options
-        Object obj = options.getProperty(name);
+        Object obj = super.getProperty(name);
+        if (obj != null) {
+            return obj;
+        }
+
+        obj = options.getProperty(name);
         if (obj != null) {
             return obj;
         }
@@ -2740,7 +2739,7 @@
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-        Map tmpMap = getProperties();
+        Map tmpMap = properties;
 
         HashMap tmpHashMap = null;
 
@@ -4279,5 +4278,23 @@
         } catch (Exception e) {
             return false;
         }
+    }
+
+
+    /**
+     * Obtain the Exception which caused the processing chain to halt.
+     * @return null, or an Exception.
+     */
+    public Exception getFailureReason() {
+        return failureReason;
+    }
+
+    /**
+     * Set the failure reason.  Only AxisEngine should ever do this.
+     *
+     * @param failureReason an Exception which caused processing to halt.
+     */
+    public void setFailureReason(Exception failureReason) {
+        this.failureReason = failureReason;
     }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Fri Jun 29 11:54:44 2007
@@ -434,14 +434,14 @@
             OMElement omElement = (OMElement) moduleVersions.next();
             String name = omElement.getAttributeValue(new QName(ATTRIBUTE_NAME));
             if (name == null) {
-                throw new DeploymentException(Messages.getMessage("modulenamecannotnull"));
+                throw new DeploymentException(Messages.getMessage("modulenamecannotbenull"));
             }
-            String defaultVeriosn =
+            String version =
                     omElement.getAttributeValue(new QName(ATTRIBUTE_DEFAULT_VERSION));
-            if (defaultVeriosn == null) {
-                throw new DeploymentException(Messages.getMessage("modulenamecannotnull"));
+            if (version == null) {
+                throw new DeploymentException(Messages.getMessage("moduleversioncannotbenull"));
             }
-            axisConfig.addDefaultModuleVersion(name, defaultVeriosn);
+            axisConfig.addDefaultModuleVersion(name, version);
         }
     }
 
@@ -466,7 +466,13 @@
                                 (TransportListener) receiverClass.newInstance();
                         transportIN.setReceiver(receiver);
                     } catch (NoClassDefFoundError e) {
-                        throw new DeploymentException(e);
+                        if(deploymentEngine != null){
+                            throw new DeploymentException(e);
+                        } else {
+                            // Called from createDefaultConfigurationContext in ConfigurationContextFactory
+                            // Please don't throw an exception.
+                            log.debug(Messages.getMessage("classnotfound", trsClas.getAttributeValue()));
+                        }
                     } catch (ClassNotFoundException e) {
                         throw new DeploymentException(e);
                     } catch (IllegalAccessException e) {
@@ -527,8 +533,14 @@
                     // adding to axis2 config
                     axisConfig.addTransportOut(transportout);
                 } catch (NoClassDefFoundError e) {
-                    log.debug(Messages.getMessage("errorinloadingts", clasName), e);
-                    throw new DeploymentException(e);
+                    if(deploymentEngine != null){
+                        log.debug(Messages.getMessage("errorinloadingts", clasName), e);
+                        throw new DeploymentException(e);
+                    } else {
+                        // Called from createDefaultConfigurationContext in ConfigurationContextFactory
+                        // Please don't throw an exception.
+                        log.debug(Messages.getMessage("classnotfound", trsClas.getAttributeValue()));
+                    }
                 } catch (ClassNotFoundException e) {
                     log.debug(Messages.getMessage("errorinloadingts", clasName), e);
                     throw new DeploymentException(e);

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java Fri Jun 29 11:54:44 2007
@@ -656,6 +656,9 @@
             String opname = op_name_att.getAttributeValue();
             AxisOperation op_descrip;
             op_descrip = service.getOperation(new QName(opname));
+            if(op_descrip==null){
+                op_descrip = service.getOperation(new QName(service.getTargetNamespace(),opname));
+            }
             if (op_descrip == null) {
                 if (mepurl == null) {
                     // assumed MEP is in-out

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Fri Jun 29 11:54:44 2007
@@ -315,13 +315,13 @@
                             if (WSDL2Constants.WSDL_NAMESPACE
                                     .equals(documentElementNS.getNamespaceURI())) {
                                 // we have a WSDL 2.0 document here.
-                                wsdlToAxisServiceBuilder = new WSDL20ToAxisServiceBuilder(
-                                        new ByteArrayInputStream(out.toByteArray()), null, null);
+                                wsdlToAxisServiceBuilder = new WSDL20ToAllAxisServicesBuilder(
+                                        new ByteArrayInputStream(out.toByteArray()));
                                 wsdlToAxisServiceBuilder.setBaseUri(entryName);
                             } else if (Constants.NS_URI_WSDL11.
                                     equals(documentElementNS.getNamespaceURI())) {
-                                wsdlToAxisServiceBuilder = new WSDL11ToAxisServiceBuilder(
-                                        new ByteArrayInputStream(out.toByteArray()), null, null);
+                                wsdlToAxisServiceBuilder = new WSDL11ToAllAxisServicesBuilder(
+                                        new ByteArrayInputStream(out.toByteArray()));
                             } else {
                                 throw new DeploymentException(Messages.getMessage("invalidWSDLFound"));
                             }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Fri Jun 29 11:54:44 2007
@@ -108,10 +108,7 @@
 
     public boolean isParameterTrue(String name) {
         Parameter param = getParameter(name);
-        if (param == null) {
-            return false;
-        }
-        return JavaUtils.isTrue(param.getValue());
+        return param != null && JavaUtils.isTrue(param.getValue());
     }
 
     public ArrayList getParameters() {
@@ -431,16 +428,22 @@
             String existing = ((AxisModule)iterator.next()).getName();
             if (!Utils.checkVersion(moduleName, existing)) {
                 throw new AxisFault(Messages.getMessage("mismatchedModuleVersions",
-                                                        getClass().getName(),
-                                                        moduleName,
-                                                        existing));
+                        getClass().getName(),
+                        moduleName,
+                        existing));
             }
         }
 
+        // Let the Module know it's being engaged.  If it's not happy about it, it can throw.
+        Module module = axisModule.getModule();
+        if (module != null) {
+            module.engageNotify(this);
+        }
+
         // If we have anything specific to do, let that happen
         onEngage(axisModule, source);
 
-            engagedModules.put(axisModule.getName(), axisModule);
+        engagedModules.put(axisModule.getName(), axisModule);
     }
 
     protected void onEngage(AxisModule module, AxisDescription engager) throws AxisFault {
@@ -460,10 +463,7 @@
      * TODO: Handle versions?  isEngaged("addressing") should be true even for versioned modulename...
      */
     public boolean isEngaged(String moduleName) {
-        if (engagedModules != null) {
-            return engagedModules.keySet().contains(moduleName);
-        }
-        return false;
+        return engagedModules != null && engagedModules.keySet().contains(moduleName);
     }
 
     public void disengageModule(AxisModule module) throws AxisFault {

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisMessage.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisMessage.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisMessage.java Fri Jun 29 11:54:44 2007
@@ -55,6 +55,9 @@
 
     // private PolicyInclude policyInclude;
 
+    //To chcek whether the message is wrapped or unwrapped
+    private boolean wrapped = true;
+
     public String getMessagePartName() {
 		return messagePartName;
 	}
@@ -216,5 +219,14 @@
 
     public void setPartName(String partName) {
         this.partName = partName;
+    }
+
+
+    public boolean isWrapped() {
+        return wrapped;
+    }
+
+    public void setWrapped(boolean wrapped) {
+        this.wrapped = wrapped;
     }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisOperation.java?view=diff&rev=551999&r1=551998&r2=551999
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisOperation.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/AxisOperation.java Fri Jun 29 11:54:44 2007
@@ -164,14 +164,9 @@
                 service.addModuleOperations(axisModule);
             }
         }
-
         AxisConfiguration axisConfig = getAxisConfiguration();
         PhaseResolver phaseResolver = new PhaseResolver(axisConfig);
         phaseResolver.engageModuleToOperation(this, axisModule);
-        Module module = axisModule.getModule();
-        if (module != null) {
-            module.engageNotify(this);
-        }
     }
 
     protected void onDisengage(AxisModule module) {
@@ -514,6 +509,7 @@
 
     public void setFaultMessages(AxisMessage faultMessage) {
         faultMessages.add(faultMessage);
+        addFaultAction(faultMessage.getName(),"urn:" + faultMessage.getName());
     }
 
     public void setSoapAction(String soapAction) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org