[jboss-cvs] JBossAS SVN: r67509 - in branches/Branch_4_2/ejb3/src: main/org/jboss/ejb3/stateful and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 27 15:25:41 EST 2007


Author: bdecoste
Date: 2007-11-27 15:25:40 -0500 (Tue, 27 Nov 2007)
New Revision: 67509

Modified:
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/LocalProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java
Log:
[EJBTHREE-1019] fix for invoking local home remotely

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/LocalProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/LocalProxy.java	2007-11-27 19:48:07 UTC (rev 67508)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/LocalProxy.java	2007-11-27 20:25:40 UTC (rev 67509)
@@ -45,11 +45,11 @@
    protected String containerGuid;
    protected String proxyName;
 
-   protected LocalProxy()
+   public LocalProxy()
    {
    }
 
-   protected LocalProxy(Container container)
+   public LocalProxy(Container container)
    {
       this.container = container;
       this.containerGuid = Ejb3Registry.guid(container);

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java	2007-11-27 19:48:07 UTC (rev 67508)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalHomeProxy.java	2007-11-27 20:25:40 UTC (rev 67509)
@@ -35,8 +35,9 @@
 {
    private static final long serialVersionUID = -9026021347498876589L;
 
-   protected StatefulLocalHomeProxy()
+   public StatefulLocalHomeProxy()
    {
+      super();
    }
 
    public StatefulLocalHomeProxy(Container container)

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2007-11-27 19:48:07 UTC (rev 67508)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2007-11-27 20:25:40 UTC (rev 67509)
@@ -25,19 +25,18 @@
 import java.util.Arrays;
 import java.util.List;
 
-import javax.ejb.EJBLocalObject;
-import javax.ejb.EJBObject;
 import javax.ejb.LocalHome;
 
 import org.jboss.annotation.ejb.LocalBinding;
 import org.jboss.aop.Advisor;
 import org.jboss.ejb3.EJBContainer;
 import org.jboss.ejb3.JBossProxy;
-import org.jboss.ejb3.NonSerializableFactory;
 import org.jboss.ejb3.ProxyFactoryHelper;
 import org.jboss.logging.Logger;
 
+import org.jboss.naming.Util;
 
+
 /**
  * Comment
  *
@@ -101,12 +100,15 @@
       super.start();
       EJBContainer statelessContainer = (EJBContainer) getContainer();
       LocalHome localHome = (LocalHome) statelessContainer.resolveAnnotation(LocalHome.class);
+    
       if (localHome != null && !bindHomeAndBusinessTogether(statelessContainer))
       {
+         StatelessLocalProxy proxy = new StatelessLocalProxy(getContainer());
+         
          Class[] interfaces = {localHome.value()};
          Object homeProxy = java.lang.reflect.Proxy.newProxyInstance(getContainer().getBeanClass().getClassLoader(),
-                                                                     interfaces, new StatelessLocalProxy(getContainer()));
-         NonSerializableFactory.rebind(getContainer().getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(getContainer()), homeProxy);
+                                                                     interfaces, proxy);
+         Util.rebind(getContainer().getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(getContainer()), homeProxy);
       }
    }
 
@@ -118,7 +120,7 @@
       LocalHome localHome = (LocalHome) statelessContainer.resolveAnnotation(LocalHome.class);
       if (localHome != null && !bindHomeAndBusinessTogether(statelessContainer))
       {
-         NonSerializableFactory.unbind(getContainer().getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(getContainer()));
+         Util.unbind(getContainer().getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(getContainer()));
       }
    }
 

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java	2007-11-27 19:48:07 UTC (rev 67508)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java	2007-11-27 20:25:40 UTC (rev 67509)
@@ -143,10 +143,8 @@
          bean.localHomeCall();
          fail("should not be allowed to call local interface remotely");
       }
-      catch (javax.naming.NamingException e)
+      catch (javax.ejb.EJBException e)
       {
-         if (e.getCause() == null || !(e.getCause() instanceof javax.ejb.EJBException))
-            fail("should not be allowed to call local interface remotely");
       }
    }
    




More information about the jboss-cvs-commits mailing list