[jboss-cvs] JBossAS SVN: r72186 - in projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3: session and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 14 11:53:52 EDT 2008


Author: ALRubinger
Date: 2008-04-14 11:53:52 -0400 (Mon, 14 Apr 2008)
New Revision: 72186

Modified:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java
Log:
[EJBTHREE-1276] EJBMetaData should return remote interfaces, not remote business, on getRemoteInterfaceClass

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java	2008-04-14 15:41:21 UTC (rev 72185)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java	2008-04-14 15:53:52 UTC (rev 72186)
@@ -24,10 +24,10 @@
 import java.io.Serializable;
 import java.rmi.RemoteException;
 
+import javax.ejb.EJBException;
+import javax.ejb.EJBHome;
+import javax.ejb.EJBMetaData;
 import javax.ejb.HomeHandle;
-import javax.ejb.EJBMetaData;
-import javax.ejb.EJBHome;
-import javax.ejb.EJBException;
 
 /**
  * An implementation of the EJBMetaData interface which allows a
@@ -36,6 +36,7 @@
  * @author  Rickard Oberg (rickard.oberg at telkel.com)
  * @author  <a href="mailto:marc.fleury at telkel.com">Marc Fleury</a>
  * @author  <a href="mailto:jason at planet57.com">Jason Dillon</a>
+ * @author  <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision$
  */
 public class EJBMetaDataImpl
@@ -45,9 +46,9 @@
    private static final long serialVersionUID = -3698855455664391097L;
 
    // Attributes ----------------------------------------------------
-   private final Class remote;
-   private final Class home;
-   private final Class pkClass;
+   private final Class<?> remote;
+   private final Class<?> home;
+   private final Class<?> pkClass;
 
    private final boolean session;
    private final boolean statelessSession;
@@ -59,9 +60,9 @@
     * Construct an <tt>EJBMetaDataImpl</tt>.
     * this should only be accessible from the factory.
     */
-   public EJBMetaDataImpl(final Class remote,
-         final Class home,
-         final Class pkClass,
+   public EJBMetaDataImpl(final Class<?> remote,
+         final Class<?> home,
+         final Class<?> pkClass,
          final boolean session,
          final boolean statelessSession,
          final HomeHandle homeHandle)
@@ -107,7 +108,7 @@
    /**
     * Obtain the Class object for the enterprise Bean's home interface.
     */
-   public Class getHomeInterfaceClass()
+   public Class<?> getHomeInterfaceClass()
    {
       return home;
    }
@@ -115,7 +116,7 @@
    /**
     * Obtain the Class object for the enterprise Bean's remote interface.
     */
-   public Class getRemoteInterfaceClass()
+   public Class<?> getRemoteInterfaceClass()
    {
       return remote;
    }
@@ -123,7 +124,7 @@
    /**
     * Obtain the Class object for the enterprise Bean's primary key class.
     */
-   public Class getPrimaryKeyClass()
+   public Class<?> getPrimaryKeyClass()
    {
       if (session == true)
          throw new RuntimeException("A session bean does not have a primary key class");

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java	2008-04-14 15:41:21 UTC (rev 72185)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java	2008-04-14 15:53:52 UTC (rev 72186)
@@ -441,9 +441,11 @@
       
       EJBContainer ejbContainer = (EJBContainer)container;
       
-      Remote remoteAnnotation = ejbContainer.getAnnotation(Remote.class);
-      if (remoteAnnotation != null)
-         remote = remoteAnnotation.value()[0];
+      Class<?>[] remotes = ProxyFactoryHelper.getRemoteInterfaces(this.getContainer());
+      if (remotes != null && remotes.length > 0)
+      {
+         remote = remotes[0];
+      }
       RemoteHome homeAnnotation = ejbContainer.getAnnotation(RemoteHome.class);
       if (homeAnnotation != null)
          home = homeAnnotation.value();

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java	2008-04-14 15:41:21 UTC (rev 72185)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java	2008-04-14 15:53:52 UTC (rev 72186)
@@ -898,9 +898,11 @@
          Class<?> pkClass = Object.class;
          HomeHandleImpl homeHandle = null;
 
-         Remote remoteAnnotation = this.getAnnotation(Remote.class);
-         if (remoteAnnotation != null)
-            remote = remoteAnnotation.value()[0];
+         Class<?>[] remotes = ProxyFactoryHelper.getRemoteInterfaces(this);
+         if (remotes != null && remotes.length > 0)
+         {
+            remote = remotes[0];
+         }
          RemoteHome homeAnnotation = this.getAnnotation(RemoteHome.class);
          if (homeAnnotation != null)
             home = homeAnnotation.value();




More information about the jboss-cvs-commits mailing list