geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment GeronimoEjbJarLoader.java GeronimoJ2EELoader.java J2EELoader.java
Date Mon, 29 Sep 2003 14:17:23 GMT
ammulder    2003/09/29 07:17:23

  Modified:    modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb
                        EnterpriseBeans.java Entity.java MessageDriven.java
                        Session.java
               modules/core/src/java/org/apache/geronimo/xml/deployment
                        GeronimoEjbJarLoader.java GeronimoJ2EELoader.java
                        J2EELoader.java
  Log:
   - Make sure that we always load Geronimo objects when we load a DD into
     the XML POJOs.
   - Initialize the EJB superclass arrays to empty Geronimo arrays instead
     of empty J2EE arrays.
  
  Revision  Changes    Path
  1.3       +7 -1      incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/EnterpriseBeans.java
  
  Index: EnterpriseBeans.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/EnterpriseBeans.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EnterpriseBeans.java	17 Sep 2003 01:47:14 -0000	1.2
  +++ EnterpriseBeans.java	29 Sep 2003 14:17:22 -0000	1.3
  @@ -61,6 +61,12 @@
    * @version $Revision$ $Date$
    */
   public class EnterpriseBeans extends org.apache.geronimo.deployment.model.ejb.EnterpriseBeans
{
  +    public EnterpriseBeans() {
  +        super.setEntity(new Entity[0]);
  +        super.setSession(new Session[0]);
  +        super.setMessageDriven(new MessageDriven[0]);
  +    }
  +
       public void setEntity(int i, org.apache.geronimo.deployment.model.ejb.Entity bean)
{
           assert (bean instanceof Entity);
           super.setEntity(i, bean);
  
  
  
  1.4       +11 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/Entity.java
  
  Index: Entity.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/Entity.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Entity.java	27 Sep 2003 01:13:24 -0000	1.3
  +++ Entity.java	29 Sep 2003 14:17:22 -0000	1.4
  @@ -72,6 +72,16 @@
   public class Entity extends org.apache.geronimo.deployment.model.ejb.Entity implements
JNDIEnvironmentRefs {
       private String jndiName;
   
  +    public Entity() {
  +        super.setSecurityRoleRef(new SecurityRoleRef[0]);
  +        super.setEJBRef(new EjbRef[0]);
  +        super.setEJBLocalRef(new EjbLocalRef[0]);
  +        super.setResourceRef(new ResourceRef[0]);
  +        super.setResourceEnvRef(new ResourceEnvRef[0]);
  +        super.setMessageDestinationRef(new MessageDestinationRef[0]);
  +        super.setServiceRef(new ServiceRef[0]);
  +    }
  +
       public String getJndiName() {
           return jndiName;
       }
  
  
  
  1.3       +10 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/MessageDriven.java
  
  Index: MessageDriven.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/MessageDriven.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MessageDriven.java	17 Sep 2003 01:47:14 -0000	1.2
  +++ MessageDriven.java	29 Sep 2003 14:17:22 -0000	1.3
  @@ -69,6 +69,15 @@
    * @version $Revision$ $Date$
    */
   public class MessageDriven extends org.apache.geronimo.deployment.model.ejb.MessageDriven
implements JNDIEnvironmentRefs {
  +    public MessageDriven() {
  +        super.setEJBRef(new EjbRef[0]);
  +        super.setEJBLocalRef(new EjbLocalRef[0]);
  +        super.setResourceRef(new ResourceRef[0]);
  +        super.setResourceEnvRef(new ResourceEnvRef[0]);
  +        super.setMessageDestinationRef(new MessageDestinationRef[0]);
  +        super.setServiceRef(new ServiceRef[0]);
  +    }
  +
       public void setEJBLocalRef(org.apache.geronimo.deployment.model.j2ee.EJBLocalRef[]
ejbRef) {
           assert (ejbRef instanceof EjbLocalRef[]);
           super.setEJBLocalRef(ejbRef);
  
  
  
  1.4       +11 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/Session.java
  
  Index: Session.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/model/geronimo/ejb/Session.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Session.java	27 Sep 2003 01:13:24 -0000	1.3
  +++ Session.java	29 Sep 2003 14:17:22 -0000	1.4
  @@ -72,6 +72,16 @@
   public class Session extends org.apache.geronimo.deployment.model.ejb.Session implements
JNDIEnvironmentRefs {
       private String jndiName;
   
  +    public Session() {
  +        super.setSecurityRoleRef(new SecurityRoleRef[0]);
  +        super.setEJBRef(new EjbRef[0]);
  +        super.setEJBLocalRef(new EjbLocalRef[0]);
  +        super.setResourceRef(new ResourceRef[0]);
  +        super.setResourceEnvRef(new ResourceEnvRef[0]);
  +        super.setMessageDestinationRef(new MessageDestinationRef[0]);
  +        super.setServiceRef(new ServiceRef[0]);
  +    }
  +
       public String getJndiName() {
           return jndiName;
       }
  
  
  
  1.4       +4 -4      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GeronimoEjbJarLoader.java	17 Sep 2003 01:47:14 -0000	1.3
  +++ GeronimoEjbJarLoader.java	29 Sep 2003 14:17:23 -0000	1.4
  @@ -108,7 +108,7 @@
               Element root = roots[i];
               sessions[i] = new Session();
               loadEjb(root, sessions[i]);
  -            sessions[i].setSecurityRoleRef(J2EELoader.loadSecurityRoleRefs(root));
  +            sessions[i].setSecurityRoleRef(GeronimoJ2EELoader.loadSecurityRoleRefs(root));
               sessions[i].setJndiName(LoaderUtil.getChildContent(root, "jndi-name"));
           }
           return sessions;
  @@ -121,7 +121,7 @@
               Element root = roots[i];
               entities[i] = new Entity();
               loadEjb(root, entities[i]);
  -            entities[i].setSecurityRoleRef(J2EELoader.loadSecurityRoleRefs(root));
  +            entities[i].setSecurityRoleRef(GeronimoJ2EELoader.loadSecurityRoleRefs(root));
               entities[i].setJndiName(LoaderUtil.getChildContent(root, "jndi-name"));
           }
           return entities;
  @@ -136,6 +136,6 @@
           bean.setResourceEnvRef(GeronimoJ2EELoader.loadResourceEnvRefs(root));
           bean.setMessageDestinationRef(GeronimoJ2EELoader.loadMessageDestinationRefs(root));
           bean.setEnvEntry(J2EELoader.loadEnvEntries(root));
  -        bean.setServiceRef(J2EELoader.loadServiceRefs(root));
  +        bean.setServiceRef(GeronimoJ2EELoader.loadServiceRefs(root));
       }
   }
  
  
  
  1.5       +16 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GeronimoJ2EELoader.java	17 Sep 2003 01:47:14 -0000	1.4
  +++ GeronimoJ2EELoader.java	29 Sep 2003 14:17:23 -0000	1.5
  @@ -63,6 +63,7 @@
   import org.apache.geronimo.deployment.model.geronimo.j2ee.ServiceRef;
   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.w3c.dom.Element;
   
   /**
  @@ -143,6 +144,20 @@
       public static ServiceRef loadServiceRef(Element e, ServiceRef serviceRef) {
           J2EELoader.loadServiceRef(e, serviceRef);
           return serviceRef;
  +    }
  +
  +    public static SecurityRoleRef[] loadSecurityRoleRefs(Element e) {
  +        Element[] nodes = LoaderUtil.getChildren(e, "security-role-ref");
  +        SecurityRoleRef[] result = new SecurityRoleRef[nodes.length];
  +        for(int i = 0; i < nodes.length; i++) {
  +            result[i] = loadSecurityRoleRef(nodes[i], new SecurityRoleRef());
  +        }
  +        return result;
  +    }
  +
  +    public static SecurityRoleRef loadSecurityRoleRef(Element e, SecurityRoleRef ref) {
  +        J2EELoader.loadSecurityRoleRef(e, ref);
  +        return ref;
       }
   
       public static MessageDestinationRef[] loadMessageDestinationRefs(Element e) {
  
  
  
  1.7       +9 -6      incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/J2EELoader.java
  
  Index: J2EELoader.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/J2EELoader.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- J2EELoader.java	27 Sep 2003 16:52:06 -0000	1.6
  +++ J2EELoader.java	29 Sep 2003 14:17:23 -0000	1.7
  @@ -146,13 +146,16 @@
           Element[] roots = LoaderUtil.getChildren(parent, "security-role-ref");
           SecurityRoleRef[] refs = new SecurityRoleRef[roots.length];
           for(int i = 0; i < roots.length; i++) {
  -            Element root = roots[i];
  -            refs[i] = new SecurityRoleRef();
  -            loadDescribable(root, refs[i]);
  -            refs[i].setRoleName(LoaderUtil.getChildContent(root, "role-name"));
  -            refs[i].setRoleLink(LoaderUtil.getChildContent(root, "role-link"));
  +            refs[i] = loadSecurityRoleRef(roots[i], new SecurityRoleRef());
           }
           return refs;
  +    }
  +
  +    public static SecurityRoleRef loadSecurityRoleRef(Element root, SecurityRoleRef ref)
{
  +        loadDescribable(root, ref);
  +        ref.setRoleName(LoaderUtil.getChildContent(root, "role-name"));
  +        ref.setRoleLink(LoaderUtil.getChildContent(root, "role-link"));
  +        return ref;
       }
   
       public static SecurityRole[] loadSecurityRoles(Element parent) {
  
  
  

Mime
View raw message