[jboss-cvs] JBossAS SVN: r58401 - trunk/server/src/main/org/jboss/ejb

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 15 09:56:45 EST 2006


Author: alex.loubyansky at jboss.com
Date: 2006-11-15 09:56:43 -0500 (Wed, 15 Nov 2006)
New Revision: 58401

Modified:
   trunk/server/src/main/org/jboss/ejb/StatelessSessionContainer.java
Log:
fixed method mapping

Modified: trunk/server/src/main/org/jboss/ejb/StatelessSessionContainer.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/StatelessSessionContainer.java	2006-11-15 14:41:55 UTC (rev 58400)
+++ trunk/server/src/main/org/jboss/ejb/StatelessSessionContainer.java	2006-11-15 14:56:43 UTC (rev 58401)
@@ -30,7 +30,6 @@
 import javax.ejb.EJBException;
 import javax.ejb.EJBLocalObject;
 import javax.ejb.EJBObject;
-import javax.ejb.Handle;
 import javax.ejb.RemoveException;
 
 import org.jboss.invocation.Invocation;
@@ -61,7 +60,7 @@
 
    // EJBLocalHome implementation
 
-   public EJBLocalObject createLocalHome()
+   public EJBLocalObject createLocalHome(Invocation mi)
            throws CreateException
    {
       if (localProxyFactory == null)
@@ -83,7 +82,7 @@
 
    // EJBHome implementation ----------------------------------------
 
-   public EJBObject createHome()
+   public EJBObject createHome(Invocation mi)
            throws RemoteException, CreateException
    {
       EJBProxyFactory ci = getProxyFactory();
@@ -100,27 +99,19 @@
    /**
     * No-op.
     */
-   public void removeHome(Handle handle)
+   public void removeHome(Invocation mi)
            throws RemoteException, RemoveException
    {
       throw new UnreachableStatementException();
    }
 
-   /**
-    * No-op.
-    */
-   public void removeHome(Object primaryKey)
-           throws RemoteException, RemoveException
-   {
-      throw new UnreachableStatementException();
-   }
-
    // Protected  ----------------------------------------------------
 
    protected void setupHomeMapping()
-           throws NoSuchMethodException
+           throws Exception
    {
       Map map = new HashMap();
+      Class[] args = new Class[]{Invocation.class};
 
       if (homeInterface != null)
       {
@@ -129,9 +120,17 @@
          {
             // Implemented by container
             log.debug("Mapping " + m[i].getName());
-            map.put(m[i], getClass().getMethod(m[i].getName() + "Home", m[i].getParameterTypes()));
+            try
+            {
+               map.put(m[i], getClass().getMethod(m[i].getName() + "Home", args));
+            }
+            catch (NoSuchMethodException e)
+            {
+               log.info(m[i].getName() + " in bean has not been mapped");
+            }
          }
       }
+
       if (localHomeInterface != null)
       {
          Method[] m = localHomeInterface.getMethods();
@@ -139,7 +138,14 @@
          {
             // Implemented by container
             log.debug("Mapping " + m[i].getName());
-            map.put(m[i], getClass().getMethod(m[i].getName() + "LocalHome", m[i].getParameterTypes()));
+            try
+            {
+               map.put(m[i], getBeanClass().getMethod(m[i].getName() + "LocalHome", args));
+            }
+            catch (NoSuchMethodException e)
+            {
+               log.info(m[i].getName() + " in bean has not been mapped");
+            }
          }
       }
 
@@ -169,7 +175,7 @@
 
          try
          {
-            return mi.performCall(StatelessSessionContainer.this, m, mi.getArguments());
+            return mi.performCall(StatelessSessionContainer.this, m, new Object[]{mi});
          }
          catch (Exception e)
          {




More information about the jboss-cvs-commits mailing list