[jboss-cvs] JBossAS SVN: r64840 - branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 23 22:24:15 EDT 2007


Author: bdecoste
Date: 2007-08-23 22:24:15 -0400 (Thu, 23 Aug 2007)
New Revision: 64840

Modified:
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java
Log:
[EJBTHREE-1025] fix for valueless @Local and @Remote on bean

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java	2007-08-24 01:07:25 UTC (rev 64839)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java	2007-08-24 02:24:15 UTC (rev 64840)
@@ -26,10 +26,17 @@
 import java.util.Hashtable;
 import java.util.Map;
 
+import javax.ejb.EJBException;
 import javax.ejb.EJBObject;
 import javax.ejb.Handle;
+import javax.ejb.Local;
 import javax.ejb.LocalHome;
+import javax.ejb.Remote;
 import javax.ejb.RemoteHome;
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.aop.Advisor;
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.Dispatcher;
 import org.jboss.aop.MethodInfo;
@@ -109,10 +116,25 @@
    @Override
    public void instantiated()
    {
+      log.info("#### instantiated");
+      
+      checkForDuplicateLocalAndRemoteInterfaces();
+      
       super.instantiated();
- //     proxyDeployer.initializeRemoteBindingMetadata();
- //     proxyDeployer.initializeLocalBindingMetadata();
    }
+   
+   protected void checkForDuplicateLocalAndRemoteInterfaces()
+   {
+      Local local = (Local) resolveAnnotation(Local.class);
+      if (local == null || (local.value() != null && local.value().length > 0))
+         return;
+      
+      Remote remote = (Remote) resolveAnnotation(Remote.class);
+      if (remote == null || (remote.value() != null && remote.value().length > 0))
+         return;
+      
+      throw new EJBException("Local and Remote Interfaces cannot have duplicate interface for bean " + getEjbName());
+   }
 
    @Override
    public void processMetadata(DependencyPolicy dependencyPolicy)
@@ -122,11 +144,12 @@
    
    public void create() throws Exception
    {
+      log.info("#### create");
       super.create();
       
       // moved from instantiated so AspectDomain is processed before proxy metadata
       proxyDeployer.initializeRemoteBindingMetadata();
-      proxyDeployer.initializeLocalBindingMetadata();
+      proxyDeployer.initializeLocalBindingMetadata();   
    }
 
    public void start() throws Exception




More information about the jboss-cvs-commits mailing list