geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r540376 - in /geronimo/server/trunk: configs/openejb-deployer/src/plan/plan.xml modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Date Tue, 22 May 2007 00:09:16 GMT
Author: djencks
Date: Mon May 21 17:09:15 2007
New Revision: 540376

URL: http://svn.apache.org/viewvc?view=rev&rev=540376
Log:
GERONIMO-3179 default jta and non jta datasources for generated cmp persistence units

Modified:
    geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java

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=540376&r1=540375&r2=540376
==============================================================================
--- geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml Mon May 21 17:09:15 2007
@@ -21,6 +21,8 @@
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
     <gbean name="EJBBuilder" class="org.apache.geronimo.openejb.deployment.EjbModuleBuilder">
+        <attribute name="defaultCmpJTADataSource">SystemDatasource</attribute>
+        <attribute name="defaultCmpNonJTADataSource">NoTxDatasource</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>

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=540376&r1=540375&r2=540376
==============================================================================
--- 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
Mon May 21 17:09:15 2007
@@ -121,6 +121,8 @@
     private static final String OPENEJBJAR_NAMESPACE = XmlUtil.OPENEJBJAR_QNAME.getNamespaceURI();
 
     private final Environment defaultEnvironment;
+    private final String defaultCmpJTADataSource;
+    private final String defaultCmpNonJTADataSource;
     private final NamespaceDrivenBuilderCollection securityBuilders;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
     private final NamingBuilder namingBuilder;
@@ -129,7 +131,8 @@
     private final Collection<ModuleBuilderExtension> moduleBuilderExtensions;
 
     public EjbModuleBuilder(Environment defaultEnvironment,
-            OpenEjbSystem openEjbSystem,
+
+            String defaultCmpJTADataSource, String defaultCmpNonJTADataSource, OpenEjbSystem
openEjbSystem,
             Collection<ModuleBuilderExtension> moduleBuilderExtensions,
             Collection securityBuilders,
             Collection serviceBuilders,
@@ -138,6 +141,8 @@
 
         this.openEjbSystem = openEjbSystem;
         this.defaultEnvironment = defaultEnvironment;
+        this.defaultCmpJTADataSource = defaultCmpJTADataSource;
+        this.defaultCmpNonJTADataSource = defaultCmpNonJTADataSource;
         this.securityBuilders = new NamespaceDrivenBuilderCollection(securityBuilders, GerSecurityDocument.type.getDocumentElementName());
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders, GBeanBuilder.SERVICE_QNAME);
         this.namingBuilder = namingBuilders;
@@ -566,7 +571,7 @@
                 if (cmpConnectionFactory != null) {
                     String datasourceName = cmpConnectionFactory.getResourceLink();
                     if (datasourceName != null) {
-                        jtaDataSource = "?name=" + datasourceName;
+                        jtaDataSource = datasourceName.trim();
                     }
                 }
             }
@@ -577,9 +582,9 @@
             if (jtaDataSource != null) {
                 persistenceUnit.setJtaDataSource(jtaDataSource);
             } else {
-                persistenceUnit.setJtaDataSource("?name=SystemDatasource");
+                persistenceUnit.setJtaDataSource(defaultCmpJTADataSource);
             }
-            persistenceUnit.setNonJtaDataSource("?name=NoTxDatasource");
+            persistenceUnit.setNonJtaDataSource(defaultCmpNonJTADataSource);
             persistenceUnit.setExcludeUnlistedClasses(true);
 
             Persistence persistence = new Persistence();
@@ -767,6 +772,8 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EjbModuleBuilder.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true);
+        infoBuilder.addAttribute("defaultCmpJTADataSource", String.class, true);
+        infoBuilder.addAttribute("defaultCmpNonJTADataSource", String.class, true);
         infoBuilder.addReference("OpenEjbSystem", OpenEjbSystem.class);
         infoBuilder.addReference("ModuleBuilderExtensions", ModuleBuilderExtension.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
@@ -776,6 +783,8 @@
 
         infoBuilder.setConstructor(new String[]{
                 "defaultEnvironment",
+                "defaultCmpJTADataSource",
+                "defaultCmpNonJTADataSource",
                 "OpenEjbSystem",
                 "ModuleBuilderExtensions",
                 "SecurityBuilders",



Mime
View raw message