geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r987293 - in /geronimo/server/trunk/plugins: connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/
Date Thu, 19 Aug 2010 20:20:29 GMT
Author: gawor
Date: Thu Aug 19 20:20:29 2010
New Revision: 987293

URL: http://svn.apache.org/viewvc?rev=987293&view=rev
Log:
Additinal fix for DataSource injection via @Resource.name

Modified:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.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/connector/deployment/ResourceRefBuilder.java?rev=987293&r1=987292&r2=987293&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
Thu Aug 19 20:20:29 2010
@@ -45,6 +45,7 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.j2ee.deployment.CorbaGBeanNameSource;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
@@ -128,11 +129,16 @@ public class ResourceRefBuilder extends 
         Bundle bundle = module.getEarContext().getDeploymentBundle();
         for (Map.Entry<String, ResourceRef> entry : specDD.getResourceRefMap().entrySet())
{
             String name = entry.getKey();
+            ResourceRef resourceRef = entry.getValue();
             if (lookupJndiContextMap(module, name) != null) {
                 // some other builder handled this entry already
+                
+                // Always merge injections. This is for example where data source is defined
as
+                // @DataSource(name='foo') and it is injected via @Resource(name='foo')
+                addInjections(normalize(name), resourceRef.getInjectionTarget(), NamingBuilder.INJECTION_KEY.get(sharedContext));
+                
                 continue;
-            }
-            ResourceRef resourceRef = entry.getValue();
+            }            
             String type = getStringValue(resourceRef.getResType());
             type = inferAndCheckType(module, bundle, resourceRef.getInjectionTarget(), name,
type);
             GerResourceRefType gerResourceRef = refMap.get(name);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?rev=987293&r1=987292&r2=987293&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Thu Aug 19 20:20:29 2010
@@ -317,8 +317,7 @@ public abstract class AbstractNamingBuil
         return clazz;
     }
 
-
-    private void addInjections(String jndiName, List<InjectionTarget> injectionTargets,
Holder holder) {
+    protected void addInjections(String jndiName, List<InjectionTarget> injectionTargets,
Holder holder) {
         for (InjectionTarget injectionTarget : injectionTargets) {
             String targetName = injectionTarget.getInjectionTargetName().trim();
             String targetClassName = injectionTarget.getInjectionTargetClass().trim();



Mime
View raw message