geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r990722 - /geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
Date Mon, 30 Aug 2010 08:06:43 GMT
Author: xuhaihong
Date: Mon Aug 30 08:06:43 2010
New Revision: 990722

URL: http://svn.apache.org/viewvc?rev=990722&view=rev
Log:
Check to avoid the existing injection targets are overrided, as if the ejb ref type could
not be detected, an EjbRef will be created, and it is possible to have a same EjbLocalRef
in the deployment plan.

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?rev=990722&r1=990721&r2=990722&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
Mon Aug 30 08:06:43 2010
@@ -112,12 +112,17 @@ public class EjbRefBuilder extends Abstr
 
         Map<String, List<InjectionTarget>> injectionsMap = new HashMap<String,
List<InjectionTarget>>();
         for (Map.Entry<String, EjbRef> entry: specDD.getEjbRefMap().entrySet()) {
-            injectionsMap.put(entry.getKey(), entry.getValue().getInjectionTarget());   
        
+            injectionsMap.put(entry.getKey(), entry.getValue().getInjectionTarget());
         }
         for (Map.Entry<String, EjbLocalRef> entry: specDD.getEjbLocalRefMap().entrySet())
{
-            injectionsMap.put(entry.getKey(), entry.getValue().getInjectionTarget());
+            List<InjectionTarget> injectionTargets = injectionsMap.get(entry.getKey());
+            if (injectionTargets != null) {
+                injectionTargets.addAll(entry.getValue().getInjectionTarget());
+            } else {
+                injectionsMap.put(entry.getKey(), entry.getValue().getInjectionTarget());
+            }
         }
-        
+
         Map<String, Object> map = null;
         try {
             EjbModuleBuilder.EarData earData = EjbModuleBuilder.EarData.KEY.get(module.getRootEarContext().getGeneralData());
@@ -137,7 +142,7 @@ public class EjbRefBuilder extends Abstr
 
             String moduleId = module.getName();
             jndiEncInfoBuilder.build(specDD, "GeronimoEnc", moduleId, moduleJndi, compJndi);
-            
+
             JndiEncInfo ejbEncInfo = new JndiEncInfo();
             ejbEncInfo.ejbReferences.addAll(appInfo.globalJndiEnc.ejbReferences);
             ejbEncInfo.ejbReferences.addAll(appInfo.appJndiEnc.ejbReferences);



Mime
View raw message