geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r504557 - in /geronimo/server/trunk: ./ configs/axis2-deployer/ configs/axis2/ modules/geronimo-axis2-builder/ modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ modules/geronimo-axis2/ modules/geronimo-axis2/sr...
Date Wed, 07 Feb 2007 14:17:09 GMT
Author: dims
Date: Wed Feb  7 06:17:08 2007
New Revision: 504557

URL: http://svn.apache.org/viewvc?view=rev&rev=504557
Log:
Fix for GERONIMO-2798 - Axis2 Integration - User JAXWS common module to implementation

Modified:
    geronimo/server/trunk/configs/axis2-deployer/pom.xml
    geronimo/server/trunk/configs/axis2/pom.xml
    geronimo/server/trunk/modules/geronimo-axis2-builder/pom.xml
    geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
    geronimo/server/trunk/modules/geronimo-axis2/pom.xml
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/configs/axis2-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis2-deployer/pom.xml?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/configs/axis2-deployer/pom.xml (original)
+++ geronimo/server/trunk/configs/axis2-deployer/pom.xml Wed Feb  7 06:17:08 2007
@@ -1,66 +1,66 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-
-<!-- $Rev: 485514 $ $Date: 2006-12-11 00:53:34 -0500 (Mon, 11 Dec 2006) $ -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.geronimo.configs</groupId>
-        <artifactId>configs</artifactId>
-        <version>2.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>axis2-deployer</artifactId>
-    <name>Geronimo Configs :: Axis2 Deployer</name>
-    <packaging>car</packaging>
-    
-    <dependencies>
-        
-        <dependency>
-            <groupId>org.apache.geronimo.configs</groupId>
-            <artifactId>j2ee-deployer</artifactId>
-            <version>${version}</version>
-            <type>car</type>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-axis2-builder</artifactId>
-            <version>${version}</version>
-        </dependency>
-
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.
+-->
+
+<!-- $Rev: 485514 $ $Date: 2006-12-11 00:53:34 -0500 (Mon, 11 Dec 2006) $ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.configs</groupId>
+        <artifactId>configs</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>axis2-deployer</artifactId>
+    <name>Geronimo Configs :: Axis2 Deployer</name>
+    <packaging>car</packaging>
+    
+    <dependencies>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+             <artifactId>jaxws-deployer</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-axis2-builder</artifactId>
+            <version>${version}</version>
+        </dependency>
+
         <dependency>
             <groupId>wsdl4j</groupId>
             <artifactId>wsdl4j</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.configs</groupId>
-            <artifactId>axis2</artifactId>
-            <type>car</type>
-            <version>${version}</version>
-            <scope>runtime</scope>
-       </dependency>
-
-    </dependencies>
-    
-</project>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>axis2</artifactId>
+            <type>car</type>
+            <version>${version}</version>
+            <scope>runtime</scope>
+       </dependency>
+
+    </dependencies>
+    
+</project>

Modified: geronimo/server/trunk/configs/axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis2/pom.xml?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/configs/axis2/pom.xml (original)
+++ geronimo/server/trunk/configs/axis2/pom.xml Wed Feb  7 06:17:08 2007
@@ -49,6 +49,13 @@
             <version>${version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>transaction-jta11</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+        
        <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-axis2</artifactId>
@@ -59,13 +66,122 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-annotation_1.0_spec</artifactId>
         </dependency>
+        
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
         </dependency>
+        
+         <dependency>
+	        <groupId>org.apache.axis2</groupId>
+	        <artifactId>axis2-java2wsdl</artifactId>
+	    </dependency>
         <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-jaxws</artifactId>
-        </dependency>
+	         <groupId>org.apache.axis2</groupId>
+	         <artifactId>axis2-kernel</artifactId>
+	    </dependency>
+    	<dependency>
+	         <groupId>org.apache.axis2</groupId>
+	         <artifactId>axis2-adb</artifactId>
+	    </dependency>
+	    <dependency>
+	         <groupId>org.apache.axis2</groupId>
+	         <artifactId>axis2-jaxws-api</artifactId>
+	    </dependency>
+	    <dependency>
+	         <groupId>org.apache.axis2</groupId>
+	         <artifactId>axis2-jaxws</artifactId>
+	    </dependency>
+       	<dependency>
+		    <groupId>org.apache.axis2</groupId>
+		    <artifactId>axis2-metadata</artifactId>
+		</dependency>
+	    <dependency>
+	        <groupId>org.apache.ws.commons.axiom</groupId>
+	        <artifactId>axiom-api</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>org.apache.ws.commons.axiom</groupId>
+	        <artifactId>axiom-impl</artifactId>
+	    </dependency>
+	    <dependency>
+	         <groupId>org.apache.ws.commons</groupId>
+	         <artifactId>XmlSchema</artifactId>
+	    </dependency>
+	    <dependency>
+	         <groupId>org.apache.neethi</groupId>
+	         <artifactId>neethi</artifactId>
+	    </dependency>
+	    <dependency>
+	         <groupId>commons-logging</groupId>
+	         <artifactId>commons-logging</artifactId>
+	         <exclusions>
+	              <exclusion>
+	                    <groupId>log4j</groupId>
+	                    <artifactId>log4j</artifactId>
+	               </exclusion>
+	               <exclusion>
+	                    <groupId>logkit</groupId>
+	                    <artifactId>logkit</artifactId>
+	               </exclusion>
+	               <exclusion>
+	                    <groupId>avalon-framework</groupId>
+	                    <artifactId>avalon-framework</artifactId>
+	               </exclusion>
+	         </exclusions>
+	    </dependency>
+	    <dependency>
+	         <groupId>commons-httpclient</groupId>
+	         <artifactId>commons-httpclient</artifactId>
+	    </dependency>
+	    <dependency>
+	    	<groupId>commons-codec</groupId>
+	        <artifactId>commons-codec</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>stax</groupId>
+	        <artifactId>stax-api</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>wsdl4j</groupId>
+	        <artifactId>wsdl4j</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>javax.mail</groupId>
+	        <artifactId>mail</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>javax.activation</groupId>
+	        <artifactId>activation</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>xalan</groupId>
+	        <artifactId>xalan</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>xmlbeans</groupId>
+	        <artifactId>xbean</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>jaxen</groupId>
+	        <artifactId>jaxen</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>backport-util-concurrent</groupId>
+	        <artifactId>backport-util-concurrent</artifactId>
+	    </dependency>
+	    <dependency>
+	         <groupId>annogen</groupId>
+	         <artifactId>annogen</artifactId>
+	    </dependency>
+	    <dependency>
+	         <groupId>incubator-woden</groupId>
+	         <artifactId>woden</artifactId>
+	    </dependency>
+	    <dependency>
+	          <groupId>javax.xml.bind</groupId>
+	          <artifactId>jaxb-api</artifactId>
+	    </dependency>
+	        	
     </dependencies>
 </project>

Modified: geronimo/server/trunk/modules/geronimo-axis2-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2-builder/pom.xml?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2-builder/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-axis2-builder/pom.xml Wed Feb  7 06:17:08 2007
@@ -33,7 +33,11 @@
     <name>Geronimo :: Axis2 :: Builder</name>
     
     <dependencies>
-        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-jaxws-builder</artifactId>
+            <version>${version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-j2ee-builder</artifactId>

Modified: geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
Wed Feb  7 06:17:08 2007
@@ -20,7 +20,6 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -30,25 +29,25 @@
 import java.util.jar.JarFile;
 
 import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
+import javax.xml.transform.stream.StreamSource;
 import javax.xml.ws.handler.Handler;
 
+import org.apache.axis2.jaxws.javaee.HandlerChainsType;
 import org.apache.axis2.jaxws.javaee.PortComponentType;
+import org.apache.axis2.jaxws.javaee.ServiceImplBeanType;
 import org.apache.axis2.jaxws.javaee.WebserviceDescriptionType;
 import org.apache.axis2.jaxws.javaee.WebservicesType;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.axis2.Axis2WebServiceContainerFactoryGBean;
-import org.apache.geronimo.axis2.PortInfo;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
@@ -58,54 +57,41 @@
 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.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.jaxws.builder.JAXWSServiceBuilder;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.repository.Environment;
 
-public class Axis2Builder implements WebServiceBuilder {
+public class Axis2Builder extends JAXWSServiceBuilder {
 
 	private static final Log log = LogFactory.getLog(Axis2Builder.class);
 	
-    private final Environment defaultEnvironment;
-    private static final String KEY = Axis2Builder.class.getName();
-    private JAXBContext ctx;
-    private Definition wsdlDefinition = null;
-
-    public Axis2Builder(Environment defaultEnviroment) throws JAXBException {
-        this.defaultEnvironment = defaultEnviroment;
-        ctx = JAXBContext.newInstance(WebservicesType.class);
+	private Definition wsdlDefinition = null;
+	
+    public Axis2Builder(Environment defaultEnviroment) {
+    	super(defaultEnviroment);
     }
-
-    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 {
-            URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, path);
-            Map portMap = parseWebServiceDescriptor(wsDDUrl, moduleFile, isEJB, servletLocations);
-            if (portMap != null) {
-                EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
-                sharedContext.put(KEY, portMap);
-            }
-        } catch (MalformedURLException e) {
-            // The webservices.xml file doesn't exist.
-        }
-
+    
+    public Axis2Builder(){
+    	super(null);
     }
-
-    private Map<String, PortInfo> parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile,
boolean isEJB, Map correctedPortLocations)
-            throws DeploymentException {
-
-        log.debug("parsing descriptor " + wsDDUrl);
-
-        Map<String, PortInfo> map = new HashMap<String, PortInfo>();
+    
+    protected GBeanInfo getContainerFactoryGBeanInfo() {
+        return Axis2WebServiceContainerFactoryGBean.GBEAN_INFO;
+    }
+    
+	protected Map<String, org.apache.geronimo.jaxws.PortInfo> parseWebServiceDescriptor(InputStream
in,
+            URL wsDDUrl,
+            JarFile moduleFile,
+            boolean isEJB,
+            Map correctedPortLocations) throws DeploymentException {
+		log.debug("Parsing descriptor " + wsDDUrl);
+		
+		Map<String, org.apache.geronimo.jaxws.PortInfo> map = null;
 
         try {
-            InputStream in = wsDDUrl.openStream();
-            if (in == null) {
-                throw new DeploymentException("unable to read descriptor " + wsDDUrl);
-            }
-
+            JAXBContext ctx = JAXBContext.newInstance(WebservicesType.class);
             Unmarshaller unmarshaller = ctx.createUnmarshaller();
-            Object obj = unmarshaller.unmarshal(new javax.xml.transform.stream.StreamSource(in),
WebservicesType.class);
+            Object obj = unmarshaller.unmarshal(new StreamSource(in), WebservicesType.class);
 
             if (obj instanceof JAXBElement) {
                 obj = ((JAXBElement) obj).getValue();
@@ -117,48 +103,81 @@
             WebservicesType wst = (WebservicesType) obj;
 
             for (WebserviceDescriptionType desc : wst.getWebserviceDescription()) {
-                final String wsdlFile = desc.getWsdlFile().getValue();
-                final String serviceName = desc.getWebserviceDescriptionName().getValue();
-                
-                URL wsdlURL = null;
-                try {
-                	if(wsdlFile != null){
-                		wsdlURL = DeploymentUtil.createJarURL(moduleFile, wsdlFile);
-    					InputStream wsdlStream = wsdlURL.openStream();
+                String wsdlFile = null;
+                if (desc.getWsdlFile() != null) {
+                    wsdlFile = getString(desc.getWsdlFile().getValue());
+                    
+                    if(wsdlFile != null && !wsdlFile.equals("")){
+                    	URL wsdlURL = DeploymentUtil.createJarURL(moduleFile, wsdlFile);
+                    	InputStream wsdlStream = wsdlURL.openStream();
     					if(wsdlStream == null){
     						throw new DeploymentException("unable to read descriptor "+wsdlURL);
     					}else {
-    						wsdlStream.close();
+    						try {
+								WSDLFactory factory = WSDLFactory.newInstance();
+								WSDLReader reader = factory.newWSDLReader();
+								reader.setFeature("javax.wsdl.importDocuments", true);
+								reader.setFeature("javax.wsdl.verbose", false);
+								wsdlDefinition = reader.readWSDL(wsdlURL.toString());
+								wsdlStream.close();
+							} catch (RuntimeException e) {
+								throw new DeploymentException("invalid WSDL provided "+wsdlURL);
+							}
     					}
-    					try {
-							WSDLFactory factory = WSDLFactory.newInstance();
-							WSDLReader reader = factory.newWSDLReader();
-							reader.setFeature("javax.wsdl.importDocuments", true);
-							reader.setFeature("javax.wsdl.verbose", false);
-							wsdlDefinition = reader.readWSDL(wsdlURL.toString());
-						} catch (WSDLException e) {
-							throw new DeploymentException("Invalid WSDL provided "+e);
-						}
-                	}
-				} catch (RuntimeException e) {
-					throw new DeploymentException("Invalid url "+wsdlURL);
-				}
+                    }else {
+                    	throw new DeploymentException("invalid WSDL provided "+wsdlFile);
+                    }
+                }
+                
+                String serviceName = desc.getWebserviceDescriptionName().getValue();
 
                 for (PortComponentType port : desc.getPortComponent()) {
-                    String servlet = port.getServiceImplBean().getServletLink().getValue();
-                    String sei = port.getServiceEndpointInterface().getValue();
+
+                    org.apache.geronimo.jaxws.PortInfo portInfo = new org.apache.geronimo.jaxws.PortInfo();
+                    
+                    String serviceLink = null;
+                    ServiceImplBeanType beanType = port.getServiceImplBean();
+                    if (beanType.getEjbLink() != null) {
+                        serviceLink = beanType.getEjbLink().getValue();
+                    } else if (beanType.getServletLink().getValue() != null) {
+                        serviceLink = beanType.getServletLink().getValue();
+                    }
+                    portInfo.setServiceLink(serviceLink);
+
+                    if (port.getServiceEndpointInterface() != null) {
+                        String sei = port.getServiceEndpointInterface().getValue();
+                        portInfo.setServiceEndpointInterfaceName(sei);
+                    }
+
                     String portName = port.getPortComponentName().getValue();
-                    String urlpattern = (String) correctedPortLocations.get(servlet);
-                    PortInfo portInfo = new PortInfo();
+                    portInfo.setPortName(portName);
 
+                    portInfo.setProtocolBinding(port.getProtocolBinding());
                     portInfo.setServiceName(serviceName);
-                    portInfo.setServletLink(servlet);
-                    portInfo.setServiceEndpointInterfaceName(sei);
-                    portInfo.setPortName(portName);
                     portInfo.setWsdlFile(wsdlFile);
-                    portInfo.setHandlers(port.getHandler());
-                    portInfo.setURLPattern(urlpattern);
-                    map.put(servlet, portInfo);
+
+                    if (port.getEnableMtom() != null) {
+                        portInfo.setEnableMTOM(port.getEnableMtom().isValue());
+                    }
+
+                    portInfo.setHandlers(HandlerChainsType.class, port.getHandlerChains());
+
+                    if (port.getWsdlPort() != null) {
+                        portInfo.setWsdlPort(port.getWsdlPort().getValue());
+                    }
+
+                    if (port.getWsdlService() != null) {
+                        portInfo.setWsdlService(port.getWsdlService().getValue());
+                    }
+                    
+                    String location = (String) correctedPortLocations.get(serviceLink);
+                    portInfo.setLocation(location);
+                    
+                    if (map == null) {
+                        map = new HashMap<String, org.apache.geronimo.jaxws.PortInfo>();
+                    }
+                    
+                    map.put(serviceLink, portInfo);
                 }
             }
 
@@ -166,76 +185,75 @@
         } catch (FileNotFoundException e) {
             return Collections.EMPTY_MAP;
         } catch (IOException ex) {
-            ex.printStackTrace();
-            throw new DeploymentException("unable to read " + wsDDUrl, ex);
+            throw new DeploymentException("Unable to read " + wsDDUrl, ex);
         } catch (JAXBException ex) {
-            throw new DeploymentException("unable to parse webservices.xml", ex);
+            throw new DeploymentException("Unable to parse " + wsDDUrl, ex);
+        } catch (Exception ex) {
+            throw new DeploymentException("Unknown deployment error", ex);
+        } finally {
+            try {
+                in.close();
+            } catch (IOException e) {
+                // ignore
+            }
         }
-    }
-
-    public boolean configurePOJO(GBeanData targetGBean, String servletName, Module module,
String seiClassName, DeploymentContext context)
-            throws DeploymentException {
-        // assert pi instanceof PortInfo : "received incorrect portInfo object";
-
-        Map sharedContext = ((WebModule) module).getSharedContext();
+	}
+	
+	public boolean configurePOJO(GBeanData targetGBean,
+            String servletName,
+            Module module,
+            String seiClassName,
+            DeploymentContext context)
+		throws DeploymentException {
+		
+		boolean status = super.configurePOJO(targetGBean, servletName, module, seiClassName, context);
+		
+		if(wsdlDefinition != null){
+			//add the WSDL
+			try {
+				AbstractName containerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(),
getContainerFactoryGBeanInfo().getName(), NameFactory.GERONIMO_SERVICE);
+				GBeanData factory = context.getGBeanInstance(containerFactoryName); 
+				factory.setAttribute("wsdlDefinition", wsdlDefinition);
+			} catch (GBeanNotFoundException e) {
+				throw new DeploymentException("Unexpected condition"+e, e);
+			}
+		}
+		
+		//change the URL
+		Map sharedContext = ((WebModule) module).getSharedContext();
         String contextRoot = ((WebModule) module).getContextRoot();
-        Map portInfoMap = (Map) sharedContext.get(KEY);
-        PortInfo portInfo = (PortInfo) portInfoMap.get(servletName);
+        Map portInfoMap = (Map) sharedContext.get(getKey());
         
-        processURLPattern(contextRoot, portInfo);
-        
-        if (portInfo == null) {
-            // not ours
-            return false;
-        }
+        if(portInfoMap != null && portInfoMap.get(servletName) != null){
+        	org.apache.geronimo.jaxws.PortInfo portInfo = (org.apache.geronimo.jaxws.PortInfo)
portInfoMap.get(servletName);
+    		processURLPattern(contextRoot, portInfo);
 
-        log.debug("configuring POJO webservice: " + servletName + " sei: " + seiClassName);
+        }
         
-        // verify that the class is loadable
-        ClassLoader classLoader = context.getClassLoader();
-        loadSEI(seiClassName, classLoader);
-
-        /* List<Handler> handlers = */
-        buildHandlerChain(portInfo);
-        AbstractName containerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(),
"Axis2WebServiceContainerFactory", NameFactory.GERONIMO_SERVICE);
-        GBeanData containerFactoryData = new GBeanData(containerFactoryName, Axis2WebServiceContainerFactoryGBean.GBEAN_INFO);
-        containerFactoryData.setAttribute("portInfo", portInfo);
-        containerFactoryData.setAttribute("endpointClassName", seiClassName);
-        containerFactoryData.setAttribute("wsdlDefinition", wsdlDefinition);
-        try {
-            context.addGBean(containerFactoryData);
-        } catch (GBeanAlreadyExistsException e) {
-            throw new DeploymentException("Could not add web service container factory gbean",
e);
+		return status;
+	}
+	
+	private static String getString(String in) {
+        if (in != null) {
+            in = in.trim();
+            if (in.length() == 0) {
+                return null;
+            }
         }
+        return in;
+	}
 
-        targetGBean.setReferencePattern("WebServiceContainerFactory", containerFactoryName);
-        targetGBean.setAttribute("pojoClassName", seiClassName);
-        return true;
-    }
-
-    public boolean configureEJB(GBeanData targetGBean, String ejbName, JarFile moduleFile,
Map sharedContext, ClassLoader classLoader)
-            throws DeploymentException {
-        throw new DeploymentException("configureEJB NYI");
-    }
-
-    Class<?> loadSEI(String className, ClassLoader loader) throws DeploymentException
{
-        try {
-            return loader.loadClass(className);
-        } catch (ClassNotFoundException ex) {
-            throw new DeploymentException("Unable to load Service Endpoint Interface: " +
className, ex);
-        }
-    }
 
-    private List<Handler> buildHandlerChain(PortInfo portInfo) {
+    private List<Handler> buildHandlerChain(org.apache.geronimo.jaxws.PortInfo portInfo)
{
         return new ArrayList<Handler>();
     }
 
-    private void processURLPattern(String contextRoot, PortInfo portInfo) throws DeploymentException
{
+    private void processURLPattern(String contextRoot, org.apache.geronimo.jaxws.PortInfo
portInfo) throws DeploymentException {
         //if the user specifies a url-pattern, set it here. 
-        String oldup = portInfo.getURLPattern();
+        String oldup = portInfo.getLocation();
         if (oldup == null || oldup.length() == 0) { 
             //if we cannot grab a valid urlpattern, default it to the port-component-name.
-            portInfo.setURLPattern(portInfo.getPortName());   
+            oldup = portInfo.getPortName();   
         } else {
             int i = oldup.indexOf(contextRoot);
             oldup = oldup.substring(i + contextRoot.length() + 1);
@@ -253,18 +271,17 @@
                 oldup = oldup.substring(0, oldup.length() - 1);
             }
         
-            portInfo.setURLPattern(oldup);
         } 
+        portInfo.setLocation(oldup);
     }
+    
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(Axis2Builder.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addInterface(WebServiceBuilder.class);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
-
         infoBuilder.setConstructor(new String[]{"defaultEnvironment"});
-
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/modules/geronimo-axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/pom.xml?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/pom.xml Wed Feb  7 06:17:08 2007
@@ -43,6 +43,21 @@
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-jaxws</artifactId>
         </dependency>
+        <dependency>
+		    <groupId>org.apache.geronimo.modules</groupId>
+	        <artifactId>geronimo-naming</artifactId>
+	        <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-transaction</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-jaxws</artifactId>
+            <version>${version}</version>
+        </dependency>
     </dependencies>
 
     <build>

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
Wed Feb  7 06:17:08 2007
@@ -98,14 +98,14 @@
 
     private transient final ClassLoader classLoader;
     private final String endpointClassName;
-    private final PortInfo portInfo;
+    private final org.apache.geronimo.jaxws.PortInfo portInfo;
     private ConfigurationContext configurationContext;
     private String contextRoot = null;
     private Map servicesMap;
     private Definition wsdlDefinition;
     
     
-    public Axis2WebServiceContainer(PortInfo portInfo, String endpointClassName, Definition
wsdlDefinition, ClassLoader classLoader) {
+    public Axis2WebServiceContainer(org.apache.geronimo.jaxws.PortInfo portInfo, String endpointClassName,
Definition wsdlDefinition, ClassLoader classLoader) {
         this.classLoader = classLoader;
         this.endpointClassName = endpointClassName;
         this.portInfo = portInfo;
@@ -114,7 +114,7 @@
             AxisService service = null;
             
             configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
-            configurationContext.setServicePath(portInfo.getURLPattern());
+            configurationContext.setServicePath(portInfo.getLocation());
           
             if(wsdlDefinition != null){ //WSDL Has been provided
            		WSDLToAxisServiceBuilder wsdlBuilder = null;
@@ -387,7 +387,7 @@
 
         ConfigurationContext configurationContext = msgContext.getConfigurationContext();
         final String servicePath = configurationContext.getServiceContextPath();
-        final String contextPath = (servicePath.startsWith("/") ? servicePath : "/" + servicePath)
+ "/";
+        final String contextPath = (servicePath.startsWith("/") ? servicePath : "/" + servicePath);
 
         URI uri = request.getURI();
         String path = uri.getPath();

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
Wed Feb  7 06:17:08 2007
@@ -17,22 +17,57 @@
 
 package org.apache.geronimo.axis2;
 
+import java.net.URL;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.transaction.TransactionManager;
 import javax.wsdl.Definition;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
+import org.apache.geronimo.transaction.GeronimoUserTransaction;
 import org.apache.geronimo.webservices.WebServiceContainer;
 import org.apache.geronimo.webservices.WebServiceContainerFactory;
 
 public class Axis2WebServiceContainerFactoryGBean implements WebServiceContainerFactory {
 
+	private static final Log log = LogFactory.getLog(Axis2WebServiceContainerFactoryGBean.class);
+    private final ClassLoader classLoader;
     private final PortInfo portInfo;
     private final String endpointClassName;
-    private final ClassLoader classLoader;
-    private final Definition wsdlDefinition;
+    private URL configurationBaseUrl;
+    private Context context;
+    private Definition wsdlDefinition;
+
+    public Axis2WebServiceContainerFactoryGBean(PortInfo portInfo, 
+    		String endpointClassName, 
+    		ClassLoader classLoader, 
+    		Map componentContext,
+            Kernel kernel,
+            TransactionManager transactionManager,
+            URL configurationBaseUrl, 
+            Definition wsdlDefinition) throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
+    	
+    	if (componentContext != null) {
+            GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
+            try {
+                this.context = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext,
+                        userTransaction,
+                        kernel,
+                        classLoader);
+            } catch (NamingException e) {
+                log.warn("Failed to create naming context", e);
+            }
+        }
 
-    public Axis2WebServiceContainerFactoryGBean(PortInfo portInfo, String endpointClassName,
Definition wsdlDefinition, ClassLoader classLoader) throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
         this.portInfo = portInfo;
         this.classLoader = classLoader;
         this.endpointClassName = endpointClassName;
@@ -49,9 +84,15 @@
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(Axis2WebServiceContainerFactoryGBean.class,
NameFactory.GERONIMO_SERVICE);
         infoBuilder.addAttribute("portInfo", PortInfo.class, true, true);
         infoBuilder.addAttribute("endpointClassName", String.class, true, true);
-        infoBuilder.addAttribute("wsdlDefinition", Definition.class, true, true);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
-        infoBuilder.setConstructor(new String[]{"portInfo", "endpointClassName", "wsdlDefinition",
"classLoader"});
+        infoBuilder.addAttribute("componentContext", Map.class, true, true);
+        infoBuilder.addAttribute("kernel", Kernel.class, false);
+        infoBuilder.addReference("TransactionManager", TransactionManager.class, NameFactory.TRANSACTION_MANAGER);
+        infoBuilder.addAttribute("configurationBaseUrl", URL.class, true);
+        infoBuilder.addAttribute("wsdlDefinition", Definition.class, true);
+
+        infoBuilder.setConstructor(new String[]{"portInfo", "endpointClassName", "classLoader",
+                "componentContext", "kernel", "TransactionManager", "configurationBaseUrl",
"wsdlDefinition"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?view=diff&rev=504557&r1=504556&r2=504557
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Wed Feb  7 06:17:08 2007
@@ -1193,10 +1193,114 @@
 
             <!--Axis2 modules dependencies-->
             <dependency>
-                <groupId>org.apache.axis2</groupId>
-                <artifactId>axis2-jaxws</artifactId>
-                <version>SNAPSHOT</version>
-            </dependency>
+			    <groupId>org.apache.axis2</groupId>
+			    <artifactId>axis2-java2wsdl</artifactId>
+			    <version>SNAPSHOT</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>org.apache.axis2</groupId>
+			    <artifactId>axis2-kernel</artifactId>
+			    <version>SNAPSHOT</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>org.apache.axis2</groupId>
+			    <artifactId>axis2-adb</artifactId>
+			    <version>SNAPSHOT</version>
+	    	</dependency>
+		    <dependency>
+			    <groupId>org.apache.axis2</groupId>
+			    <artifactId>axis2-jaxws-api</artifactId>
+			    <version>SNAPSHOT</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>org.apache.axis2</groupId>
+			    <artifactId>axis2-jaxws</artifactId>
+			    <version>SNAPSHOT</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>org.apache.axis2</groupId>
+			    <artifactId>axis2-metadata</artifactId>
+			    <version>SNAPSHOT</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>org.apache.ws.commons.axiom</groupId>
+			    <artifactId>axiom-api</artifactId>
+			    <version>SNAPSHOT</version>
+			    <exclusions>
+				    <exclusion>
+					    <groupId>log4j</groupId>
+					    <artifactId>log4j</artifactId>
+				    </exclusion>
+			    </exclusions>
+		    </dependency>
+		    <dependency>
+			    <groupId>org.apache.ws.commons.axiom</groupId>
+			    <artifactId>axiom-impl</artifactId>
+			    <version>SNAPSHOT</version>
+			    <exclusions>
+				    <exclusion>
+					    <groupId>log4j</groupId>
+					    <artifactId>log4j</artifactId>
+				    </exclusion>
+			    </exclusions>
+		    </dependency>
+		    <dependency>
+			    <groupId>org.apache.neethi</groupId>
+			    <artifactId>neethi</artifactId>
+			    <version>2.0</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>commons-httpclient</groupId>
+			    <artifactId>commons-httpclient</artifactId>
+			    <version>3.0.1</version>
+			    <exclusions>
+				    <exclusion>
+					    <groupId>junit</groupId>
+					    <artifactId>junit</artifactId>
+				    </exclusion>
+			    </exclusions>
+		    </dependency>
+		    <dependency>
+			    <groupId>commons-codec</groupId>
+			    <artifactId>commons-codec</artifactId>
+			    <version>1.3</version>
+			    <exclusions>
+				    <exclusion>
+					    <groupId>junit</groupId>
+					    <artifactId>junit</artifactId>
+				    </exclusion>
+			    </exclusions>
+		    </dependency>
+		    <dependency>
+			    <groupId>javax.mail</groupId>
+			    <artifactId>mail</artifactId>
+			    <version>1.4</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>javax.activation</groupId>
+			    <artifactId>activation</artifactId>
+			    <version>1.1</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>xalan</groupId>
+			    <artifactId>xalan</artifactId>
+			    <version>2.7.0</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>jaxen</groupId>
+			    <artifactId>jaxen</artifactId>
+			    <version>1.1-beta-10</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>annogen</groupId>
+			    <artifactId>annogen</artifactId>
+			    <version>0.1.0</version>
+		    </dependency>
+		    <dependency>
+			    <groupId>incubator-woden</groupId>
+			    <artifactId>woden</artifactId>
+			    <version>1.0.0M6</version>
+		    </dependency>
         </dependencies>
     </dependencyManagement>
 
@@ -1427,8 +1531,7 @@
     <repositories>
         <!--
         NOTE: The default repositories are picked up by Genesis, but need to
-              specify where Genesis lives to pick it up + any additional repositories.
-        -->
+              specify where Genesis lives to pick it up  any additional repositories.   
    -->
         
         <repository>
             <id>apache-snapshots</id>



Mime
View raw message