geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r505624 - in /geronimo/server/trunk: ./ assemblies/geronimo-jetty6-jee5/src/main/var/config/ assemblies/geronimo-tomcat6-jee5/src/main/var/config/ configs/axis-deployer/src/plan/ configs/openejb-deployer/src/plan/ configs/openejb/ modules/g...
Date Sat, 10 Feb 2007 03:52:40 GMT
Author: dblevins
Date: Fri Feb  9 19:52:38 2007
New Revision: 505624

URL: http://svn.apache.org/viewvc?view=rev&rev=505624
Log:
Ported Axis1 integration

Added:
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisModuleBuilderExtension.java
    geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/EjbWebServiceGBean.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilderExtension.java
Modified:
    geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml
    geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
    geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/openejb/pom.xml
    geronimo/server/trunk/modules/geronimo-axis-builder/pom.xml
    geronimo/server/trunk/modules/geronimo-axis/pom.xml
    geronimo/server/trunk/modules/geronimo-axis/src/main/resources/META-INF/geronimo-dependency.xml
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml Fri
Feb  9 19:52:38 2007
@@ -142,17 +142,6 @@
                     <name>PersistenceUnitBuilder</name>
                 </pattern>
             </reference>
-            <reference name="WebServiceBuilder">
-                <pattern>
-                    <name>CXFBuilder</name>
-                </pattern>
-                <pattern>
-                    <name>Axis2Builder</name>
-                </pattern>
-                <pattern>
-                    <name>WebServiceBuilder</name>
-                </pattern>
-            </reference>
         </gbean>
         <gbean name="EjbRefBuilder">
             <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>

Modified: geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
(original)
+++ geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
Fri Feb  9 19:52:38 2007
@@ -149,17 +149,6 @@
                     <name>PersistenceUnitBuilder</name>
                 </pattern>
             </reference>
-            <reference name="WebServiceBuilder">
-                <pattern>
-                    <name>CXFBuilder</name>
-                </pattern>
-                <pattern>
-                    <name>Axis2Builder</name>
-                </pattern>
-                <pattern>
-                    <name>WebServiceBuilder</name>
-                </pattern>
-            </reference>
         </gbean>
         <gbean name="EjbRefBuilder">
             <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>

Modified: geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml Fri Feb  9 19:52:38 2007
@@ -32,6 +32,30 @@
         </xml-attribute>
     </gbean>
 
+    <gbean name="AxisModuleBuilderExtension" class="org.apache.geronimo.axis.builder.AxisModuleBuilderExtension">
+        <xml-attribute name="defaultEnvironment">
+            <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>geronimo-axis</artifactId>
+                        <type>jar</type>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>openejb-axis</artifactId>
+                        <type>jar</type>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>geronimo-openejb-builder</artifactId>
+                        <type>jar</type>
+                    </dependency>
+                </dependencies>
+            </environment>
+        </xml-attribute>
+    </gbean>
+
     <gbean name="AxisServiceRefBuilder" class="org.apache.geronimo.axis.builder.AxisServiceRefBuilder">
         <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
         <xml-attribute name="defaultEnvironment">
@@ -49,6 +73,7 @@
             <name>WebServiceBuilder</name>
         </reference>
     </gbean>
+
     <gbean name="AxisClientServiceRefBuilder" class="org.apache.geronimo.axis.builder.AxisServiceRefBuilder">
         <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
         <xml-attribute name="defaultEnvironment">

Modified: geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml Fri Feb  9 19:52:38 2007
@@ -24,14 +24,9 @@
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
-        <references name="WebServiceBuilder">
-            <pattern>
-                <name>WebServiceBuilder</name>
-            </pattern>
-            <pattern>
-                <name>UnavailableWebServiceBuilder</name>
-            </pattern>
-        </references>
+        <reference name="ModuleBuilderExtensions">
+            <name>ModuleBuilderExtension</name>
+        </reference>
         <reference name="SecurityBuilders">
             <name>SecurityBuilder</name>
         </reference>

Modified: geronimo/server/trunk/configs/openejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb/pom.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/configs/openejb/pom.xml (original)
+++ geronimo/server/trunk/configs/openejb/pom.xml Fri Feb  9 19:52:38 2007
@@ -29,7 +29,7 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>openejb</artifactId>
+    <artifactId>openejb-config</artifactId>
     <name>Geronimo Configs :: OpenEJB</name>
     <packaging>car</packaging>
 

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/pom.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/pom.xml Fri Feb  9 19:52:38 2007
@@ -42,6 +42,12 @@
 
         <dependency>
             <groupId>${pom.groupId}</groupId>
+            <artifactId>geronimo-openejb-builder</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
             <artifactId>geronimo-axis</artifactId>
             <version>${version}</version>
         </dependency>

Added: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisModuleBuilderExtension.java?view=auto&rev=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisModuleBuilderExtension.java
(added)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisModuleBuilderExtension.java
Fri Feb  9 19:52:38 2007
@@ -0,0 +1,157 @@
+/**
+ * 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.axis.builder;
+
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.axis.server.EjbWebServiceGBean;
+import org.apache.geronimo.openejb.deployment.EjbModule;
+import org.apache.openejb.assembler.classic.EnterpriseBeanInfo;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.jar.JarFile;
+import java.io.File;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AxisModuleBuilderExtension implements ModuleBuilderExtension {
+
+    private final AxisBuilder axisBuilder;
+
+    public AxisModuleBuilderExtension() {
+        this(null);
+    }
+
+    public AxisModuleBuilderExtension(Environment defaultEnvironment) {
+        axisBuilder = new AxisBuilder(defaultEnvironment);
+    }
+
+    public void createModule(Module module, File plan, JarFile moduleFile, Naming naming,
ModuleIDBuilder idBuilder) throws DeploymentException {
+    }
+
+    public void createModule(Module module, Object plan, JarFile moduleFile, String targetPath,
URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming
naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+        if (module.getType() != ConfigurationModuleType.EJB) {
+            return;
+        }
+
+        //overridden web service locations
+        Map correctedPortLocations = new HashMap();
+        EjbModule ejbModule = (EjbModule) module;
+
+//        OpenejbSessionBeanType[] openejbSessionBeans = openejbJar.getEnterpriseBeans().getSessionArray();
+//        for (int i = 0; i < openejbSessionBeans.length; i++) {
+//            OpenejbSessionBeanType sessionBean = openejbSessionBeans[i];
+//                if (sessionBean.isSetWebServiceAddress()) {
+//                    String location = sessionBean.getWebServiceAddress().trim();
+//                    correctedPortLocations.put(sessionBean.getEjbName(), location);
+//                }
+//        }
+
+        axisBuilder.findWebServices(moduleFile, true, correctedPortLocations, environment,
ejbModule.getSharedContext());
+    }
+
+    public void installModule(JarFile earFile, EARContext earContext, Module module, Collection
configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws
DeploymentException {
+    }
+
+    public void initContext(EARContext earContext, Module module, ClassLoader cl) throws
DeploymentException {
+    }
+
+    public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection
repository) throws DeploymentException {
+
+        if (module.getType() != ConfigurationModuleType.EJB) {
+            return;
+        }
+
+
+        EjbModule ejbModule = (EjbModule) module;
+
+        for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {
+            if (bean.type != EnterpriseBeanInfo.STATELESS) continue;
+            String ejbName = bean.ejbName;
+
+            AbstractName sessionName = earContext.getNaming().createChildName(module.getModuleName(),
ejbName, NameFactory.STATELESS_SESSION_BEAN);
+
+            assert sessionName != null: "StatelesSessionBean object name is null";
+
+            AbstractName ejbWebServiceName = earContext.getNaming().createChildName(sessionName,
ejbName, NameFactory.WEB_SERVICE_LINK);
+
+            GBeanData ejbWebServiceGBean = new GBeanData(ejbWebServiceName, EjbWebServiceGBean.GBEAN_INFO);
+
+            axisBuilder.configureEJB(ejbWebServiceGBean, ejbName, ejbModule.getModuleFile(),
ejbModule.getSharedContext(), cl);
+
+            ejbWebServiceGBean.setReferencePattern("EjbDeployment", sessionName);
+
+            //configure the security part and references
+//            OpenejbWebServiceSecurityType webServiceSecurity = openejbSessionBean == null
? null : openejbSessionBean.getWebServiceSecurity();
+//            if (webServiceSecurity != null) {
+//                ejbWebServiceGBean.setAttribute("securityRealmName", webServiceSecurity.getSecurityRealmName().trim());
+//                ejbWebServiceGBean.setAttribute("realmName", webServiceSecurity.isSetRealmName()
? webServiceSecurity.getRealmName().trim() : XmlBeansSessionBuilder.DEFAULT_AUTH_REALM_NAME);
+//                ejbWebServiceGBean.setAttribute("transportGuarantee", webServiceSecurity.getTransportGuarantee().toString());
+//                ejbWebServiceGBean.setAttribute("authMethod", webServiceSecurity.getAuthMethod().toString());
+//            }
+//            if (openejbSessionBean != null) {
+//                String[] virtualHosts = openejbSessionBean.getWebServiceVirtualHostArray();
+//                for (int i = 0; i < virtualHosts.length; i++) {
+//                    virtualHosts[i] = virtualHosts[i].trim();
+//                }
+//                ejbWebServiceGBean.setAttribute("virtualHosts", virtualHosts);
+//            }
+
+            try {
+                earContext.addGBean(ejbWebServiceGBean);
+            } catch (GBeanAlreadyExistsException e) {
+                throw new DeploymentException("Could not add axis ejb web service gbean to
context", e);
+            }
+        }
+    }
+
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AxisModuleBuilderExtension.class,
NameFactory.MODULE_BUILDER);
+        infoBuilder.addInterface(ModuleBuilderExtension.class);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+
+        infoBuilder.setConstructor(new String[]{"defaultEnvironment"});
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

Modified: geronimo/server/trunk/modules/geronimo-axis/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/pom.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-axis/pom.xml Fri Feb  9 19:52:38 2007
@@ -60,6 +60,17 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openejb</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openejb</groupId>
+            <artifactId>openejb-axis</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-ejb_3.0_spec</artifactId>
         </dependency>

Added: geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/EjbWebServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/EjbWebServiceGBean.java?view=auto&rev=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/EjbWebServiceGBean.java
(added)
+++ geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/EjbWebServiceGBean.java
Fri Feb  9 19:52:38 2007
@@ -0,0 +1,129 @@
+/**
+ * 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.axis.server;
+
+import org.apache.axis.description.JavaServiceDesc;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.providers.java.RPCProvider;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.openejb.EjbDeployment;
+import org.apache.geronimo.webservices.SoapHandler;
+import org.apache.openejb.server.axis.EjbContainerProvider;
+
+import java.net.URI;
+
+public class EjbWebServiceGBean implements GBeanLifecycle {
+
+    private final SoapHandler soapHandler;
+    private final URI location;
+
+    protected EjbWebServiceGBean() {
+        soapHandler = null;
+        location = null;
+    }
+
+    public EjbWebServiceGBean(EjbDeployment ejbDeploymentContext,
+                              URI location,
+                              URI wsdlURI,
+                              SoapHandler soapHandler,
+                              ServiceInfo serviceInfo,
+                              String securityRealmName,
+                              String realmName,
+                              String transportGuarantee,
+                              String authMethod,
+                              String[] virtualHosts) throws Exception {
+
+        this.soapHandler = soapHandler;
+        this.location = location;
+        //for use as a template
+        if (ejbDeploymentContext == null) {
+            return;
+        }
+        RPCProvider provider = new EjbContainerProvider(ejbDeploymentContext.getDeploymentInfo());
+        SOAPService service = new SOAPService(null, provider, null);
+
+        JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
+        service.setServiceDescription(serviceDesc);
+        Class serviceEndpointInterface = ejbDeploymentContext.getServiceEndpointInterface();
+
+        service.setOption("className", serviceEndpointInterface.getName());
+        serviceDesc.setImplClass(serviceEndpointInterface);
+
+        ClassLoader classLoader = ejbDeploymentContext.getClassLoader();
+        AxisWebServiceContainer axisContainer = new AxisWebServiceContainer(location, wsdlURI,
service, serviceInfo.getWsdlMap(), classLoader);
+        if (soapHandler != null) {
+            soapHandler.addWebService(location.getPath(), virtualHosts, axisContainer, securityRealmName,
realmName, transportGuarantee, authMethod, classLoader);
+        }
+    }
+
+    public void doStart() throws Exception {
+
+    }
+
+    public void doStop() throws Exception {
+        if (soapHandler != null) {
+            soapHandler.removeWebService(location.getPath());
+        }
+    }
+
+    public void doFail() {
+
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(EjbWebServiceGBean.class,
EjbWebServiceGBean.class, NameFactory.WEB_SERVICE_LINK);
+
+//        infoFactory.addOperation("invoke", new Class[]{WebServiceContainer.Request.class,
WebServiceContainer.Response.class});
+
+        infoFactory.addReference("EjbDeployment", EjbDeployment.class);
+        infoFactory.addAttribute("location", URI.class, true);
+        infoFactory.addAttribute("wsdlURI", URI.class, true);
+        infoFactory.addAttribute("securityRealmName", String.class, true);
+        infoFactory.addAttribute("realmName", String.class, true);
+        infoFactory.addAttribute("transportGuarantee", String.class, true);
+        infoFactory.addAttribute("authMethod", String.class, true);
+        infoFactory.addAttribute("serviceInfo", ServiceInfo.class, true);
+        infoFactory.addAttribute("virtualHosts", String[].class, true);
+        infoFactory.addReference("WebServiceContainer", SoapHandler.class);
+
+        infoFactory.setConstructor(new String[]{
+                "EjbDeployment",
+                "location",
+                "wsdlURI",
+                "WebServiceContainer",
+                "serviceInfo",
+                "securityRealmName",
+                "realmName",
+                "transportGuarantee",
+                "authMethod",
+                "virtualHosts"
+        });
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+
+}

Modified: geronimo/server/trunk/modules/geronimo-axis/src/main/resources/META-INF/geronimo-dependency.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/src/main/resources/META-INF/geronimo-dependency.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/src/main/resources/META-INF/geronimo-dependency.xml
(original)
+++ geronimo/server/trunk/modules/geronimo-axis/src/main/resources/META-INF/geronimo-dependency.xml
Fri Feb  9 19:52:38 2007
@@ -33,4 +33,12 @@
     <dep:groupId>wsdl4j</dep:groupId>
     <dep:artifactId>wsdl4j</dep:artifactId>
   </dep:dependency>
+  <dep:dependency>
+    <dep:groupId>org.apache.geronimo.modules</dep:groupId>
+    <dep:artifactId>geronimo-openejb</dep:artifactId>
+  </dep:dependency>
+  <dep:dependency>
+    <dep:groupId>org.apache.openejb</dep:groupId>
+    <dep:artifactId>openejb-axis</dep:artifactId>
+  </dep:dependency>
 </dep:service>

Added: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilderExtension.java?view=auto&rev=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilderExtension.java
(added)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilderExtension.java
Fri Feb  9 19:52:38 2007
@@ -0,0 +1,46 @@
+/**
+ * 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.j2ee.deployment;
+
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.gbean.AbstractName;
+
+import java.io.File;
+import java.util.jar.JarFile;
+import java.util.Collection;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ModuleBuilderExtension {
+
+    void createModule(Module module, File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder
idBuilder) throws DeploymentException;
+
+    void createModule(Module module, Object plan, JarFile moduleFile, String targetPath,
URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming
naming, ModuleIDBuilder idBuilder) throws DeploymentException;
+
+    void installModule(JarFile earFile, EARContext earContext, Module module, Collection
configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws
DeploymentException;
+
+    void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
+
+    void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository)
throws DeploymentException;
+
+}

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Fri Feb  9 19:52:38 2007
@@ -34,6 +34,7 @@
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
@@ -67,6 +68,8 @@
 import org.apache.openejb.jee.oejb2.GeronimoEjbJarType;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.ejb.EntityContext;
 import javax.ejb.SessionContext;
@@ -90,19 +93,21 @@
  * @version $Revision: 479481 $ $Date: 2006-11-26 16:52:20 -0800 (Sun, 26 Nov 2006) $
  */
 public class EjbModuleBuilder implements ModuleBuilder {
+    private static final Log log = LogFactory.getLog(EjbModuleBuilder.class);
+
     private static final String OPENEJBJAR_NAMESPACE = XmlUtil.OPENEJBJAR_QNAME.getNamespaceURI();
 
     private final Environment defaultEnvironment;
-    private final Collection webServiceBuilders;
     private final NamespaceDrivenBuilderCollection securityBuilders;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
     private final NamingBuilder namingBuilder;
     private final ResourceEnvironmentSetter resourceEnvironmentSetter;
     private final OpenEjbSystem openEjbSystem;
+    private final Collection<ModuleBuilderExtension> moduleBuilderExtensions;
 
     public EjbModuleBuilder(Environment defaultEnvironment,
                             OpenEjbSystem openEjbSystem,
-                            Collection webServiceBuilder,
+                            Collection<ModuleBuilderExtension> moduleBuilderExtensions,
                             Collection securityBuilders,
                             Collection serviceBuilders,
                             NamingBuilder namingBuilders,
@@ -110,11 +115,15 @@
 
         this.openEjbSystem = openEjbSystem;
         this.defaultEnvironment = defaultEnvironment;
-        this.webServiceBuilders = webServiceBuilder;
         this.securityBuilders = new NamespaceDrivenBuilderCollection(securityBuilders, GerSecurityDocument.type.getDocumentElementName());
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders, GBeanBuilder.SERVICE_QNAME);
         this.namingBuilder = namingBuilders;
         this.resourceEnvironmentSetter = resourceEnvironmentSetter;
+
+        if (moduleBuilderExtensions == null){
+            moduleBuilderExtensions = Collections.EMPTY_LIST;
+        }
+        this.moduleBuilderExtensions = moduleBuilderExtensions;
     }
 
     public String getSchemaNamespace() {
@@ -175,6 +184,10 @@
             XmlCursor xmlCursor = unknownXmlObject.newCursor();
             //
             QName qname = xmlCursor.getName();
+            if (qname == null){
+                xmlCursor.toFirstChild();
+                qname = xmlCursor.getName();
+            }
             if (qname.getLocalPart().equals("openejb-jar")){
                 ejbModule.getAltDDs().put("openejb-jar.xml", xmlCursor.xmlText());
             } else if (qname.getLocalPart().equals("ejb-jar") && qname.getNamespaceURI().equals("http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0")){
@@ -217,23 +230,7 @@
             namingBuilder.buildEnvironment(null, null, environment);
         }
 
-        // overridden web service locations
-        Map correctedPortLocations = new HashMap();
-
-        // todo Webservices not supported yet
-//        OpenejbSessionBeanType[] openejbSessionBeans = openejbJar.getEnterpriseBeans().getSessionArray();
-//        for (int i = 0; i < openejbSessionBeans.length; i++) {
-//            OpenejbSessionBeanType sessionBean = openejbSessionBeans[i];
-//                if (sessionBean.isSetWebServiceAddress()) {
-//                    String location = sessionBean.getWebServiceAddress().trim();
-//                    correctedPortLocations.put(sessionBean.getEjbName(), location);
-//                }
-//        }
         Map sharedContext = new HashMap();
-        for (Iterator iterator = webServiceBuilders.iterator(); iterator.hasNext();) {
-            WebServiceBuilder serviceBuilder = (WebServiceBuilder) iterator.next();
-            serviceBuilder.findWebServices(moduleFile, true, correctedPortLocations, environment,
sharedContext);
-        }
 
         AbstractName moduleName;
         if (earName == null) {
@@ -243,7 +240,17 @@
             moduleName = naming.createChildName(earName, targetPath, NameFactory.EJB_MODULE);
         }
 
-        return new EjbModule(ejbModule, standAlone, moduleName, environment, moduleFile,
targetPath, "", sharedContext);
+        EjbModule module = new EjbModule(ejbModule, standAlone, moduleName, environment,
moduleFile, targetPath, "", sharedContext);
+
+        for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
+            try {
+                builder.createModule(module, plan, moduleFile, targetPath, specDDUrl, earEnvironment,
null, earName, naming, idBuilder);
+            } catch (Throwable t) {
+                String builderName = builder.getClass().getSimpleName();
+                log.error(builderName+".createModule() failed: "+t.getMessage(), t);
+            }
+        }
+        return module;
     }
 
     protected static void unmapReferences(EjbJar ejbJar) {
@@ -290,6 +297,14 @@
 
     public void installModule(JarFile earFile, EARContext earContext, Module module, Collection
configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws
DeploymentException {
         installModule(module, earContext);
+        for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
+            try {
+                builder.installModule(earFile, earContext, module, configurationStores, targetConfigurationStore,
repository);
+            } catch (Throwable t) {
+                String builderName = builder.getClass().getSimpleName();
+                log.error(builderName+".installModule() failed: "+t.getMessage(), t);
+            }
+        }
     }
 
     private void installModule(Module module, EARContext earContext) throws DeploymentException
{
@@ -388,6 +403,15 @@
 
         // Add extra gbean declared in the geronimo-openejb.xml file
         serviceBuilders.build(geronimoOpenejb, earContext, ejbModule.getEarContext());
+
+        for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
+            try {
+                builder.initContext(earContext, module, classLoader);
+            } catch (Throwable t) {
+                String builderName = builder.getClass().getSimpleName();
+                log.error(builderName+".initContext() failed: "+t.getMessage(), t);
+            }
+        }
     }
 
     private void addGeronimmoOpenEJBPersistenceUnit(EjbModule ejbModule, GeronimoEjbJarType
geronimoEjbJarType) {
@@ -472,6 +496,15 @@
         // add the Jacc permissions to the ear
         ComponentPermissions componentPermissions = ejbDeploymentBuilder.buildComponentPermissions();
         earContext.addSecurityContext(ejbModule.getEjbJarInfo().moduleId, componentPermissions);
+
+        for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
+            try {
+                builder.addGBeans(earContext, module, cl, repositories);
+            } catch (Throwable t) {
+                String builderName = builder.getClass().getSimpleName();
+                log.error(builderName+".addGBeans() failed: "+t.getMessage(), t);
+            }
+        }
     }
 
     public static class EarData {
@@ -489,7 +522,7 @@
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EjbModuleBuilder.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true);
         infoBuilder.addReference("OpenEjbSystem", OpenEjbSystem.class);
-        infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ModuleBuilderExtensions", ModuleBuilderExtension.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
@@ -498,7 +531,7 @@
         infoBuilder.setConstructor(new String[]{
                 "defaultEnvironment",
                 "OpenEjbSystem",
-                "WebServiceBuilder",
+                "ModuleBuilderExtensions",
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "NamingBuilders",

Modified: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
Fri Feb  9 19:52:38 2007
@@ -229,6 +229,10 @@
         return deploymentInfo.getMdbInterface();
     }
 
+    public Class getServiceEndpointInterface() {
+        return deploymentInfo.getServiceEndpointInterface();
+    }
+
     public BeanType getComponentType() {
         return deploymentInfo.getComponentType();
     }

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?view=diff&rev=505624&r1=505623&r2=505624
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Fri Feb  9 19:52:38 2007
@@ -714,6 +714,12 @@
             </dependency>
 
             <dependency>
+                <groupId>org.apache.openejb</groupId>
+                <artifactId>openejb-axis</artifactId>
+                <version>${openejbVersion}</version>
+            </dependency>
+
+            <dependency>
                 <groupId>org.tranql</groupId>
                 <artifactId>tranql</artifactId>
                 <version>1.4.1</version>



Mime
View raw message