geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1076122 - in /geronimo/server/trunk/plugins: axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/ jaxws/geronimo-jaxws-builder/src/main/java/org/apache/...
Date Wed, 02 Mar 2011 06:57:40 GMT
Author: xuhaihong
Date: Wed Mar  2 06:57:40 2011
New Revision: 1076122

URL: http://svn.apache.org/viewvc?rev=1076122&view=rev
Log:
GERONIMO-5839 Add module name prefix for WSDL path

Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
  (contents, props changed)
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?rev=1076122&r1=1076121&r2=1076122&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
Wed Mar  2 06:57:40 2011
@@ -201,13 +201,25 @@ public class Axis2Builder extends JAXWSS
     @Override
     protected void initialize(GBeanData targetGBean, Class serviceClass, PortInfo portInfo,
Module module, Bundle bundle) throws DeploymentException {
         String serviceName = (portInfo.getServiceName() == null ? serviceClass.getName()
: portInfo.getServiceName());
-        if (isWsdlSet(portInfo, serviceClass, bundle)) {
-            log.debug("Service " + serviceName + " has WSDL.");
+        if(portInfo.getWsdlFile() != null && !portInfo.getWsdlFile().trim().equals(""))
{
+            if (log.isDebugEnabled()) {
+                log.debug("Service " + serviceName + " has WSDL. " + portInfo.getWsdlFile());
+            }
+            return;
+        } else if(JAXWSUtils.containsWsdlLocation(serviceClass, bundle)){
+            String wsdlFile = JAXWSUtils.getServiceWsdlLocation(serviceClass, bundle);
+            //TODO Workaround codes for web modules in the EAR package, need to add web module
name prefix
+            portInfo.setWsdlFile(module.getTargetPathURI().resolve(wsdlFile).toString());
+            if(log.isDebugEnabled()) {
+                log.debug("Service "  + serviceName + " has WSDL configured in annotation
" + wsdlFile + " and is resolved as " + portInfo.getWsdlFile());
+            }
             return;
         }
 
         if (isHTTPBinding(portInfo, serviceClass)) {
-            log.debug("Service " + serviceName + " has HTTPBinding.");
+            if (log.isDebugEnabled()) {
+                log.debug("Service " + serviceName + " has HTTPBinding.");
+            }
             return;
         }
 
@@ -215,7 +227,9 @@ public class Axis2Builder extends JAXWSS
             throw new DeploymentException("WSDL must be specified for @WebServiceProvider
service " + serviceName);
         }
 
-        log.debug("Service " + serviceName + " does not have WSDL. Generating WSDL...");
+        if (log.isDebugEnabled()) {
+            log.debug("Service " + serviceName + " does not have WSDL. Generating WSDL...");
+        }
 
         WsdlGenerator wsdlGenerator = getWsdlGenerator();
 
@@ -237,7 +251,9 @@ public class Axis2Builder extends JAXWSS
         String wsdlFile = wsdlGenerator.generateWsdl(module, serviceClass.getName(), module.getEarContext(),
options);
         portInfo.setWsdlFile(wsdlFile);
 
-        log.debug("Generated " + wsdlFile + " for service " + serviceName);
+        if (log.isDebugEnabled()) {
+            log.debug("Generated " + wsdlFile + " for service " + serviceName);
+        }
     }
 
 }

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?rev=1076122&r1=1076121&r2=1076122&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Wed Mar  2 06:57:40 2011
@@ -306,16 +306,14 @@ public class AxisServiceGenerator
         if (wsdlFile == null) {
             return null;
         }
-        URL wsdlURL = null;
-        try {
-            wsdlURL = new URL(wsdlFile);
-        } catch (MalformedURLException e) {
-            // Not a URL, try as a resource
+        URL wsdlURL = BundleUtils.getEntry(bundle, wsdlFile);
+        if (wsdlURL == null) {
             wsdlURL = bundle.getResource(wsdlFile);
             if (wsdlURL == null) {
-                // Cannot get it as a resource, try with
-                // configurationBaseUrl
-                wsdlURL = BundleUtils.getEntry(bundle, wsdlFile);
+                try {
+                    wsdlURL = new URL(wsdlFile);
+                } catch (MalformedURLException e) {
+                }
             }
         }
         return wsdlURL;

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java?rev=1076122&r1=1076121&r2=1076122&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
(original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
Wed Mar  2 06:57:40 2011
@@ -136,7 +136,7 @@ public abstract class JAXWSServiceBuilde
 
         // verify that the class is loadable and is a JAX-WS web service
         Bundle bundle = context.getDeploymentBundle();
-        Class servletClass = loadClass(servletClassName, bundle);
+        Class<?> servletClass = loadClass(servletClassName, bundle);
         if (!JAXWSUtils.isWebService(servletClass)) {
             return false;
         }
@@ -144,9 +144,11 @@ public abstract class JAXWSServiceBuilde
         Map componentContext = null;
         Holder moduleHolder = null;
         try {
-            GBeanData moduleGBean = context.getGBeanInstance(context.getModuleName());
+            //TODO Now we share the same DeploymentContext in the ear package, which means
all the gbeans are saved in the one EARContext
+            //Might need to update while we have real EAR support
+            GBeanData moduleGBean = context.getGBeanInstance(module.getModuleName());
             moduleHolder = (Holder) moduleGBean.getAttribute("holder");
-            GBeanData contextSourceGBean = context.getGBeanInstance(context.getNaming().createChildName(context.getModuleName(),
"ContextSource", "ContextSource"));
+            GBeanData contextSourceGBean = context.getGBeanInstance(context.getNaming().createChildName(module.getModuleName(),
"ContextSource", "ContextSource"));
             componentContext = (Map) contextSourceGBean.getAttribute("componentContext");
         } catch (GBeanNotFoundException e) {
             LOG.warn("ModuleGBean not found. JNDI resource injection will not work.");

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=1076122&r1=1076121&r2=1076122&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Wed Mar  2 06:57:40 2011
@@ -22,7 +22,6 @@ import static java.lang.Boolean.TRUE;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URI;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
@@ -483,18 +482,15 @@ public class TomcatModuleBuilder extends
             }
 
             if (tomcatWebApp.isSetCrossContext()) {
-                //webModuleData.setAttribute("crossContext", Boolean.TRUE);
                 contextAttributes.put("crossContext", "true");
             }
 
             if (tomcatWebApp.isSetWorkDir()) {
                 String workDir = tomcatWebApp.getWorkDir();
-                //webModuleData.setAttribute("workDir", workDir);
                 contextAttributes.put("workDir", workDir);
             }
 
             if (tomcatWebApp.isSetDisableCookies()) {
-                //webModuleData.setAttribute("disableCookies", Boolean.TRUE);
                 contextAttributes.put("cookies", "false");
             }
 
@@ -691,7 +687,7 @@ public class TomcatModuleBuilder extends
                 webApp.setMetadataComplete(true);
                 String specDeploymentPlan = getSpecDDAsString(webModule);
                 module.setOriginalSpecDD(specDeploymentPlan);
-                earContext.addFile(new URI("./WEB-INF/web.xml"), specDeploymentPlan);
+                earContext.addFile(module.getTargetPathURI().resolve("WEB-INF/web.xml"),
specDeploymentPlan);
             }
             webModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
             module.addAsChildConfiguration();



Mime
View raw message