geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r427654 - in /geronimo/branches/1.1: configs/axis-deployer/src/plan/ modules/axis-builder/src/java/org/apache/geronimo/axis/builder/ modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ modules/jetty-builder/src/java/org/apach...
Date Tue, 01 Aug 2006 17:27:09 GMT
Author: djencks
Date: Tue Aug  1 10:27:08 2006
New Revision: 427654

URL: http://svn.apache.org/viewvc?rev=427654&view=rev
Log:
GERONIMO-2030 Allow web service builder to determine if there are web services to be deployed

Modified:
    geronimo/branches/1.1/configs/axis-deployer/src/plan/plan.xml
    geronimo/branches/1.1/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
    geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/branches/1.1/configs/axis-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/configs/axis-deployer/src/plan/plan.xml?rev=427654&r1=427653&r2=427654&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/axis-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/axis-deployer/src/plan/plan.xml Tue Aug  1 10:27:08 2006
@@ -16,9 +16,7 @@
     limitations under the License.
 -->
 
-<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
-
-        >
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
     <gbean name="WebServiceBuilder" class="org.apache.geronimo.axis.builder.AxisBuilder"/>
 

Modified: geronimo/branches/1.1/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?rev=427654&r1=427653&r2=427654&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/branches/1.1/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Tue Aug  1 10:27:08 2006
@@ -73,21 +73,30 @@
 import org.apache.geronimo.xbeans.j2ee.JavaXmlTypeMappingType;
 import org.apache.geronimo.xbeans.j2ee.ServiceEndpointInterfaceMappingType;
 import org.apache.geronimo.xbeans.j2ee.ServiceEndpointMethodMappingType;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
 
 /**
  * @version $Rev$ $Date$
  */
 public class AxisBuilder implements ServiceReferenceBuilder, WebServiceBuilder {
-//    private static final Class[] SERVICE_CONSTRUCTOR_TYPES = new Class[]{Map.class, Map.class};
 
     private static final SOAPConstants SOAP_VERSION = SOAPConstants.SOAP11_CONSTANTS;
 
-    //WebServiceBuilder
-
-    public Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB,
Map servletLocations) throws DeploymentException {
-        return WSDescriptorParser.parseWebServiceDescriptor(wsDDUrl, moduleFile, isEJB, servletLocations);
+    public Map findWebServices(JarFile moduleFile, boolean isEJB, Map servletLocations) throws
DeploymentException {
+        final String path = isEJB ? "META-INF/webservices.xml" : "WEB-INF/webservices.xml";
+        try {
+            URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, path);
+            Map result = WSDescriptorParser.parseWebServiceDescriptor(wsDDUrl, moduleFile,
isEJB, servletLocations);
+            if (result != null) {
+                return result;
+            }
+        } catch (MalformedURLException e) {
+            // The webservices.xml file doesn't exist.
+        }
+        return Collections.EMPTY_MAP;
     }
 
+
     public void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject,
String seiClassName, ClassLoader classLoader) throws DeploymentException {
         PortInfo portInfo = (PortInfo) portInfoObject;
         ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
@@ -132,7 +141,7 @@
         ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
         targetGBean.setAttribute("serviceInfo", serviceInfo);
         JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
-       URI location = portInfo.getContextURI();
+        URI location = portInfo.getContextURI();
         targetGBean.setAttribute("location", location);
         URI wsdlURI;
         try {
@@ -285,7 +294,6 @@
         PortType portType = binding.getPortType();
 
         ServiceEndpointInterfaceMappingType[] endpointMappings = mapping.getServiceEndpointInterfaceMappingArray();
-
 
         //port type corresponds to SEI
         List operations = portType.getOperations();

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java?rev=427654&r1=427653&r2=427654&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
(original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
Tue Aug  1 10:27:08 2006
@@ -17,6 +17,7 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.util.jar.JarFile;
+import java.util.Collections;
 import java.util.Map;
 import java.util.HashMap;
 import java.net.URL;
@@ -31,9 +32,9 @@
  * @version $Rev$ $Date$
  */
 public class UnavailableWebServiceBuilder implements WebServiceBuilder {
-
-    public Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB,
Map correctedPortLocations) throws DeploymentException {
-        return new HashMap();
+    public Map findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations)

+        throws DeploymentException {
+        return Collections.EMPTY_MAP;
     }
 
     public void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfo,
String seiClassName, ClassLoader classLoader) throws DeploymentException {

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java?rev=427654&r1=427653&r2=427654&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
(original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
Tue Aug  1 10:27:08 2006
@@ -27,7 +27,20 @@
  */
 public interface WebServiceBuilder {
 
-    Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB, Map correctedPortLocations)
throws DeploymentException;
+    /**
+     * Introspects on the module file to locate web service for deployment.
+     *
+     * @param moduleFile J2EE module
+     * @param isEJB is this an EJB archive?
+     * @param correctedPortLocations mapping between port locations and paths.
+     * @return Mapping of servlet names to port information, or an
+     * empty map if no web services found.  Port information is opaque
+     * to all except the WebServiceBuilder itself.
+     * @throws DeploymentException if error encountered while introspecting the module.
+     */
+    Map findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations)
+        throws DeploymentException;
+
 
     //obviously these need the deployment descriptors, but I'm not sure in what form yet.
     /**

Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=427654&r1=427653&r2=427654&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Tue Aug  1 10:27:08 2006
@@ -231,15 +231,8 @@
         idBuilder.resolve(environment, warName, "war");
 
         Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);
+        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap);
 
-        //look for a webservices dd
-        Map portMap = Collections.EMPTY_MAP;
-        try {
-            URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
-            portMap = getWebServiceBuilder().parseWebServiceDescriptor(wsDDUrl, moduleFile,
false, servletNameToPathMap);
-        } catch (MalformedURLException e) {
-            //no descriptor
-        }
         AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL,
NameFactory.J2EE_APPLICATION);

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=427654&r1=427653&r2=427654&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Tue Aug  1 10:27:08 2006
@@ -177,15 +177,8 @@
         idBuilder.resolve(environment, warName, "war");
 
         Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);
+        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap);
 
-        //look for a webservices dd
-        Map portMap = Collections.EMPTY_MAP;
-        try {
-            URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
-            portMap = getWebServiceBuilder().parseWebServiceDescriptor(wsDDUrl, moduleFile,
false, servletNameToPathMap);
-        } catch (MalformedURLException e) {
-            //no descriptor
-        }
         AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL,
NameFactory.J2EE_APPLICATION);



Mime
View raw message