geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r513185 - in /geronimo/server/trunk/modules: geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/ geronimo-axis2/src/test/java/org/apache/hello_control/types/ geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/dep...
Date Thu, 01 Mar 2007 06:36:49 GMT
Author: jgenender
Date: Wed Feb 28 22:36:48 2007
New Revision: 513185

URL: http://svn.apache.org/viewvc?view=rev&rev=513185
Log:
GERONIMO-2908 - Deploy JAX-WS services without webservices.xml

Added:
    geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/ObjectFactory.java
    geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHello.java
    geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHelloResponse.java
    geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/package-info.java
    geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java.orig
Modified:
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
    geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
    geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-jaxws/pom.xml
    geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
    geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Wed Feb 28 22:36:48 2007
@@ -102,7 +102,10 @@
         this.defaultEnvironment = defaultEnvironment;
     }
 
-
+    public void findWebServices(Module module, boolean isEJB, Map servletLocations, Environment
environment, Map sharedContext) throws DeploymentException {
+        findWebServices(module.getModuleFile(), isEJB, servletLocations, environment, sharedContext);
      
+    }
+    
     public void findWebServices(JarFile moduleFile, boolean isEJB, Map servletLocations,
Environment environment, Map sharedContext) throws DeploymentException {
         final String path = isEJB ? "META-INF/webservices.xml" : "WEB-INF/webservices.xml";
         try {

Added: geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/ObjectFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/ObjectFactory.java?view=auto&rev=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/ObjectFactory.java
(added)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/ObjectFactory.java
Wed Feb 28 22:36:48 2007
@@ -0,0 +1,55 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation,
v2.0.2-b01-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>

+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2007.02.21 at 10:05:07 AM MST 
+//
+
+
+package org.apache.hello_control.types;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.apache.hello_control.types package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived
classes for package: org.apache.hello_control.types
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link SayHelloResponse }
+     * 
+     */
+    public SayHelloResponse createSayHelloResponse() {
+        return new SayHelloResponse();
+    }
+
+    /**
+     * Create an instance of {@link SayHello }
+     * 
+     */
+    public SayHello createSayHello() {
+        return new SayHello();
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHello.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHello.java?view=auto&rev=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHello.java
(added)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHello.java
Wed Feb 28 22:36:48 2007
@@ -0,0 +1,71 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation,
v2.0.2-b01-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>

+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2007.02.21 at 10:05:07 AM MST 
+//
+
+
+package org.apache.hello_control.types;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="requestType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "requestType"
+})
+@XmlRootElement(name = "sayHello")
+public class SayHello {
+
+    @XmlElement(required = true)
+    protected String requestType;
+
+    /**
+     * Gets the value of the requestType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getRequestType() {
+        return requestType;
+    }
+
+    /**
+     * Sets the value of the requestType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setRequestType(String value) {
+        this.requestType = value;
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHelloResponse.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHelloResponse.java?view=auto&rev=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHelloResponse.java
(added)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/SayHelloResponse.java
Wed Feb 28 22:36:48 2007
@@ -0,0 +1,71 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation,
v2.0.2-b01-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>

+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2007.02.21 at 10:05:07 AM MST 
+//
+
+
+package org.apache.hello_control.types;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="responseType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "responseType"
+})
+@XmlRootElement(name = "sayHelloResponse")
+public class SayHelloResponse {
+
+    @XmlElement(required = true)
+    protected String responseType;
+
+    /**
+     * Gets the value of the responseType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getResponseType() {
+        return responseType;
+    }
+
+    /**
+     * Sets the value of the responseType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setResponseType(String value) {
+        this.responseType = value;
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/package-info.java?view=auto&rev=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/package-info.java
(added)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/hello_control/types/package-info.java
Wed Feb 28 22:36:48 2007
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation,
v2.0.2-b01-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>

+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2007.02.21 at 10:05:07 AM MST 
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://apache.org/hello_control/types",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.hello_control.types;

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
Wed Feb 28 22:36:48 2007
@@ -32,7 +32,7 @@
  */
 public class UnavailableWebServiceBuilder implements WebServiceBuilder {
 
-    public void findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations,
Environment environment, Map sharedContext) throws DeploymentException {
+    public void findWebServices(Module module, boolean isEJB, Map correctedPortLocations,
Environment environment, Map sharedContext) throws DeploymentException {
     }
 
     public boolean configurePOJO(GBeanData targetGBean, String servletName, Module module,
String seiClassName, DeploymentContext context) throws DeploymentException {

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
Wed Feb 28 22:36:48 2007
@@ -41,7 +41,7 @@
     * to all except the WebServiceBuilder itself.
     * @throws DeploymentException if error encountered while introspecting the module.
     */
-   void findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations, Environment
environment, Map sharedContext) throws DeploymentException;
+   void findWebServices(Module module, boolean isEJB, Map correctedPortLocations, Environment
environment, Map sharedContext) throws DeploymentException;
 
     //obviously these need the deployment descriptors, but I'm not sure in what form yet.
     /**

Modified: geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
Wed Feb 28 22:36:48 2007
@@ -132,6 +132,7 @@
         }
         WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
         wsdlReader.setFeature("javax.wsdl.importDocuments", false);
+        wsdlReader.setFeature("javax.wsdl.verbose", false);
         try {
             if (wsdlURL != null) {
                 definition = wsdlReader.readWSDL(wsdlURL.toString());

Modified: geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
Wed Feb 28 22:36:48 2007
@@ -88,7 +88,7 @@
         //overridden web service locations
         Map correctedPortLocations = new HashMap();
                
-        jaxwsBuilder.findWebServices(moduleFile, true, correctedPortLocations, environment,
ejbModule.getSharedContext());
+        jaxwsBuilder.findWebServices(module, true, correctedPortLocations, environment, ejbModule.getSharedContext());
         
         if (this.defaultEnvironment != null) {
             EnvironmentBuilder.mergeEnvironments(environment, this.defaultEnvironment);

Modified: geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
Wed Feb 28 22:36:48 2007
@@ -31,11 +31,14 @@
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.PortInfo;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.classloader.JarFileClassLoader;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.xbeans.javaee.ServletType;
+import org.apache.geronimo.xbeans.javaee.WebAppType;
 import org.apache.xbean.finder.ClassFinder;
 
 import javax.jws.WebService;
@@ -67,29 +70,77 @@
         return getClass().getName();
     }
     
-    public void findWebServices(JarFile moduleFile,
+    public void findWebServices(Module module,
                                 boolean isEJB,
                                 Map servletLocations,
                                 Environment environment,
                                 Map sharedContext) throws DeploymentException {
         Map portMap = null;
         String path = isEJB ? "META-INF/webservices.xml" : "WEB-INF/webservices.xml";
+        JarFile moduleFile = module.getModuleFile();
         try {
             URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, path);
             InputStream in = wsDDUrl.openStream();
             portMap = parseWebServiceDescriptor(in, wsDDUrl, moduleFile, isEJB, servletLocations);
         } catch (IOException e) {
-            // webservices.xml does not exist, search classes for annotations
-            portMap = discoverWebServices(moduleFile, isEJB, servletLocations);
+            // webservices.xml does not exist
+            portMap = discoverWebServices(module, isEJB, servletLocations);
         }
 
-        if (portMap != null) {
+        if (portMap != null && !portMap.isEmpty()) {
             EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
             sharedContext.put(getKey(), portMap);
         }
 
     }
 
+    private Map<String, PortInfo> discoverWebServices(Module module,
+                                                      boolean isEJB,
+                                                      Map correctedPortLocations)
+            throws DeploymentException {
+        if (isEJB) {
+            return discoverWebServices(module.getModuleFile(), isEJB, correctedPortLocations);
+        } else {
+            Map<String, PortInfo> map = new HashMap<String, PortInfo>();
+            ClassLoader classLoader = module.getEarContext().getClassLoader();
+            WebAppType webApp = (WebAppType) module.getSpecDD();
+            
+            // find web services
+            ServletType[] servletTypes = webApp.getServletArray();
+            for (ServletType servletType : servletTypes) {
+                String servletName = servletType.getServletName().getStringValue().trim();
+                if (servletType.isSetServletClass()) {
+                    String servletClassName = servletType.getServletClass().getStringValue().trim();
+                    try {
+                        Class servletClass = classLoader.loadClass(servletClassName);
+                        if (JAXWSUtils.isWebService(servletClass)) {
+                            PortInfo portInfo = new PortInfo();                         
                             
+                            map.put(servletName, portInfo);
+                        }
+                    } catch (Exception e) {                       
+                        throw new DeploymentException("Failed to load servlet class " + servletClassName,
e);
+                    }
+                }
+            }
+                        
+            // update web service locations
+            for (Map.Entry entry : map.entrySet()) {
+                String servletName = (String)entry.getKey();
+                PortInfo portInfo = (PortInfo)entry.getValue();
+                
+                String location = (String)correctedPortLocations.get(servletName);
+                if (location == null) {
+                    // TODO: not sure this case should be handled: Web service without servlet-mapping?
+                    throw new DeploymentException("Unsupported: Web Service without servlet-mapping");
+                } else {
+                    portInfo.setLocation(location);
+                }                                   
+            }
+            
+            return map;
+        }
+    }
+                       
     private Map<String, PortInfo> discoverWebServices(JarFile moduleFile,
                                                       boolean isEJB,
                                                       Map correctedPortLocations)
@@ -177,7 +228,7 @@
                                                        Map<String, PortInfo> map,
                                                        Map correctedPortLocations) {
         for (Class clazz : classes) {
-            if (isProperWebService(clazz)) {
+            if (JAXWSUtils.isWebService(clazz)) {
                 LOG.debug("Found web service class: " + clazz.getName());
                 if (map == null) {
                     map = new HashMap<String, PortInfo>();
@@ -191,18 +242,11 @@
         return map;
     }
 
-    private static boolean isProperWebService(Class clazz) {
-        int modifiers = clazz.getModifiers();
-        return (Modifier.isPublic(modifiers) &&
-                !Modifier.isFinal(modifiers) &&
-                !Modifier.isAbstract(modifiers));
-    }
-
     protected abstract Map<String, PortInfo> parseWebServiceDescriptor(InputStream
in,
-                                                            URL wsDDUrl,
-                                                            JarFile moduleFile,
-                                                            boolean isEJB,
-                                                            Map correctedPortLocations)
+                                                                       URL wsDDUrl,
+                                                                       JarFile moduleFile,
+                                                                       boolean isEJB,
+                                                                       Map correctedPortLocations)
             throws DeploymentException;
 
     public boolean configurePOJO(GBeanData targetGBean,

Modified: geronimo/server/trunk/modules/geronimo-jaxws/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws/pom.xml?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-jaxws/pom.xml Wed Feb 28 22:36:48 2007
@@ -75,8 +75,8 @@
         <dependency>
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-jaxws-api</artifactId>
-			<version>SNAPSHOT</version>
-		</dependency>
+            <version>SNAPSHOT</version>
+        </dependency>
 
         <dependency>
             <groupId>javax.xml.bind</groupId>

Modified: geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
Wed Feb 28 22:36:48 2007
@@ -16,11 +16,13 @@
  */
 package org.apache.geronimo.jaxws;
 
+import java.lang.reflect.Modifier;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.jws.WebService;
 import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceProvider;
 
 public class JAXWSUtils {
     
@@ -64,5 +66,18 @@
         } else {
             return token;            
         }
+    }
+    
+    public static boolean isWebService(Class clazz) {
+        return ((clazz.isAnnotationPresent(WebService.class) || 
+                 clazz.isAnnotationPresent(WebServiceProvider.class)) &&
+                 isProperWebService(clazz));
+    }
+    
+    private static boolean isProperWebService(Class clazz) {
+        int modifiers = clazz.getModifiers();
+        return (Modifier.isPublic(modifiers) &&
+                !Modifier.isFinal(modifiers) &&
+                !Modifier.isAbstract(modifiers));
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
Wed Feb 28 22:36:48 2007
@@ -34,7 +34,7 @@
  * @version $Rev$ $Date$
  */
 public class MockWebServiceBuilder implements WebServiceBuilder {
-    public void findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations,
Environment environment, Map sharedContext) throws DeploymentException {
+    public void findWebServices(Module module, boolean isEJB, Map correctedPortLocations,
Environment environment, Map sharedContext) throws DeploymentException {
     }
 
     public boolean configurePOJO(GBeanData targetGBean, String servletName, Module module,
String seiClassName, DeploymentContext context) throws DeploymentException {

Added: geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java.orig
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java.orig?view=auto&rev=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java.orig
(added)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java.orig
Wed Feb 28 22:36:48 2007
@@ -0,0 +1,55 @@
+/**
+ *  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.tomcat.deployment;
+
+import java.util.Map;
+import java.util.jar.JarFile;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.webservices.SerializableWebServiceContainerFactoryGBean;
+
+/**
+ * @version $Rev: 479496 $ $Date: 2006-11-26 18:57:00 -0700 (Sun, 26 Nov 2006) $
+ */
+public class MockWebServiceBuilder implements WebServiceBuilder {
+    public void findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations,
Environment environment, Map sharedContext) throws DeploymentException {
+    }
+
+    public boolean configurePOJO(GBeanData targetGBean, String servletName, Module module,
String seiClassName, DeploymentContext context) throws DeploymentException {
+        AbstractName webServiceContainerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(),
"webServiceContainer", NameFactory.GERONIMO_SERVICE);
+        GBeanData webServiceContainerFactoryGBean = new GBeanData(webServiceContainerFactoryName,
SerializableWebServiceContainerFactoryGBean.GBEAN_INFO);
+        try {
+            context.addGBean(webServiceContainerFactoryGBean);
+        } catch (GBeanAlreadyExistsException e) {
+            throw new DeploymentException("Could not add webServiceContainerFactoryGBean",
e);
+        }
+        targetGBean.setReferencePattern("WebServiceContainerFactory", webServiceContainerFactoryName);
+        return true;
+    }
+
+    public boolean configureEJB(GBeanData targetGBean, String ejbName, JarFile moduleFile,
Map sharedContext, ClassLoader classLoader) throws DeploymentException {
+        return true;
+    }
+}

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?view=diff&rev=513185&r1=513184&r2=513185
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Wed Feb 28 22:36:48 2007
@@ -685,7 +685,7 @@
         Map sharedContext = module.getSharedContext();
         for (Object aWebServiceBuilder : webServiceBuilder) {
             WebServiceBuilder serviceBuilder = (WebServiceBuilder) aWebServiceBuilder;
-            serviceBuilder.findWebServices(module.getModuleFile(), false, servletNameToPathMap,
module.getEnvironment(), sharedContext);
+            serviceBuilder.findWebServices(module, false, servletNameToPathMap, module.getEnvironment(),
sharedContext);
         }
         securityBuilders.build(gerWebApp, earContext, module.getEarContext());
         serviceBuilders.build(gerWebApp, earContext, module.getEarContext());



Mime
View raw message