geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r219995 - in /geronimo/trunk/modules: axis-builder/src/java/org/apache/geronimo/axis/builder/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/ tomcat-builder/src/java/org/apa...
Date Thu, 21 Jul 2005 04:28:20 GMT
Author: djencks
Date: Wed Jul 20 21:28:19 2005
New Revision: 219995

URL: http://svn.apache.org/viewcvs?rev=219995&view=rev
Log:
GERONIMO-782 step 2 use WebServiceBuilder methods from tomcat builder and openejb builder.
 Still needs cleanup in openejb builder

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Wed Jul 20 21:28:19 2005
@@ -151,8 +151,25 @@
         }
     }
 
-    public void configureEJB(GBeanData targetGBean, Object portInfoObject, String seiClassName)
throws DeploymentException {
-
+    public void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject,
ClassLoader classLoader) throws DeploymentException {
+        PortInfo portInfo = (PortInfo) portInfoObject;
+        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
+        targetGBean.setAttribute("serviceInfo", serviceInfo);
+        JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
+        URI location = null;
+        try {
+            location = new URI(serviceDesc.getEndpointURL());
+        } catch (URISyntaxException e) {
+            throw new DeploymentException("Invalid webservice endpoint URI", e);
+        }
+        targetGBean.setAttribute("location", location);
+        URI wsdlURI = null;
+        try {
+            wsdlURI = new URI(serviceDesc.getWSDLFile());
+        } catch (URISyntaxException e) {
+            throw new DeploymentException("Invalid wsdl URI", e);
+        }
+        targetGBean.setAttribute("wsdlURI", wsdlURI);
     }
 
 

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
Wed Jul 20 21:28:19 2005
@@ -17,10 +17,8 @@
 package org.apache.geronimo.axis.builder;
 
 import java.lang.reflect.Method;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -29,12 +27,9 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collections;
-import java.util.jar.JarFile;
 import javax.wsdl.Binding;
 import javax.wsdl.BindingInput;
 import javax.wsdl.BindingOperation;
-import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.wsdl.extensions.soap.SOAPBinding;
@@ -47,27 +42,22 @@
 import org.apache.axis.description.OperationDesc;
 import org.apache.axis.encoding.TypeMapping;
 import org.apache.axis.encoding.TypeMappingRegistryImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.axis.client.TypeInfo;
-import org.apache.geronimo.axis.server.AxisWebServiceContainer;
 import org.apache.geronimo.axis.server.ReadOnlyServiceDesc;
 import org.apache.geronimo.axis.server.ServiceInfo;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.xbeans.j2ee.JavaXmlTypeMappingType;
 import org.apache.geronimo.xbeans.j2ee.ServiceEndpointMethodMappingType;
 import org.apache.geronimo.xbeans.wsdl.DefinitionsDocument;
 import org.apache.geronimo.xbeans.wsdl.TDefinitions;
 import org.apache.geronimo.xbeans.wsdl.TImport;
-import org.apache.geronimo.xbeans.wsdl.TPort;
-import org.apache.geronimo.xbeans.wsdl.TService;
 import org.apache.geronimo.xbeans.wsdl.TTypes;
 import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
 import org.apache.xmlbeans.impl.xb.xsdschema.ImportDocument;
 import org.apache.xmlbeans.impl.xb.xsdschema.IncludeDocument;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
 
 /**
  * @version $Rev$ $Date$
@@ -79,27 +69,6 @@
     public static final QName SCHEMA_QNAME = new QName(XSD_NS, "schema");
 
 
-    private static void validateLightweightMapping(Definition definition) throws DeploymentException
{
-        // TODO Plum in the validator
-    }
-
-
-    public static ServiceInfo createServiceInfo(JarFile jarFile, String ejbName, ClassLoader
classLoader) throws DeploymentException {
-        Map portComponentsMap = null;
-        try {
-            URL webservicesURL = DeploymentUtil.createJarURL(jarFile, "META-INF/webservices.xml");
-            //todo make sure ejbs can't be deployed elsewhere
-            portComponentsMap = WSDescriptorParser.parseWebServiceDescriptor(webservicesURL,
jarFile, true, Collections.EMPTY_MAP);
-        } catch (MalformedURLException e1) {
-            throw new DeploymentException("Invalid URL to webservices.xml", e1);
-        }
-
-        // Grab the portInfo for this ejb
-        PortInfo portInfo = (PortInfo) portComponentsMap.get(ejbName);
-        return createServiceInfo(portInfo, classLoader);
-    }
-
-
     public static ServiceInfo createServiceInfo(PortInfo portInfo, ClassLoader classLoader)
throws DeploymentException {
         JavaServiceDesc serviceDesc = createServiceDesc(portInfo, classLoader);
         List handlerInfos = WSDescriptorParser.createHandlerInfoList(portInfo.getHandlers(),
classLoader);
@@ -147,9 +116,9 @@
 
         boolean isLightweight = portInfo.getServiceEndpointInterfaceMapping() == null;
 
-        if (isLightweight) {
-            validateLightweightMapping(portInfo.getDefinition());
-        }
+//        if (isLightweight) {
+//            validateLightweightMapping(portInfo.getDefinition());
+//        }
 
         Collection operations = new ArrayList();
         Set wrapperElementQNames = buildOperations(binding, serviceEndpointInterface, isLightweight,
portInfo, exceptionMap, classLoader, operations);

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
Wed Jul 20 21:28:19 2005
@@ -40,7 +40,7 @@
         throw new DeploymentException("Web services are not available in this configuration");
     }
 
-    public void configureEJB(GBeanData targetGBean, Object portInfoObject, String seiClassName)
throws DeploymentException {
+    public void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject,
ClassLoader classLoader) throws DeploymentException {
         throw new DeploymentException("Web services are not available in this configuration");
     }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
Wed Jul 20 21:28:19 2005
@@ -46,8 +46,10 @@
      * configure the supplied EJBContainer gbeandata to implement the ejb web service described
in the deployment descriptor
      * N.B. this method is a complete guess and should be replaced by something useable right
away!
      * @param targetGBean
+     * @param moduleFile
+     * @param classLoader
      * @throws DeploymentException
      */
-    void configureEJB(GBeanData targetGBean, Object portInfoObject, String seiClassName)
throws DeploymentException;
+    void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfo, ClassLoader
classLoader) throws DeploymentException;
 
 }

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
Wed Jul 20 21:28:19 2005
@@ -101,6 +101,7 @@
     public static final String SERVLET_WEB_SERVICE_TEMPLATE = "ServletWebServiceTemplate";
     public static final String CORBA_CSS = "CORBACSS";
     public static final String CORBA_TSS = "CORBATSS";
+    public static final String WEB_SERVICE_LINK = "WSLink";
 
     public static ObjectName getDomainName(String j2eeDomainName, J2eeContext context) throws
MalformedObjectNameException {
         Properties props = new Properties();

Modified: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Wed Jul 20 21:28:19 2005
@@ -36,26 +36,13 @@
 import java.util.Set;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.security.jacc.WebResourcePermission;
 import javax.security.jacc.WebRoleRefPermission;
 import javax.security.jacc.WebUserDataPermission;
 import javax.transaction.UserTransaction;
-import javax.wsdl.WSDLException;
 
-import org.apache.axis.description.JavaServiceDesc;
-import org.apache.axis.handlers.HandlerInfoChainFactory;
-import org.apache.axis.handlers.soap.SOAPService;
-import org.apache.axis.providers.java.RPCProvider;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.axis.builder.AxisServiceBuilder;
-import org.apache.geronimo.axis.builder.PortInfo;
-import org.apache.geronimo.axis.server.AxisWebServiceContainer;
-import org.apache.geronimo.axis.server.POJOProvider;
-import org.apache.geronimo.axis.server.ServiceInfo;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
@@ -72,7 +59,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.ClassLoaderReference;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.kernel.repository.Repository;
@@ -90,11 +76,10 @@
 import org.apache.geronimo.tomcat.ValveGBean;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
-import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.xbeans.geronimo.web.GerConfigParamType;
+import org.apache.geronimo.xbeans.geronimo.web.GerContainerConfigType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
-import org.apache.geronimo.xbeans.geronimo.web.GerContainerConfigType;
-import org.apache.geronimo.xbeans.geronimo.web.GerConfigParamType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebContainerType;
 import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
 import org.apache.geronimo.xbeans.j2ee.HttpMethodType;
@@ -116,7 +101,6 @@
  * @version $Rev: 161588 $ $Date: 2005-04-16 12:06:59 -0600 (Sat, 16 Apr 2005) $
  */
 public class TomcatModuleBuilder implements ModuleBuilder {
-    private static Log log = LogFactory.getLog(TomcatModuleBuilder.class);
 
     private final URI defaultParentId;
     private final ObjectName tomcatContainerObjectName;
@@ -124,19 +108,15 @@
     private final WebServiceBuilder webServiceBuilder;
 
     private final Repository repository;
-    private final Kernel kernel;
 
     public TomcatModuleBuilder(URI defaultParentId,
                                ObjectName tomcatContainerObjectName,
                                WebServiceBuilder webServiceBuilder,
-                               Repository repository,
-                               Kernel kernel) {
+                               Repository repository) {
         this.defaultParentId = defaultParentId;
         this.tomcatContainerObjectName = tomcatContainerObjectName;
         this.webServiceBuilder = webServiceBuilder;
         this.repository = repository;
-        this.kernel = kernel;
-
     }
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException
{
@@ -494,7 +474,7 @@
             if (tomcatWebApp.isSetSecurityRealmName()) {
 
                 SecurityHolder securityHolder = new SecurityHolder();
-                String securityRealmName = tomcatWebApp.getSecurityRealmName().trim();
+//                String securityRealmName = tomcatWebApp.getSecurityRealmName().trim();
 
                 /**
                  * TODO - go back to commented version when possible.
@@ -563,7 +543,7 @@
 
     private void processRoleRefPermissions(ServletType servletType,
                                            Set securityRoles,
-                                           Map rolePermissions) throws MalformedObjectNameException,
DeploymentException {
+                                           Map rolePermissions) {
         String servletName = servletType.getServletName().getStringValue().trim();
 
         //WebRoleRefPermissions
@@ -907,44 +887,13 @@
     }
 
     public StoredObject configurePOJO(JarFile moduleFile, Object portInfoObject, String seiClassName,
ClassLoader classLoader) throws DeploymentException, IOException {
-
-        PortInfo portInfo = (PortInfo) portInfoObject;
-        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
-        JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
-
-        try {
-            classLoader.loadClass(seiClassName);
-        } catch (ClassNotFoundException e) {
-            throw new DeploymentException("Unable to load servlet class for pojo webservice:
" + seiClassName, e);
-        }
-
-        RPCProvider provider = new POJOProvider();
-
-        SOAPService service = new SOAPService(null, provider, null);
-        service.setServiceDescription(serviceDesc);
-        service.setOption("className", seiClassName);
-
-        HandlerInfoChainFactory handlerInfoChainFactory = new HandlerInfoChainFactory(serviceInfo.getHandlerInfos());
-        service.setOption(org.apache.axis.Constants.ATTR_HANDLERINFOCHAIN, handlerInfoChainFactory);
-
-        URI location = null;
-        try {
-            location = new URI(serviceDesc.getEndpointURL());
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Invalid webservice endpoint URI", e);
-        }
-        URI wsdlURI = null;
-        try {
-            wsdlURI = new URI(serviceDesc.getWSDLFile());
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Invalid wsdl URI", e);
-
-        }
-
-        classLoader = new ClassLoaderReference(classLoader);
-        AxisWebServiceContainer axisWebServiceContainer = new AxisWebServiceContainer(location,
wsdlURI, service, serviceInfo.getWsdlMap(), classLoader);
-
-        return new StoredObject(axisWebServiceContainer);
+        //the reason to configure a gbeandata rather than just fetch the WebServiceContainer
is that fetching the WSContainer ties us to that
+        //ws implementation.  By configuring a servlet gbean, you can provide a different
servlet for each combination of
+        //web container and ws implementation while assuming almost nothing about their relationship.
+
+        GBeanData fakeData = new GBeanData();
+        webServiceBuilder.configurePOJO(fakeData, moduleFile, portInfoObject, seiClassName,
classLoader);
+        return (StoredObject) fakeData.getAttribute("webServiceContainer");
     }
 
     class UncheckedItem {
@@ -1012,8 +961,7 @@
             "defaultParentId",
             "tomcatContainerObjectName",
             "WebServiceBuilder",
-            "Repository",
-            "kernel"});
+            "Repository"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
Wed Jul 20 21:28:19 2005
@@ -14,7 +14,7 @@
  */
 public class PlanParsingTest extends TestCase {
     ObjectName tomcatContainerObjectName = JMXUtil.getObjectName("test:type=TomcatContainer");
-    private TomcatModuleBuilder builder = new TomcatModuleBuilder(null, tomcatContainerObjectName,
null, null, null);
+    private TomcatModuleBuilder builder = new TomcatModuleBuilder(null, tomcatContainerObjectName,
null, null);
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public void testResourceRef() throws Exception {

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=219995&r1=219994&r2=219995&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Wed Jul 20 21:28:19 2005
@@ -378,7 +378,7 @@
 
         WebServiceBuilder webServiceBuilder = new AxisBuilder();
 
-        builder = new TomcatModuleBuilder(new URI("null"), containerName, webServiceBuilder,
null, kernel);
+        builder = new TomcatModuleBuilder(new URI("null"), containerName, webServiceBuilder,
null);
 
         // Default Realm
         Map initParams = new HashMap();



Mime
View raw message