[jboss-cvs] JBossAS SVN: r108520 - projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 12 11:09:57 EDT 2010


Author: jaikiran
Date: 2010-10-12 11:09:57 -0400 (Tue, 12 Oct 2010)
New Revision: 108520

Modified:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/SessionSpecContainer.java
Log:
EJBTHREE-2076 Set invoked business interface to null, only for EJB2.x view

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/SessionSpecContainer.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/SessionSpecContainer.java	2010-10-12 13:53:29 UTC (rev 108519)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/SessionSpecContainer.java	2010-10-12 15:09:57 UTC (rev 108520)
@@ -187,9 +187,9 @@
       try
       {
          Class<?> invokedBusinessInterface = Class.forName(method.getActualClassName(), false, getClassloader());
-         if (!this.getBusinessInterfaces().contains(invokedBusinessInterface))
+         // EJBTHREE-2076 if it's a EJB2.x view invocation, then invoked business interface should be null.
+         if (this.isEjb2xView(invokedBusinessInterface.getName()))
          {
-            // Required because SerializableMethod will automatically set the actual class name to the declaring class name
             invokedBusinessInterface = null;
          }
          
@@ -539,6 +539,29 @@
       }
       return businessInterfaces;
    }
+   
+   /**
+    * Returns true if the passed fully qualified class name, represents a
+    * EJB 2.x view of the EJB, corresponding to this container. Else
+    * returns false.
+    * 
+    * @param intf Fully qualified class name
+    * @return
+    */
+   private boolean isEjb2xView(String intf)
+   {
+      String remote = this.getMetaData().getRemote();
+      if (remote != null && remote.equals(intf))
+      {
+         return true;
+      }
+      String local = this.getMetaData().getLocal();
+      if (local != null && local.equals(intf))
+      {
+         return true;
+      }
+      return false;
+   }
 
    // ------------------------------------------------------------------------------||
    // Lifecycle Methods ------------------------------------------------------------||



More information about the jboss-cvs-commits mailing list