geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r739963 - /geronimo/plugins/tuscany/trunk/geronimo-tuscany-implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/invocation/EjbImplementationInvoker.java
Date Mon, 02 Feb 2009 11:32:03 GMT
Author: vamsic007
Date: Mon Feb  2 11:32:03 2009
New Revision: 739963

URL: http://svn.apache.org/viewvc?rev=739963&view=rev
Log:
Handle module#ejb 

Modified:
    geronimo/plugins/tuscany/trunk/geronimo-tuscany-implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/invocation/EjbImplementationInvoker.java

Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany-implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/invocation/EjbImplementationInvoker.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/geronimo-tuscany-implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/invocation/EjbImplementationInvoker.java?rev=739963&r1=739962&r2=739963&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/geronimo-tuscany-implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/invocation/EjbImplementationInvoker.java
(original)
+++ geronimo/plugins/tuscany/trunk/geronimo-tuscany-implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/invocation/EjbImplementationInvoker.java
Mon Feb  2 11:32:03 2009
@@ -21,6 +21,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -74,10 +75,29 @@
             Kernel kernel = KernelRegistry.getSingleKernel();
             // Locate the GBean corresponding to this EJB.
             Map<String, String> map = new HashMap<String, String>();
-            map.put("name", ((EJBImplementation)rtc.getImplementation()).getEJBLink());
+            String ejbLink = ((EJBImplementation)rtc.getImplementation()).getEJBLink();
+            String beanName, moduleName = null;
+            if(ejbLink.indexOf("#") == -1) {
+                beanName = ejbLink;
+            } else {
+                beanName = ejbLink.substring(ejbLink.indexOf("#")+1);
+                moduleName = ejbLink.substring(0, ejbLink.indexOf("#"));
+            }
+            map.put("name", beanName);
             AbstractNameQuery query = new AbstractNameQuery(artifact, map);
             Set<AbstractName> gbeans = kernel.listGBeans(query);
-            AbstractName ejbGbeanName = (AbstractName)gbeans.iterator().next();
+            AbstractName ejbGbeanName = null;
+            if(gbeans.size() == 1) {
+                ejbGbeanName = (AbstractName)gbeans.iterator().next();
+            } else {
+                for(Iterator<AbstractName> itr = gbeans.iterator(); itr.hasNext();)
{
+                    AbstractName temp = itr.next();
+                    if(moduleName.equals(ejbGbeanName.getNameProperty("EJBModule"))) {
+                        ejbGbeanName = temp;
+                        break;
+                    }
+                }
+            }
 
             // Create a proxy to the EJB via the business remote home interface.
             Method method;



Mime
View raw message