[jboss-cvs] JBossAS SVN: r64342 - trunk/ejb3/src/main/org/jboss/ejb3/stateful.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 30 06:00:34 EDT 2007


Author: wolfc
Date: 2007-07-30 06:00:34 -0400 (Mon, 30 Jul 2007)
New Revision: 64342

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
Log:
EJBTHREE-1016: assertions

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java	2007-07-30 09:45:28 UTC (rev 64341)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java	2007-07-30 10:00:34 UTC (rev 64342)
@@ -256,7 +256,7 @@
     *
     * @return
     */
-   public Object createSession()
+   protected Object createSession()
    {
       ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
       pushEnc();
@@ -277,7 +277,7 @@
     *
     * @return
     */
-   public Object createSession(Class[] initTypes, Object[] initValues)
+   protected Object createSession(Class[] initTypes, Object[] initValues)
    {
       ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
       pushEnc();
@@ -890,7 +890,10 @@
       assert businessInterface != null : "businessInterface is null";
       
       StatefulBeanContext ctx = (StatefulBeanContext) beanContext;
-
+      
+      SessionContainer container = ctx.getContainer();
+      assert container == this : "beanContext not of this container (" + container + " != " + this + ")";
+      
       boolean isRemote = false;
       boolean found = false;
       Class[] remoteInterfaces = ProxyFactoryHelper.getRemoteInterfaces(this);
@@ -915,7 +918,7 @@
             }
          }
       }
-      if (found == false) throw new IllegalStateException(businessInterface.getName() + " is not a business interface");
+      if (found == false) throw new IllegalStateException(businessInterface.getName() + " is not a business interface for container " + this);
 
       for (ProxyFactory factory : proxyDeployer.getProxyFactories())
       {




More information about the jboss-cvs-commits mailing list