geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r984199 - /geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
Date Tue, 10 Aug 2010 20:28:10 GMT
Author: gawor
Date: Tue Aug 10 20:28:10 2010
New Revision: 984199

URL: http://svn.apache.org/viewvc?rev=984199&view=rev
Log:
ensure DataSourceBuilder executes before ResourceRefBuilder and it creates unique GBeans

Modified:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java?rev=984199&r1=984198&r2=984199&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
Tue Aug 10 20:28:10 2010
@@ -123,10 +123,9 @@ public class DataSourceBuilder extends A
         // step 2: bind all defined data sources into jndi
         Collection<DataSource> dataSources = specDD.getDataSource();
         if (dataSources != null) {
-            int i = 0;
             for (DataSource dataSource: dataSources) {
                 try {
-                    addDataSourceGBean(module, sharedContext, dataSource, "DataSource-" +
i++);
+                    addDataSourceGBean(module, sharedContext, dataSource);
                 } catch (GBeanAlreadyExistsException e) {
                     throw new DeploymentException("Error creating DataSource gbean", e);
                 }
@@ -134,7 +133,7 @@ public class DataSourceBuilder extends A
         }        
     }
 
-    private void addDataSourceGBean(Module module, Map<EARContext.Key, Object> sharedContext,
DataSource ds, String name)
+    private void addDataSourceGBean(Module module, Map<EARContext.Key, Object> sharedContext,
DataSource ds)
         throws GBeanAlreadyExistsException {
                         
         String jndiName = ds.getKey();
@@ -143,6 +142,11 @@ public class DataSourceBuilder extends A
             return;
         }
         
+        String name = jndiName;
+        if (name.startsWith("java:")) {
+            name = name.substring(5);
+        }
+                
         EARContext earContext = module.getEarContext();
                        
         AbstractName dataSourceAbstractName = earContext.getNaming().createChildName(module.getModuleName(),
name, "GBean");
@@ -389,4 +393,10 @@ public class DataSourceBuilder extends A
     public QNameSet getSpecQNameSet() {
         return dataSourceQNameSet;
     }
+    
+    @Override
+    public int getPriority() {
+        return 20;
+    }
+    
 }



Mime
View raw message