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 EjbJarLoader.java GeronimoEjbJarLoader.java
Date Mon, 29 Sep 2003 16:00:13 GMT
ammulder    2003/09/29 09:00:13

  Modified:    modules/core/src/java/org/apache/geronimo/xml/deployment
                        EjbJarLoader.java GeronimoEjbJarLoader.java
  Log:
  Do a better job of loading all the standard tags into the Geronimo
  EJB POJO hierarchy
  
  Revision  Changes    Path
  1.8       +14 -10    incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/EjbJarLoader.java
  
  Index: EjbJarLoader.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/EjbJarLoader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EjbJarLoader.java	29 Sep 2003 15:14:19 -0000	1.7
  +++ EjbJarLoader.java	29 Sep 2003 16:00:13 -0000	1.8
  @@ -115,11 +115,7 @@
           Element ade = LoaderUtil.getChild(root, "assembly-descriptor");
           if(ade != null) {
               AssemblyDescriptor ad = new AssemblyDescriptor();
  -            ad.setContainerTransaction(loadContainerTransactions(ade));
  -            ad.setExcludeList(loadExcludeList(LoaderUtil.getChild(ade, "exclude-list")));
  -            ad.setMessageDestination(J2EELoader.loadMessageDestinations(ade));
  -            ad.setMethodPermission(loadMethodPermissions(ade));
  -            ad.setSecurityRole(J2EELoader.loadSecurityRoles(ade));
  +            loadAssemblyDescriptor(ade, ad);
               jar.setAssemblyDescriptor(ad);
           }
           EjbJarDocument result = new EjbJarDocument();
  @@ -127,6 +123,14 @@
           return result;
       }
   
  +    static void loadAssemblyDescriptor(Element root, AssemblyDescriptor ad) {
  +        ad.setContainerTransaction(loadContainerTransactions(root));
  +        ad.setExcludeList(loadExcludeList(LoaderUtil.getChild(root, "exclude-list")));
  +        ad.setMessageDestination(J2EELoader.loadMessageDestinations(root));
  +        ad.setMethodPermission(loadMethodPermissions(root));
  +        ad.setSecurityRole(J2EELoader.loadSecurityRoles(root));
  +    }
  +
       private static ExcludeList loadExcludeList(Element parent) {
           if(parent == null) {
               return null;
  @@ -182,7 +186,7 @@
           return meth;
       }
   
  -    private static EjbRelation[] loadEjbRelations(Element parent) {
  +    static EjbRelation[] loadEjbRelations(Element parent) {
           Element[] roots = LoaderUtil.getChildren(parent, "ejb-relation");
           EjbRelation[] rels = new EjbRelation[roots.length];
           for(int i = 0; i < roots.length; i++) {
  @@ -249,7 +253,7 @@
           return mdbs;
       }
   
  -    private static ActivationConfig loadActivationConfig(Element parent) {
  +    static ActivationConfig loadActivationConfig(Element parent) {
           if(parent == null) {
               return null;
           }
  @@ -300,7 +304,7 @@
           return entities;
       }
   
  -    private static Query[] loadQueries(Element parent) {
  +    static Query[] loadQueries(Element parent) {
           Element[] roots = LoaderUtil.getChildren(parent, "query");
           Query[] queries = new Query[roots.length];
           for(int i = 0; i < roots.length; i++) {
  @@ -322,7 +326,7 @@
           return method;
       }
   
  -    private static CmpField[] loadCmpFields(Element parent) {
  +    static CmpField[] loadCmpFields(Element parent) {
           Element[] roots = LoaderUtil.getChildren(parent, "cmp-field");
           CmpField[] fields = new CmpField[roots.length];
           for(int i = 0; i < roots.length; i++) {
  
  
  
  1.5       +44 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GeronimoEjbJarLoader.java	29 Sep 2003 14:17:23 -0000	1.4
  +++ GeronimoEjbJarLoader.java	29 Sep 2003 16:00:13 -0000	1.5
  @@ -64,6 +64,8 @@
   import org.apache.geronimo.deployment.model.geronimo.ejb.Entity;
   import org.apache.geronimo.deployment.model.geronimo.ejb.Session;
   import org.apache.geronimo.deployment.model.ejb.Ejb;
  +import org.apache.geronimo.deployment.model.ejb.Relationships;
  +import org.apache.geronimo.deployment.model.ejb.AssemblyDescriptor;
   
   /**
    * Loads a Geronimo ejb-jar.xml file into POJOs
  @@ -77,6 +79,8 @@
               throw new IllegalArgumentException("Document is not a Geronimo ejb-jar instance");
           }
           EjbJar jar = new EjbJar();
  +        jar.setVersion(root.getAttribute("version"));
  +        J2EELoader.loadDisplayable(root, jar);
           Element ebe = LoaderUtil.getChild(root, "enterprise-beans");
           if(ebe != null) {
               EnterpriseBeans eb = new EnterpriseBeans();
  @@ -85,6 +89,21 @@
               eb.setEntity(loadEntities(ebe));
               eb.setMessageDriven(loadMessageDrivens(ebe));
           }
  +        //todo: override any Geronimo-specific relationship content
  +        Element re = LoaderUtil.getChild(root, "relationships");
  +        if(re != null) {
  +            Relationships rel = new Relationships();
  +            J2EELoader.loadDescribable(re, rel);
  +            rel.setEjbRelation(EjbJarLoader.loadEjbRelations(re));
  +            jar.setRelationships(rel);
  +        }
  +        //todo: override any Geronimo-specific assembly-descriptor content
  +        Element ade = LoaderUtil.getChild(root, "assembly-descriptor");
  +        if(ade != null) {
  +            AssemblyDescriptor ad = new AssemblyDescriptor();
  +            EjbJarLoader.loadAssemblyDescriptor(ade, ad);
  +            jar.setAssemblyDescriptor(ad);
  +        }
           GeronimoEjbJarDocument result = new GeronimoEjbJarDocument();
           result.setEjbJar(jar);
           return result;
  @@ -97,6 +116,11 @@
               Element root = roots[i];
               mdbs[i] = new MessageDriven();
               loadEjb(root, mdbs[i]);
  +            mdbs[i].setMessageDestinationLink(LoaderUtil.getChildContent(root, "message-destination-link"));
  +            mdbs[i].setMessageDestinationType(LoaderUtil.getChildContent(root, "message-destination-type"));
  +            mdbs[i].setMessagingType(LoaderUtil.getChildContent(root, "messaging-type"));
  +            mdbs[i].setTransactionType(LoaderUtil.getChildContent(root, "transaction-type"));
  +            mdbs[i].setActivationConfig(EjbJarLoader.loadActivationConfig(root));
           }
           return mdbs;
       }
  @@ -108,7 +132,14 @@
               Element root = roots[i];
               sessions[i] = new Session();
               loadEjb(root, sessions[i]);
  +            sessions[i].setHome(LoaderUtil.getChildContent(root, "home"));
  +            sessions[i].setLocal(LoaderUtil.getChildContent(root, "local"));
  +            sessions[i].setLocalHome(LoaderUtil.getChildContent(root, "local-home"));
  +            sessions[i].setRemote(LoaderUtil.getChildContent(root, "remote"));
               sessions[i].setSecurityRoleRef(GeronimoJ2EELoader.loadSecurityRoleRefs(root));
  +            sessions[i].setServiceEndpoint(LoaderUtil.getChildContent(root, "service-endpoint"));
  +            sessions[i].setSessionType(LoaderUtil.getChildContent(root, "session-type"));
  +            sessions[i].setTransactionType(LoaderUtil.getChildContent(root, "transaction-type"));
               sessions[i].setJndiName(LoaderUtil.getChildContent(root, "jndi-name"));
           }
           return sessions;
  @@ -121,7 +152,19 @@
               Element root = roots[i];
               entities[i] = new Entity();
               loadEjb(root, entities[i]);
  +            entities[i].setHome(LoaderUtil.getChildContent(root, "home"));
  +            entities[i].setLocal(LoaderUtil.getChildContent(root, "local"));
  +            entities[i].setLocalHome(LoaderUtil.getChildContent(root, "local-home"));
  +            entities[i].setRemote(LoaderUtil.getChildContent(root, "remote"));
               entities[i].setSecurityRoleRef(GeronimoJ2EELoader.loadSecurityRoleRefs(root));
  +            entities[i].setPersistenceType(LoaderUtil.getChildContent(root, "persistence-type"));
  +            entities[i].setPrimKeyClass(LoaderUtil.getChildContent(root, "prim-key-class"));
  +            entities[i].setReentrant(LoaderUtil.getChildContent(root, "reentrant"));
  +            entities[i].setCmpVersion(LoaderUtil.getChildContent(root, "cmp-version"));
  +            entities[i].setAbstractSchemaName(LoaderUtil.getChildContent(root, "abstract-schema-name"));
  +            entities[i].setPrimkeyField(LoaderUtil.getChildContent(root, "primkey-field"));
  +            entities[i].setCmpField(EjbJarLoader.loadCmpFields(root));
  +            entities[i].setQuery(EjbJarLoader.loadQueries(root));
               entities[i].setJndiName(LoaderUtil.getChildContent(root, "jndi-name"));
           }
           return entities;
  
  
  

Mime
View raw message