[jboss-cvs] JBossAS SVN: r65870 - in trunk/ejb3/src: main/org/jboss/ejb3/stateful and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 5 03:56:31 EDT 2007


Author: ALRubinger
Date: 2007-10-05 03:56:31 -0400 (Fri, 05 Oct 2007)
New Revision: 65870

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java
Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
Log:
EJBTHREE-786: Merged fixes from Branch 4.2 back to trunk

Modified: trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -220,56 +220,7 @@
          return getBusinessInterfaces(beanClass.getSuperclass(), interfaces);
       }
    }
-   
-   /**
-    * Returns whether or not the specified business interface is a 
-    * direct or indirect subclass of EJBObject
-    * 
-    * @param businessInterface
-    * @return
-    */
-   public static boolean isSubclassOfEjbObject(Class<?> businessInterface)
-   {
-      return ProxyFactoryHelper.isSubclassOfEjbObject(businessInterface,false);
-   }
-   
-   /**
-    * Returns whether or not the specified business interface is a 
-    * direct or indirect subclass of EJBLocalObject
-    * 
-    * @param businessInterface
-    * @return
-    */
-   public static boolean isSubclassOfEjbLocalObject(Class<?> businessInterface)
-   {
-      return ProxyFactoryHelper.isSubclassOfEjbObject(businessInterface,true);
-   }
-   
-   private static boolean isSubclassOfEjbObject(Class<?> businessInterface, boolean local)
-   {
-      // Define EJBObject or EJBLocalObject
-      Class<?> testClass = local ? EJBLocalObject.class : EJBObject.class;
 
-      // Test interface
-      if (businessInterface.equals(testClass))
-      {
-         return true;
-      }
-
-      // Loop through all super interfaces
-      for (Class<?> superInterface : businessInterface.getInterfaces())
-      {
-         // Test all super interfaces
-         if (ProxyFactoryHelper.isSubclassOfEjbObject(superInterface, local))
-         {
-            return true;
-         }
-      }
-
-      // Not found
-      return false;
-   }
-
    public static Class getLocalHomeInterface(Container container)
    {
       Class beanClass = container.getBeanClass();

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -64,35 +64,9 @@
       // Obtain all local interfaces      
       List<Class<?>> localInterfaces = new ArrayList<Class<?>>();
       localInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getLocalInterfaces(container)));
-      
-      // Loop through all interfaces, checking for EJBLocalObject
-      boolean addEJBLocalObject = false;
-      for (Class<?> clazz : localInterfaces)
-      {
-         // If a subclass of EJBObject, set flag to add
-         if (ProxyFactoryHelper.isSubclassOfEjbLocalObject(clazz))
-         {
-            addEJBLocalObject = true;
-         }
-      }
-      if (addEJBLocalObject)
-      {
-         // Add EJBLocalObject
-         localInterfaces.add(EJBLocalObject.class);
-      }
 
       // Add JBossProxy
       localInterfaces.add(JBossProxy.class);
-      
-      // Loop through all interfaces
-      for (Class<?> clazz : localInterfaces)
-      {
-         // If a subclass of EJBLocalObject, add
-         if (ProxyFactoryHelper.isSubclassOfEjbLocalObject(clazz))
-         {
-            localInterfaces.add(EJBLocalObject.class);
-         }
-      }
 
       // If binding along w/ home, add home
       if (bindTogether)

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -85,25 +85,8 @@
 
       // Obtain all remote interfaces
       List<Class<?>> remoteInterfaces = new ArrayList<Class<?>>();
-      remoteInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getRemoteInterfaces(container)));     
-      
-      // Loop through all interfaces, checking for EJBObject
-      boolean addEJBObject = false;
-      for (Class<?> clazz : remoteInterfaces)
-      {
-         // If a subclass of EJBObject, set flag to add
-         if (ProxyFactoryHelper.isSubclassOfEjbObject(clazz))
-         {
-            addEJBObject = true;
-         }
-      }
-      if (addEJBObject)
-      {
-         // Add EJBObject
-         remoteInterfaces.add(EJBObject.class);
+      remoteInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getRemoteInterfaces(container)));
 
-      }
-
       // Add JBossProxy
       remoteInterfaces.add(JBossProxy.class);
       

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -70,22 +70,6 @@
       // Ensure remote interfaces defined
       if (localInterfaces.size() > 0)
       {
-         // Loop through all interfaces, checking for EJBLocalObject
-         boolean addEJBLocalObject = false;
-         for (Class<?> clazz : localInterfaces)
-         {
-            // If a subclass of EJBObject, set flag to add
-            if (ProxyFactoryHelper.isSubclassOfEjbLocalObject(clazz))
-            {
-               addEJBLocalObject = true;
-            }
-         }
-         if (addEJBLocalObject)
-         {
-            // Add EJBLocalObject
-            localInterfaces.add(EJBLocalObject.class);
-         }
-
          // Add JBossProxy
          localInterfaces.add(JBossProxy.class);
 

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -81,22 +81,6 @@
       // Ensure remote interfaces defined
       if (remoteInterfaces.size() > 0)
       {
-         // Loop through all interfaces, checking for EJBObject
-         boolean addEJBObject = false;
-         for (Class<?> clazz : remoteInterfaces)
-         {
-            // If a subclass of EJBObject, set flag to add
-            if (ProxyFactoryHelper.isSubclassOfEjbObject(clazz))
-            {
-               addEJBObject = true;
-            }
-         }
-         if (addEJBObject)
-         {
-            // Add EJBObject
-            remoteInterfaces.add(EJBObject.class);
-         }
-
          // Add JBossProxy
          remoteInterfaces.add(JBossProxy.class);
 

Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -15,7 +15,7 @@
  * @author <a href="arubinge at redhat.com">ALR</a>
  * @version $Revision:  $
  */
- at Remote
+//@Remote
 public interface Ejb21View extends EJBObject
 {
    String test();

Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -7,12 +7,14 @@
 package org.jboss.ejb3.test.ejbthree786;
 
 import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
 import javax.ejb.Stateful;
 
 import org.jboss.annotation.ejb.RemoteBinding;
 
 @Stateful
 @Remote(Ejb21View.class)
+ at RemoteHome(Ejb21ViewHome.class)
 @RemoteBinding(jndiBinding = Ejb21ViewBean.JNDI_NAME_REMOTE)
 public class Ejb21ViewBean
 {

Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java (from rev 65853, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * @author carlo
+ *
+ */
+public interface Ejb21ViewHome extends EJBHome
+{
+   Ejb21View create() throws CreateException, RemoteException;
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java	2007-10-05 02:10:35 UTC (rev 65869)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java	2007-10-05 07:56:31 UTC (rev 65870)
@@ -23,6 +23,7 @@
 
 import javax.ejb.EJBObject;
 import javax.ejb.NoSuchEJBException;
+import javax.rmi.PortableRemoteObject;
 
 import junit.framework.Test;
 
@@ -31,6 +32,7 @@
 import org.jboss.ejb3.test.ejbthree786.DelegateBean;
 import org.jboss.ejb3.test.ejbthree786.Ejb21View;
 import org.jboss.ejb3.test.ejbthree786.Ejb21ViewBean;
+import org.jboss.ejb3.test.ejbthree786.Ejb21ViewHome;
 import org.jboss.ejb3.test.ejbthree786.RemoveStatefulRemote;
 import org.jboss.ejb3.test.ejbthree786.RemoveStatelessRemote;
 import org.jboss.ejb3.test.ejbthree786.StatefulRemoveBean;
@@ -42,7 +44,7 @@
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
  * @author <a href="mailto:arubinge at redhat.com">ALR</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public class RemoveMethodUnitTestCase extends JBossTestCase
 {
@@ -85,17 +87,19 @@
    public void testExplicitExtensionEjbObjectInProxy() throws Exception
    {
       // Obtain stub
-      Ejb21View session = (Ejb21View) getInitialContext().lookup(Ejb21ViewBean.JNDI_NAME_REMOTE);
+      //Ejb21View session = (Ejb21View) getInitialContext().lookup(Ejb21ViewBean.JNDI_NAME_REMOTE);
+      Object obj = getInitialContext().lookup("Ejb21ViewBean/home");
+      Ejb21ViewHome home = (Ejb21ViewHome) PortableRemoteObject.narrow(obj, Ejb21ViewHome.class);
+      Ejb21View session = home.create();
 
       // Ensure EJBObject 
       assertTrue(session instanceof EJBObject);
 
       // Cast and remove appropriately, ensuring removed
-      EJBObject obj = (EJBObject) session;
       boolean removed = false;
       String result = session.test();
       assertEquals(Ejb21ViewBean.TEST_STRING, result);
-      obj.remove();
+      session.remove();
       try
       {
          session.test();




More information about the jboss-cvs-commits mailing list