geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task DeployGeronimoMBean.java
Date Mon, 17 Nov 2003 02:03:17 GMT
djencks     2003/11/16 18:03:17

  Modified:    modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb
                        EjbJar.java
               modules/core/src/java/org/apache/geronimo/xml/deployment
                        GeronimoEjbJarLoader.java GeronimoEjbJarStorer.java
                        GeronimoJ2EELoader.java
               modules/core/src/schema geronimo-common.xsd
                        geronimo-ejb-jar.xsd
               modules/core/src/test/org/apache/geronimo/xml/deployment
                        GeronimoEjbJarLoaderTest.java
               modules/core/src/test-data/xml/deployment
                        simple-geronimo-ejb-jar.xml
               modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task
                        DeployGeronimoMBean.java
  Added:       modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/j2ee
                        ClassSpace.java
  Log:
  added classspace, datasource, and module name elements
  
  Revision  Changes    Path
  1.1                  incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/j2ee/ClassSpace.java
  
  Index: ClassSpace.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo.deployment.model.geronimo.j2ee;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2003/11/17 02:03:16 $
   *
   * */
  public class ClassSpace {
  
      private String classSpace;
      private String parentClassSpace;
  
      public String getParentClassSpace() {
          return parentClassSpace;
      }
  
      public void setParentClassSpace(String parentClassSpace) {
          this.parentClassSpace = parentClassSpace;
      }
  
      public String getClassSpace() {
          return classSpace;
      }
  
      public void setClassSpace(String classSpace) {
          this.classSpace = classSpace;
      }
  
  }
  
  
  
  1.3       +34 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/EjbJar.java
  
  Index: EjbJar.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/EjbJar.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EjbJar.java	17 Sep 2003 01:47:14 -0000	1.2
  +++ EjbJar.java	17 Nov 2003 02:03:16 -0000	1.3
  @@ -55,12 +55,19 @@
    */
   package org.apache.geronimo.deployment.model.geronimo.ejb;
   
  +import org.apache.geronimo.deployment.model.geronimo.j2ee.ClassSpace;
  +
   /**
    * JavaBean for the geronimo-ejb-jar.xml tag ejb-jar
    *
    * @version $Revision$ $Date$
    */
   public class EjbJar extends org.apache.geronimo.deployment.model.ejb.EjbJar {
  +
  +    private ClassSpace classSpace;
  +    private String moduleName;
  +    private String datasourceName;
  +
       public void setEnterpriseBeans(org.apache.geronimo.deployment.model.ejb.EnterpriseBeans
beans) {
           assert (beans instanceof EnterpriseBeans);
           super.setEnterpriseBeans(beans);
  @@ -73,4 +80,30 @@
       public void setGeronimoEnterpriseBeans(EnterpriseBeans beans) {
           super.setEnterpriseBeans(beans);
       }
  +
  +    public ClassSpace getClassSpace() {
  +        return classSpace;
  +    }
  +
  +    public void setClassSpace(ClassSpace classSpace) {
  +        this.classSpace = classSpace;
  +    }
  +
  +    public String getModuleName() {
  +        return moduleName;
  +    }
  +
  +    public void setModuleName(String moduleName) {
  +        this.moduleName = moduleName;
  +    }
  +
  +    public String getDatasourceName() {
  +        return datasourceName;
  +    }
  +
  +    public void setDatasourceName(String datasourceName) {
  +        this.datasourceName = datasourceName;
  +    }
  +
  +
   }
  
  
  
  1.6       +7 -1      incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/GeronimoEjbJarLoader.java
  
  Index: GeronimoEjbJarLoader.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/GeronimoEjbJarLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GeronimoEjbJarLoader.java	29 Sep 2003 16:00:13 -0000	1.5
  +++ GeronimoEjbJarLoader.java	17 Nov 2003 02:03:16 -0000	1.6
  @@ -80,7 +80,13 @@
           }
           EjbJar jar = new EjbJar();
           jar.setVersion(root.getAttribute("version"));
  +        jar.setClassSpace(GeronimoJ2EELoader.loadClassSpace(root));
           J2EELoader.loadDisplayable(root, jar);
  +        jar.setModuleName(LoaderUtil.getChildContent(root, "module-name"));
  +        String datasourceName = LoaderUtil.getChildContent(root, "datasource-name");
  +        if (datasourceName != null && datasourceName.length() >0) {
  +            jar.setDatasourceName(datasourceName);
  +        }
           Element ebe = LoaderUtil.getChild(root, "enterprise-beans");
           if(ebe != null) {
               EnterpriseBeans eb = new EnterpriseBeans();
  
  
  
  1.2       +8 -1      incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/GeronimoEjbJarStorer.java
  
  Index: GeronimoEjbJarStorer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/GeronimoEjbJarStorer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GeronimoEjbJarStorer.java	1 Oct 2003 19:03:40 -0000	1.1
  +++ GeronimoEjbJarStorer.java	17 Nov 2003 02:03:16 -0000	1.2
  @@ -85,7 +85,14 @@
               root.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation",
"http://java.sun.com/xml/ns/j2ee http://geronimo.apache.org/xml/schema/1.0/j2ee14/geronimo-ejb-jar.xsd");
               root.setAttribute("version", jar.getVersion());
               doc.appendChild(root);
  +            Element cs = StorerUtil.createChild(root, "class-space");
  +            cs.setAttribute("name", jar.getClassSpace().getClassSpace());
  +            cs.setAttribute("parent", jar.getClassSpace().getParentClassSpace());
               J2EEStorer.storeDisplayable(root, jar);
  +            StorerUtil.createChildText(root, "module-name", jar.getModuleName());
  +            if (jar.getDatasourceName() != null) {
  +                StorerUtil.createChildText(root, "datasource-name", jar.getDatasourceName());
  +            }
               if(jar.getEnterpriseBeans() != null && jar.getEnterpriseBeans().hasBeans())
{
                   storeEjbs(StorerUtil.createChild(root, "enterprise-beans"), jar.getGeronimoEnterpriseBeans());
               }
  
  
  
  1.6       +10 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/GeronimoJ2EELoader.java
  
  Index: GeronimoJ2EELoader.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/GeronimoJ2EELoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GeronimoJ2EELoader.java	29 Sep 2003 14:17:23 -0000	1.5
  +++ GeronimoJ2EELoader.java	17 Nov 2003 02:03:16 -0000	1.6
  @@ -64,6 +64,7 @@
   import org.apache.geronimo.deployment.model.geronimo.j2ee.MessageDestinationRef;
   import org.apache.geronimo.deployment.model.geronimo.j2ee.MessageDestination;
   import org.apache.geronimo.deployment.model.geronimo.j2ee.SecurityRoleRef;
  +import org.apache.geronimo.deployment.model.geronimo.j2ee.ClassSpace;
   import org.w3c.dom.Element;
   
   /**
  @@ -188,5 +189,13 @@
           J2EELoader.loadMessageDestination(e, messageDestination);
           messageDestination.setJndiName(LoaderUtil.getChildContent(e, "jndi-name"));
           return messageDestination;
  +    }
  +
  +    public static ClassSpace loadClassSpace(Element e) {
  +        Element cs = LoaderUtil.getChild(e, "class-space");
  +        ClassSpace classSpace = new ClassSpace();
  +        classSpace.setClassSpace(LoaderUtil.getAttribute(cs, "name"));
  +        classSpace.setParentClassSpace((LoaderUtil.getAttribute(cs, "parent")));
  +        return classSpace;
       }
   }
  
  
  
  1.3       +15 -11    incubator-geronimo/modules/core/src/schema/geronimo-common.xsd
  
  Index: geronimo-common.xsd
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/schema/geronimo-common.xsd,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- geronimo-common.xsd	1 Oct 2003 19:00:31 -0000	1.2
  +++ geronimo-common.xsd	17 Nov 2003 02:03:16 -0000	1.3
  @@ -1,16 +1,20 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <xsd:schema targetNamespace="http://geronimo.apache.org/xml/schema/j2ee" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" elementFormDefault="qualified" attributeFormDefault="unqualified">
  -  <xsd:annotation>
  -    <xsd:documentation>Schema defining common elements for Geronimo-specific deployment
descriptors</xsd:documentation>
  -  </xsd:annotation>
  -  <xsd:import namespace="http://java.sun.com/xml/ns/j2ee" schemaLocation="j2ee_1_4.xsd"/>
  -  <xsd:group name="jndi-refGroup">
       <xsd:annotation>
  -      <xsd:documentation>Group defining entries for a reference to another JNDI entry.</xsd:documentation>
  +        <xsd:documentation>Schema defining common elements for Geronimo-specific
deployment descriptors</xsd:documentation>
       </xsd:annotation>
  -    <xsd:sequence>
  -      <xsd:element name="jndi-name" type="j2ee:jndi-nameType"/>
  -      <xsd:element name="context-param" type="j2ee:param-valueType" minOccurs="0" maxOccurs="unbounded"/>
  -    </xsd:sequence>
  -  </xsd:group>
  +    <xsd:import namespace="http://java.sun.com/xml/ns/j2ee" schemaLocation="j2ee_1_4.xsd"/>
  +    <xsd:group name="jndi-refGroup">
  +        <xsd:annotation>
  +            <xsd:documentation>Group defining entries for a reference to another
JNDI entry.</xsd:documentation>
  +        </xsd:annotation>
  +        <xsd:sequence>
  +            <xsd:element name="jndi-name" type="j2ee:jndi-nameType"/>
  +            <xsd:element name="context-param" type="j2ee:param-valueType" minOccurs="0"
maxOccurs="unbounded"/>
  +        </xsd:sequence>
  +    </xsd:group>
  +    <xsd:complexType name="class-spaceType">
  +        <xsd:attribute name="name" type="xs:string"/>
  +        <xsd:attribute name="parent" type="xs:string"/>
  +    </xsd:complexType>
   </xsd:schema>
  
  
  
  1.6       +27 -0     incubator-geronimo/modules/core/src/schema/geronimo-ejb-jar.xsd
  
  Index: geronimo-ejb-jar.xsd
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/schema/geronimo-ejb-jar.xsd,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- geronimo-ejb-jar.xsd	12 Sep 2003 07:50:53 -0000	1.5
  +++ geronimo-ejb-jar.xsd	17 Nov 2003 02:03:16 -0000	1.6
  @@ -89,7 +89,10 @@
     </xsd:complexType>
     <xsd:complexType name="ejb-jarType">
       <xsd:sequence>
  +      <xsd:element name="class-space" type="ger:class-spaceType"/>
         <xsd:group ref="j2ee:descriptionGroup"/>
  +      <xsd:element name="module-name" type="j2ee:string" minOccurs="0"/>
  +      <xsd:element name="datasource-name" type="j2ee:string"/>
         <xsd:element name="enterprise-beans" type="j2ee:enterprise-beansType"/>
         <xsd:element name="relationships" type="j2ee:relationshipsType" minOccurs="0">
           <xsd:unique name="relationship-name-uniqueness">
  @@ -234,6 +237,8 @@
         <xsd:element name="jndi-name" type="xsd:string" minOccurs="0">
           <xsd:annotation>
             <xsd:documentation>
  +            Actually, ejbs are located by the module name and ejb name.
  +
               The JNDI name controls where this EJB will appear in the application-wide JNDI
               space.  Other application components that want to refer to this EJB can define
               EJB references and map them to this JNDI location.
  @@ -344,9 +349,31 @@
         <xsd:element name="query-method" type="j2ee:query-methodType"/>
         <xsd:element name="result-type-mapping" type="j2ee:result-type-mappingType" minOccurs="0"/>
         <xsd:element name="ejb-ql" type="j2ee:xsdStringType"/>
  +        <xsd:element name="sql" type="j2ee:xsdStringType"/>
  +        <xsd:element name="input-binding" type="ger:input-bindingType" minOccurs="0"
maxOccurs="unbounded"/>
  +        <xsd:element name="output-binding" type="ger:output-bindingType"
       </xsd:sequence>
       <xsd:attribute name="id" type="xsd:ID"/>
     </xsd:complexType>
  +    <query>
  +      <query-method>
  +        <method-name>findAllCustomers</method-name>
  +    <method-params>
  +      <method-param>java.lang.Integer</method-param>
  +      <method-param>java.lang.String</method-param>
  +    </method-params>
  +      </query-method>
  +      <ejb-ql>Select OBJECT(a) From Customer a</ejb-ql>
  +      <ger:sql>SELECT ID FROM CUSTOMER</ger:sql>
  +      <ger:input-binding>
  +         <ger:binding type="o.o.n.persistence.jdbc.IntBinding" param="1"/>
  +         <ger:binding type="o.o.n.persistence.jdbc.StringBinding" param="2"/>
  +      </ger:input-binding>
  +      <ger:output-binding>
  +         <ger:abstract-schema-name>Customer</ger:abstract-schema-name>
  +         <ger:binding type="o.o.n.persistence.jdbc.StringBinding" param="1"/>
  +      </ger:output-binding>
  +    </query>
     <xsd:complexType name="relationship-role-sourceType">
       <xsd:sequence>
         <xsd:element name="description" type="j2ee:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
  
  
  
  1.4       +7 -1      incubator-geronimo/modules/core/src/test/org/apache/geronimo/xml/deployment/GeronimoEjbJarLoaderTest.java
  
  Index: GeronimoEjbJarLoaderTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/test/org/apache/geronimo/xml/deployment/GeronimoEjbJarLoaderTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GeronimoEjbJarLoaderTest.java	1 Oct 2003 19:03:40 -0000	1.3
  +++ GeronimoEjbJarLoaderTest.java	17 Nov 2003 02:03:16 -0000	1.4
  @@ -66,6 +66,7 @@
   import org.apache.geronimo.deployment.model.geronimo.ejb.Session;
   import org.apache.geronimo.deployment.model.geronimo.j2ee.ResourceEnvRef;
   import org.apache.geronimo.deployment.model.geronimo.j2ee.EjbRef;
  +import org.apache.geronimo.deployment.model.geronimo.j2ee.ClassSpace;
   import org.apache.geronimo.deployment.model.j2ee.EnvEntry;
   
   /**
  @@ -87,6 +88,11 @@
       static void checkGeronimoJar(GeronimoEjbJarDocument doc) {
           EjbJar jar = doc.getEjbJar();
           EjbJarLoaderTest.checkEjbJar(jar, "OverrideExample");
  +        ClassSpace classSpace = jar.getClassSpace();
  +        assertEquals("geronimo.system:role=ClassSpace,name=System", classSpace.getParentClassSpace());
  +        assertEquals("geronimo.system:role=ClassSpace,name=Test", classSpace.getClassSpace());
  +        assertEquals("TestEJBModule", jar.getModuleName());
  +        assertEquals("DefaultDS", jar.getDatasourceName());
           EnterpriseBeans beans = jar.getGeronimoEnterpriseBeans();
           Session[] session = beans.getGeronimoSession();
           assertEquals(2, session.length);
  
  
  
  1.2       +3 -0      incubator-geronimo/modules/core/src/test-data/xml/deployment/simple-geronimo-ejb-jar.xml
  
  Index: simple-geronimo-ejb-jar.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/test-data/xml/deployment/simple-geronimo-ejb-jar.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- simple-geronimo-ejb-jar.xml	29 Sep 2003 16:00:49 -0000	1.1
  +++ simple-geronimo-ejb-jar.xml	17 Nov 2003 02:03:16 -0000	1.2
  @@ -5,8 +5,11 @@
            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
            http://geronimo.apache.org/xml/schema/1.0/j2ee14/geronimo-ejb-jar.xsd"
            version="2.1">
  +    <class-space name="geronimo.system:role=ClassSpace,name=Test" parent="geronimo.system:role=ClassSpace,name=System"/>
       <description>This is a test EJB JAR DD for JSR-88 purposes</description>
       <display-name>Test EJB JAR</display-name>
  +    <module-name>TestEJBModule</module-name>
  +    <datasource-name>DefaultDS</datasource-name>
       <enterprise-beans>
           <session>
               <description>This is a sample stateless session bean</description>
  
  
  
  1.7       +3 -3      incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task/DeployGeronimoMBean.java
  
  Index: DeployGeronimoMBean.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/deployment/task/DeployGeronimoMBean.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DeployGeronimoMBean.java	16 Nov 2003 00:48:37 -0000	1.6
  +++ DeployGeronimoMBean.java	17 Nov 2003 02:03:17 -0000	1.7
  @@ -86,8 +86,8 @@
    */
   public class DeployGeronimoMBean implements DeploymentTask {
       private static final Log log = LogFactory.getLog(DeployGeronimoMBean.class);
  -    private final MBeanServer server;
  -    private final MBeanMetadata metadata;
  +    protected final MBeanServer server;
  +    protected final MBeanMetadata metadata;
       private boolean registered;
   
       public DeployGeronimoMBean(MBeanServer server, MBeanMetadata mbeanMetadata) {
  
  
  

Mime
View raw message