You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by da...@apache.org on 2007/04/12 08:57:02 UTC

svn commit: r527791 [2/2] - in /incubator/openejb/trunk/openejb3: container/openejb-core/src/main/java/org/apache/openejb/ container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ container/openejb-core/src/main/java/org/apache/openej...

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoHandleTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoHandleTests.java?view=diff&rev=527791&r1=527790&r2=527791
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoHandleTests.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/stateless/StatelessPojoHandleTests.java Wed Apr 11 23:56:57 2007
@@ -74,13 +74,8 @@
     public void test02_EJBHome_remove(){
         try{
             ejbHome.remove(ejbHandle);
-            try{
-                ejbObject.businessMethod("Should throw an exception");
-                assertTrue( "Calling business method after removing the EJBObject does not throw an exception", false );
-            } catch (NoSuchObjectException e){
-                assertTrue( true );
-                return;
-            }
+            // you can't really remove a stateless handle
+            ejbObject.businessMethod("Should not throw an exception");
         } catch (Exception e){
             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
         }

Modified: incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBHomeHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBHomeHandler.java?view=diff&rev=527791&r1=527790&r2=527791
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBHomeHandler.java (original)
+++ incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBHomeHandler.java Wed Apr 11 23:56:57 2007
@@ -37,26 +37,8 @@
         throw new ApplicationException(new RemoveException("Session objects are private resources and do not have primary keys"));
     }
 
-    /*
-    * TODO:3: Get a related quote from the specification to add here
-    *
-    * This method is differnt the the stateful and entity behavior because we only want the 
-    * stateless session bean that created the proxy to be invalidated, not all the proxies. Special case
-    * for the stateless session beans.
-    */
     protected Object removeWithHandle(Method method, Object[] args, Object proxy) throws Throwable {
-
-        EJBObjectHandle handle = (EJBObjectHandle) args[0];
-
-        if (handle == null) throw new NullPointerException("The handle is null");
-
-        EJBObjectHandler handler = handle.ejbObjectProxy.getEJBObjectHandler();
-
-        if (!handler.ejb.deploymentID.equals(this.ejb.deploymentID)) {
-            throw new SystemException(new IllegalArgumentException("The handle is not from the same deployment"));
-        }
-        handler.invalidateReference();
-
+        // you can't really remove a stateless handle
         return null;
     }
 

Modified: incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBObjectHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBObjectHandler.java?view=diff&rev=527791&r1=527790&r2=527791
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBObjectHandler.java (original)
+++ incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/StatelessEJBObjectHandler.java Wed Apr 11 23:56:57 2007
@@ -60,9 +60,11 @@
         return isIdentical(method, args, proxy);
     }
 
+    protected void invalidateReference() {
+    }
+
     protected Object remove(Method method, Object[] args, Object proxy) throws Throwable {
-//      checkAuthorization(method);
-        invalidateReference();
+        // you can't really remove a stateless handle
         return null;
     }