[jboss-cvs] JBossAS SVN: r94116 - projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 29 15:28:51 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-09-29 15:28:51 -0400 (Tue, 29 Sep 2009)
New Revision: 94116

Modified:
   projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossSessionObjectReference.java
Log:
WBRI-398

Modified: projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossSessionObjectReference.java
===================================================================
--- projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossSessionObjectReference.java	2009-09-29 18:32:20 UTC (rev 94115)
+++ projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossSessionObjectReference.java	2009-09-29 19:28:51 UTC (rev 94116)
@@ -27,6 +27,7 @@
    private final DeploymentUnit deploymentUnit;
    private final String ejbClassName;
    private final String jndiName;
+   private final boolean stateful;
    
    boolean removed = false;
     
@@ -45,7 +46,7 @@
       }
       this.deploymentUnit = ((JBossSessionBeanDescriptorAdaptor<?>) descriptor).getDeploymentUnit();
       this.ejbClassName = descriptor.getBeanClass().getSimpleName();
-     
+      this.stateful = descriptor.isStateful();
    }
    
    @SuppressWarnings("unchecked")
@@ -56,8 +57,15 @@
    
    public void remove()
    {
-      getEndpoint().getSessionFactory().destroySession(id);
-      removed = true;
+      if (stateful)
+      {
+         getEndpoint().getSessionFactory().destroySession(id);
+         removed = true;
+      }
+      else
+      {
+         throw new UnsupportedOperationException("Can only remove stateful beans " + this );
+      }
    }
    
    private Endpoint getEndpoint()




More information about the jboss-cvs-commits mailing list