geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r561670 - in /geronimo/server/branches/2.0/modules: geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/ geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/
Date Wed, 01 Aug 2007 05:59:35 GMT
Author: gawor
Date: Tue Jul 31 22:59:34 2007
New Revision: 561670

URL: http://svn.apache.org/viewvc?view=rev&rev=561670
Log:
check for jax-ws services in j2ee webservices.xml descriptor

Added:
    geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/DescriptorVersion.java
Modified:
    geronimo/server/branches/2.0/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/PortInfo.java
    geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/SharedPortInfo.java
    geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/WSDescriptorParser.java

Modified: geronimo/server/branches/2.0/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&rev=561670&r1=561669&r2=561670
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Tue Jul 31 22:59:34 2007
@@ -82,6 +82,7 @@
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.webservices.SerializableWebServiceContainerFactoryGBean;
+import org.apache.geronimo.webservices.builder.DescriptorVersion;
 import org.apache.geronimo.webservices.builder.PortInfo;
 import org.apache.geronimo.webservices.builder.SchemaInfoBuilder;
 import org.apache.geronimo.webservices.builder.WSDescriptorParser;
@@ -142,8 +143,14 @@
         ClassLoader cl = context.getClassLoader();
         Class serviceClass = loadClass(servletClassName, cl);        
         if (isJAXWSWebService(serviceClass)) {
-            // This is a JAX-WS web service so ignore
-            return false;
+            if (DescriptorVersion.J2EE.equals(portInfo.getDescriptorVersion())) {
+                // This is a JAX-WS web service in J2EE descriptor so throw an exception
+                throw new DeploymentException("JAX-WS web service '" + portInfo.getPortComponentName()

+                                              + "' cannot be specified in J2EE webservices.xml
descriptor.");
+            } else {
+                // This is a JAX-WS web service in JAVAEE descriptor so ignore
+                return false;
+            }
         }
         
         portInfo.initialize(module.getModuleFile());
@@ -202,8 +209,14 @@
         String beanClassName = (String)targetGBean.getAttribute("ejbClass");
         Class serviceClass = loadClass(beanClassName, classLoader);
         if (isJAXWSWebService(serviceClass)) {
-            // This is a JAX-WS web service so ignore
-            return false;
+            if (DescriptorVersion.J2EE.equals(portInfo.getDescriptorVersion())) {
+                // This is a JAX-WS web service in J2EE descriptor so throw an exception
+                throw new DeploymentException("JAX-WS web service '" + portInfo.getPortComponentName()

+                                              + "' cannot be specified in J2EE webservices.xml
descriptor.");
+            } else {
+                // This is a JAX-WS web service in JAVAEE descriptor so ignore
+                return false;
+            }
         }
         
         portInfo.initialize(module.getModuleFile());

Added: geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/DescriptorVersion.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/DescriptorVersion.java?view=auto&rev=561670
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/DescriptorVersion.java
(added)
+++ geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/DescriptorVersion.java
Tue Jul 31 22:59:34 2007
@@ -0,0 +1,23 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.webservices.builder;
+
+public enum DescriptorVersion {
+    
+    UNKNOWN, J2EE, JAVAEE;
+    
+}

Modified: geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/PortInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/PortInfo.java?view=diff&rev=561670&r1=561669&r2=561670
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/PortInfo.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/PortInfo.java
Tue Jul 31 22:59:34 2007
@@ -57,6 +57,10 @@
         this.location = location;
     }
 
+    public DescriptorVersion getDescriptorVersion() {
+        return this.sharedPortInfo.getDescriptorVersion();
+    }
+    
     public String getWsdlLocation() {
         return this.sharedPortInfo.getWsdlLocation();
     }

Modified: geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/SharedPortInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/SharedPortInfo.java?view=diff&rev=561670&r1=561669&r2=561670
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/SharedPortInfo.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/SharedPortInfo.java
Tue Jul 31 22:59:34 2007
@@ -31,17 +31,27 @@
  * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
  */
 public class SharedPortInfo {
-
+    
     private String jaxrpcMappingFile;
     private String wsdlLocation;
     private JavaWsdlMappingType javaWsdlMapping;
     private SchemaInfoBuilder schemaInfoBuilder;
+    private DescriptorVersion ddVersion;
 
     public SharedPortInfo(String wsdlLocation, String jaxrpcMappingFile) {
+        this(wsdlLocation, jaxrpcMappingFile, DescriptorVersion.UNKNOWN);
+    }
+    
+    public SharedPortInfo(String wsdlLocation, String jaxrpcMappingFile, DescriptorVersion
ddVersion) {
         this.wsdlLocation = wsdlLocation;
         this.jaxrpcMappingFile = jaxrpcMappingFile;
+        this.ddVersion = ddVersion;
     }
 
+    public DescriptorVersion getDescriptorVersion() {
+        return this.ddVersion;
+    }
+    
     public String getWsdlLocation() {
         return this.wsdlLocation;
     }

Modified: geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/WSDescriptorParser.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/WSDescriptorParser.java?view=diff&rev=561670&r1=561669&r2=561670
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/WSDescriptorParser.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-webservices-builder/src/main/java/org/apache/geronimo/webservices/builder/WSDescriptorParser.java
Tue Jul 31 22:59:34 2007
@@ -300,7 +300,9 @@
             String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
             String jaxrpcMappingFile = webserviceDescription.getJaxrpcMappingFile().getStringValue().trim();
             
-            sharedPortInfo = new SharedPortInfo(wsdlLocation, jaxrpcMappingFile);
+            sharedPortInfo = new SharedPortInfo(wsdlLocation, 
+                                                jaxrpcMappingFile,
+                                                DescriptorVersion.J2EE);
             
             PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
             for (PortComponentType portComponent : portComponents) {
@@ -349,7 +351,9 @@
                 jaxrpcMappingFile = webserviceDescription.getJaxrpcMappingFile().getStringValue().trim();
             }
             
-            sharedPortInfo = new SharedPortInfo(wsdlLocation, jaxrpcMappingFile);
+            sharedPortInfo = new SharedPortInfo(wsdlLocation, 
+                                                jaxrpcMappingFile, 
+                                                DescriptorVersion.JAVAEE);
             
             org.apache.geronimo.xbeans.javaee.PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
             for (org.apache.geronimo.xbeans.javaee.PortComponentType portComponent : portComponents)
{



Mime
View raw message