geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r964490 - /geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
Date Thu, 15 Jul 2010 17:07:19 GMT
Author: djencks
Date: Thu Jul 15 17:07:19 2010
New Revision: 964490

URL: http://svn.apache.org/viewvc?rev=964490&view=rev
Log:
GERONIMO-5445 use osgi jndi links for datasource annotations

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=964490&r1=964489&r2=964490&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
Thu Jul 15 17:07:19 2010
@@ -25,13 +25,11 @@ import java.util.Map;
 
 import javax.annotation.sql.DataSourceDefinition;
 import javax.annotation.sql.DataSourceDefinitions;
-import javax.resource.ResourceException;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.deployment.ConnectorModuleBuilder;
 import org.apache.geronimo.datasource.DataSourceDescription;
 import org.apache.geronimo.datasource.DataSourceGBean;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
@@ -42,7 +40,7 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
-import org.apache.geronimo.naming.reference.ResourceReferenceFactory;
+import org.apache.geronimo.naming.reference.JndiReference;
 import org.apache.openejb.jee.DataSource;
 import org.apache.openejb.jee.IsolationLevel;
 import org.apache.openejb.jee.JndiConsumer;
@@ -169,16 +167,13 @@ public class DataSourceBuilder extends A
             osgiJndiName = dsDescription.getProperties().get(ConnectorModuleBuilder.OSGI_JNDI_SERVICE_NAME);
         }
         if (osgiJndiName == null) {
-            osgiJndiName = dataSourceAbstractName.getArtifact().getGroupId() + "/" +
-                     dataSourceAbstractName.getArtifact().getArtifactId() + "/" +
-                     dataSourceAbstractName.getNameProperty("j2eeType") + "/" +
-                     dataSourceAbstractName.getNameProperty("name");
+            osgiJndiName = module.getEarContext().getNaming().toOsgiJndiName(dataSourceAbstractName);
         }
         dataSourceGBean.getServiceProperties().put(ConnectorModuleBuilder.OSGI_JNDI_SERVICE_NAME,
osgiJndiName);
         
         earContext.addGBean(dataSourceGBean);
                 
-        Object ref = new ResourceReferenceFactory<ResourceException>(module.getConfigId(),
new AbstractNameQuery(dataSourceAbstractName), DataSource.class);
+        Object ref = new JndiReference("aries:services/" + osgiJndiName);
         put(jndiName, ref, module.getJndiContext());
     }
     



Mime
View raw message