Title: [2633] branches/v2_1/openejb2/modules/openejb-builder/src/java/org/openejb/deployment/OpenEJBReferenceBuilder.java: Add EJBContainer interface type to abstract name query to eliminate name conflicts
Revision
2633
Author
dain
Date
2006-04-29 23:33:45 -0400 (Sat, 29 Apr 2006)

Log Message

Add EJBContainer interface type to abstract name query to eliminate name conflicts

Modified Paths

Diff

Modified: branches/v2_1/openejb2/modules/openejb-builder/src/java/org/openejb/deployment/OpenEJBReferenceBuilder.java (2632 => 2633)

--- branches/v2_1/openejb2/modules/openejb-builder/src/java/org/openejb/deployment/OpenEJBReferenceBuilder.java	2006-04-29 16:11:14 UTC (rev 2632)
+++ branches/v2_1/openejb2/modules/openejb-builder/src/java/org/openejb/deployment/OpenEJBReferenceBuilder.java	2006-04-30 03:33:45 UTC (rev 2633)
@@ -74,6 +74,7 @@
 import org.openejb.corba.proxy.CORBAProxyReference;
 import org.openejb.proxy.EJBProxyReference;
 import org.openejb.proxy.ProxyInfo;
+import org.openejb.EJBContainer;
 
 /**
  * @version $Revision$ $Date$
@@ -144,7 +145,7 @@
         AbstractNameQuery match;
         if (query != null) {
             checkRemoteProxyInfo(query, home, remote, configuration);
-            match = query;
+            match = new AbstractNameQuery(query.getArtifact(), query.getName(), EJBContainer.class.getName());
         } else if (name != null) {
             match = getMatch(refName, configuration, name, requiredModule, true, isSession, home, remote);
         } else {
@@ -157,7 +158,7 @@
         AbstractNameQuery match;
         if (query != null) {
             checkLocalProxyInfo(query, localHome, local, configuration);
-            match = query;
+            match = new AbstractNameQuery(query.getArtifact(), query.getName(), EJBContainer.class.getName());
         } else if (name != null) {
             match = getMatch(refName, configuration, name, requiredModule, false, isSession, localHome, local);
         } else {
@@ -184,14 +185,14 @@
         if (isSession) {
             Map q = new HashMap(nameQuery);
             q.putAll(STATELESS);
-            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), q)));
+            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), q, EJBContainer.class.getName())));
 
             q = new HashMap(nameQuery);
             q.putAll(STATEFUL);
-            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), q)));
+            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), q, EJBContainer.class.getName())));
         } else {
             nameQuery.putAll(ENTITY);
-            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), nameQuery)));
+            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), nameQuery, EJBContainer.class.getName())));
         }
 
         Collection matches = new ArrayList();
@@ -222,10 +223,10 @@
     private AbstractNameQuery getImplicitMatch(String refName, Configuration context, String module, boolean isRemote, boolean isSession, String home, String remote) throws DeploymentException {
         Set gbeans;
         if (isSession) {
-            gbeans = context.findGBeans(new AbstractNameQuery(context.getId(), STATELESS));
-            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), STATEFUL)));
+            gbeans = context.findGBeans(new AbstractNameQuery(context.getId(), STATELESS, EJBContainer.class.getName()));
+            gbeans.addAll(context.findGBeans(new AbstractNameQuery(context.getId(), STATEFUL, EJBContainer.class.getName())));
         } else {
-            gbeans = context.findGBeans(new AbstractNameQuery(context.getId(), ENTITY));
+            gbeans = context.findGBeans(new AbstractNameQuery(context.getId(), ENTITY, EJBContainer.class.getName()));
         }
         Collection matches = new ArrayList();
         for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {

Reply via email to