geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1101042 - in /geronimo/server/trunk/plugins: axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/ jaxws/geronimo-jaxws-builder/src/main/java/o...
Date Mon, 09 May 2011 14:38:00 GMT
Author: rwonly
Date: Mon May  9 14:37:59 2011
New Revision: 1101042

URL: http://svn.apache.org/viewvc?rev=1101042&view=rev
Log:
GERONIMO-5839 move the work around code to a new util class

Added:
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSBuilderUtils.java
  (with props)
Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.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=1101042&r1=1101041&r2=1101042&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
Mon May  9 14:37:59 2011
@@ -43,6 +43,7 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.jaxws.builder.JAXWSBuilderUtils;
 import org.apache.geronimo.jaxws.builder.JAXWSServiceBuilder;
 import org.apache.geronimo.jaxws.builder.WARWebServiceFinder;
 import org.apache.geronimo.jaxws.builder.wsdl.WsdlGenerator;
@@ -217,14 +218,14 @@ public class Axis2Builder extends JAXWSS
                 log.debug("Service " + serviceName + " has WSDL. " + portInfo.getWsdlFile());
             }
             //TODO Workaround codes for web modules in the EAR package, need to add web module
name prefix
-            if (isWSDLNormalizedRequired(module, wsdlFile)) {
+            if (JAXWSBuilderUtils.isWSDLNormalizedRequired(module, wsdlFile)) {
                 portInfo.setWsdlFile(module.getTargetPathURI().resolve(wsdlFile).toString());
             }
             return;
         } else if(JAXWSUtils.containsWsdlLocation(serviceClass, bundle)){
             wsdlFile = JAXWSUtils.getServiceWsdlLocation(serviceClass, bundle);
             //TODO Workaround codes for web modules in the EAR package, need to add web module
name prefix
-            if (isWSDLNormalizedRequired(module, wsdlFile)) {
+            if (JAXWSBuilderUtils.isWSDLNormalizedRequired(module, wsdlFile)) {
                 portInfo.setWsdlFile(module.getTargetPathURI().resolve(wsdlFile).toString());
             }
             if(log.isDebugEnabled()) {
@@ -279,18 +280,5 @@ public class Axis2Builder extends JAXWSS
         }
     }
 
-    private boolean isURL(String name) {
-        try {
-            new URL(name);
-            return true;
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    private boolean isWSDLNormalizedRequired(Module module, String wsdlLocation) {
-        return (module.getType().equals(ConfigurationModuleType.WAR) || (module.getType().equals(ConfigurationModuleType.EJB)
&& module.getParentModule() != null && module.getParentModule().getType()
-                .equals(ConfigurationModuleType.WAR)))
-                && !isURL(wsdlLocation);
-    }
+    
 }

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java?rev=1101042&r1=1101041&r2=1101042&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
Mon May  9 14:37:59 2011
@@ -38,6 +38,7 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jaxws.builder.EndpointInfoBuilder;
+import org.apache.geronimo.jaxws.builder.JAXWSBuilderUtils;
 import org.apache.geronimo.jaxws.builder.JAXWSServiceRefBuilder;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
@@ -70,7 +71,7 @@ public class Axis2ServiceRefBuilder exte
 
         wsdlURI = builder.getWsdlURI();
         //TODO For non standalone web application, it is embbed of directory style in the
EAR package
-        if (isWSDLNormalizedRequired(module, wsdlURI)) {
+        if (JAXWSBuilderUtils.isWSDLNormalizedRequired(module, wsdlURI.toString())) {
             wsdlURI = module.getTargetPathURI().resolve(wsdlURI);
         }
         serviceQName = builder.getServiceQName();
@@ -108,18 +109,4 @@ public class Axis2ServiceRefBuilder exte
         }
     }
 
-    private boolean isURL(URI name) {
-        try {
-            name.toURL();
-            return true;
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    private boolean isWSDLNormalizedRequired(Module module, URI wsdlLocation) {
-        return (module.getType().equals(ConfigurationModuleType.WAR) || (module.getType().equals(ConfigurationModuleType.EJB)
&& module.getParentModule() != null && module.getParentModule().getType()
-                .equals(ConfigurationModuleType.WAR)))
-                && !isURL(wsdlLocation);
-    }
 }

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java?rev=1101042&r1=1101041&r2=1101042&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
(original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
Mon May  9 14:37:59 2011
@@ -48,6 +48,7 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.jaxws.builder.JAXWSBuilderUtils;
 import org.apache.geronimo.jaxws.builder.JAXWSServiceBuilder;
 import org.apache.geronimo.jaxws.builder.WARWebServiceFinder;
 import org.apache.geronimo.jaxws.builder.wsdl.WsdlGenerator;
@@ -199,21 +200,6 @@ public class CXFBuilder extends JAXWSSer
         return in;
     }
 
-    private boolean isURL(String name) {
-        try {
-            new URL(name);
-            return true;
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    private boolean isWSDLNormalizedRequired(Module module, String wsdlLocation) {
-        return (module.getType().equals(ConfigurationModuleType.WAR) || (module.getType().equals(ConfigurationModuleType.EJB)
&& module.getParentModule() != null && module.getParentModule().getType()
-                .equals(ConfigurationModuleType.WAR)))
-                && !isURL(wsdlLocation);
-    }
-
     @Override
     protected void initialize(GBeanData targetGBean, Class serviceClass, PortInfo portInfo,
Module module, Bundle bundle) throws DeploymentException {
         if (Boolean.getBoolean(USE_WSGEN_PROPERTY)) {
@@ -237,7 +223,7 @@ public class CXFBuilder extends JAXWSSer
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Service " + serviceName + " has WSDL.");
             }
-            if (isWSDLNormalizedRequired(module, wsdlFile)) {
+            if (JAXWSBuilderUtils.isWSDLNormalizedRequired(module, wsdlFile)) {
                 portInfo.setWsdlFile(module.getTargetPathURI().resolve(wsdlFile).toString());
             }
             return;

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java?rev=1101042&r1=1101041&r2=1101042&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
Mon May  9 14:37:59 2011
@@ -30,6 +30,7 @@ import org.apache.geronimo.gbean.GBeanIn
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jaxws.builder.EndpointInfoBuilder;
+import org.apache.geronimo.jaxws.builder.JAXWSBuilderUtils;
 import org.apache.geronimo.jaxws.builder.JAXWSServiceRefBuilder;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
@@ -63,7 +64,7 @@ public class CXFServiceRefBuilder extend
         wsdlURI = builder.getWsdlURI();
 
         //TODO For non standalone web application, it is embbed of directory style in the
EAR package
-        if (isWSDLNormalizedRequired(module, wsdlURI)) {
+        if (JAXWSBuilderUtils.isWSDLNormalizedRequired(module, wsdlURI.toString())) {
             wsdlURI = module.getTargetPathURI().resolve(wsdlURI);
         }
         serviceQName = builder.getServiceQName();
@@ -82,21 +83,6 @@ public class CXFServiceRefBuilder extend
         return new CXFServiceReference(serviceInterface.getName(), serviceReferenceName,
wsdlURI, serviceQName, module.getModuleName(), handlerChainsXML, seiInfoMap);
     }
 
-    private boolean isURL(URI name) {
-        try {
-            name.toURL();
-            return true;
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    private boolean isWSDLNormalizedRequired(Module module, URI wsdlLocation) {
-        return (module.getType().equals(ConfigurationModuleType.WAR) || (module.getType().equals(ConfigurationModuleType.EJB)
&& module.getParentModule() != null && module.getParentModule().getType()
-                .equals(ConfigurationModuleType.WAR)))
-                && !isURL(wsdlLocation);
-    }
-
     public static final GBeanInfo GBEAN_INFO;
 
     static {

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSBuilderUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSBuilderUtils.java?rev=1101042&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSBuilderUtils.java
(added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSBuilderUtils.java
Mon May  9 14:37:59 2011
@@ -0,0 +1,40 @@
+/**
+ *  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.jaxws.builder;
+
+import java.net.URL;
+
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+
+public class JAXWSBuilderUtils {    
+    public static boolean isURL(String name) {
+        try {
+            new URL(name);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    public static boolean isWSDLNormalizedRequired(Module module, String wsdlLocation) {
+        return (module.getType().equals(ConfigurationModuleType.WAR) || (module.getType().equals(ConfigurationModuleType.EJB)
&& module.getParentModule() != null && module.getParentModule().getType()
+                .equals(ConfigurationModuleType.WAR)))
+                && !isURL(wsdlLocation);
+    }
+}

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



Mime
View raw message