You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2007/04/11 07:34:28 UTC

svn commit: r527392 - 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/openejb/conf...

Author: dblevins
Date: Tue Apr 10 22:34:26 2007
New Revision: 527392

URL: http://svn.apache.org/viewvc?view=rev&rev=527392
Log:
Support for multple business interfaces, part 1.  No support in the client package yet.

Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/DeploymentInfo.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/ProxyInfo.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanInfo.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/CrossClassLoaderProxyTest.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/ExtendedInjectionTest.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java
    incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java
    incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/RemoteBean.java
    incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SessionBean.java
    incubator/openejb/trunk/openejb3/container/openejb-jee/src/test/resources/ejb-jar-example1.xml
    incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBObjectHandler.java
    incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/DeploymentInfo.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/DeploymentInfo.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/DeploymentInfo.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/DeploymentInfo.java Tue Apr 10 22:34:26 2007
@@ -94,6 +94,8 @@
 
     public Class getInterface(InterfaceType interfaceType);
 
+    public List<Class> getInterfaces(InterfaceType interfaceType);
+
     public Class getMdbInterface();
 
     public Map<String, String> getActivationProperties();

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/ProxyInfo.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/ProxyInfo.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/ProxyInfo.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/ProxyInfo.java Tue Apr 10 22:34:26 2007
@@ -16,11 +16,14 @@
  */
 package org.apache.openejb;
 
+import java.util.List;
+import java.util.ArrayList;
+
 public class ProxyInfo {
 
     protected DeploymentInfo deploymentInfo;
     protected Object primaryKey;
-    protected Class proxyInterface;
+    protected List<Class> proxyInterface;
     protected RpcContainer beanContainer;
     protected InterfaceType interfaceType;
 
@@ -28,6 +31,10 @@
     }
 
     public ProxyInfo(DeploymentInfo depInfo, Object pk, Class intrfc, RpcContainer container, InterfaceType proxyType) {
+        this(depInfo, pk, asList(intrfc), container, proxyType);
+    }
+
+    public ProxyInfo(DeploymentInfo depInfo, Object pk, List<Class> intrfc, RpcContainer container, InterfaceType proxyType) {
         this.deploymentInfo = depInfo;
         this.primaryKey = pk;
         this.proxyInterface = intrfc;
@@ -35,10 +42,20 @@
         this.beanContainer = container;
     }
 
-    public ProxyInfo(DeploymentInfo depInfo, Object pk, Class intrfc, RpcContainer container) {
+    public ProxyInfo(DeploymentInfo depInfo, Object pk, List<Class> intrfc, RpcContainer container) {
         this(depInfo, pk, intrfc, container, InterfaceType.UNKNOWN);
     }
 
+    public ProxyInfo(DeploymentInfo depInfo, Object pk, Class intrfc, RpcContainer container) {
+        this(depInfo, pk, asList(intrfc), container);
+    }
+
+    private static List asList(Object object){
+        List list = new ArrayList();
+        list.add(object);
+        return list;
+    }
+
     public InterfaceType getInterfaceType() {
         return interfaceType;
     }
@@ -52,6 +69,10 @@
     }
 
     public Class getInterface() {
+        return proxyInterface.get(0);
+    }
+
+    public List<Class> getInterfaces() {
         return proxyInterface;
     }
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java Tue Apr 10 22:34:26 2007
@@ -88,16 +88,17 @@
             local = loadClass(bean.local, "classNotFound.local");
         }
 
-        Class businessLocal = null;
-        if (bean.businessLocal != null) {
-            businessLocal = loadClass(bean.businessLocal, "classNotFound.businessLocal");
+        List<Class> businessLocals = new ArrayList<Class>();
+        for (String businessLocal : bean.businessLocal) {
+            businessLocals.add(loadClass(businessLocal, "classNotFound.businessLocal"));
         }
 
-        Class businessRemote = null;
-        if (bean.businessRemote != null) {
-            businessRemote = loadClass(bean.businessRemote, "classNotFound.businessRemote");
+        List<Class> businessRemotes = new ArrayList<Class>();
+        for (String businessRemote : bean.businessRemote) {
+            businessRemotes.add(loadClass(businessRemote, "classNotFound.businessRemote"));
         }
 
+
         Class primaryKey = null;
         if (ejbType.isEntity() && ((EntityBeanInfo) bean).primKeyClass != null) {
             String className = ((EntityBeanInfo) bean).primKeyClass;
@@ -112,7 +113,7 @@
         DeploymentContext deploymentContext = new DeploymentContext(bean.ejbDeploymentId, cl, root);
         CoreDeploymentInfo deployment;
         if (BeanType.MESSAGE_DRIVEN != ejbType) {
-            deployment = new CoreDeploymentInfo(deploymentContext, ejbClass, home, remote, localhome, local, businessLocal, businessRemote, primaryKey, ejbType);
+            deployment = new CoreDeploymentInfo(deploymentContext, ejbClass, home, remote, localhome, local, businessLocals, businessRemotes, primaryKey, ejbType);
         } else {
             MessageDrivenBeanInfo messageDrivenBeanInfo = (MessageDrivenBeanInfo) bean;
             Class mdbInterface = loadClass(messageDrivenBeanInfo.mdbInterface, "classNotFound.mdbInterface");

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanInfo.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanInfo.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanInfo.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanInfo.java Tue Apr 10 22:34:26 2007
@@ -41,8 +41,8 @@
     public String remote;
     public String localHome;
     public String local;
-    public String businessLocal;
-    public String businessRemote;
+    public final List<String> businessLocal = new ArrayList<String>();
+    public final List<String> businessRemote = new ArrayList<String>();
     public String ejbClass;
     public String ejbName;
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java Tue Apr 10 22:34:26 2007
@@ -80,7 +80,9 @@
             for (InterfaceType type : InterfaceType.values()) {
                 if (type == InterfaceType.UNKNOWN) continue;
 
-                addPossibleEjbMethodPermissions(permissions, ejbName, type.getSpecName(), deployment.getInterface(type));
+                for (Class interfce : deployment.getInterfaces(type)) {
+                    addPossibleEjbMethodPermissions(permissions, ejbName, type.getSpecName(), interfce);
+                }
             }
 
             addDeclaredEjbPermissions(ejbJar, enterpriseBean, null, permissions, policyContext);

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java Tue Apr 10 22:34:26 2007
@@ -518,8 +518,8 @@
 
                         // Anything declared in the xml is also not eligable
                         List<String> declared = new ArrayList<String>();
-                        declared.add(sessionBean.getBusinessLocal());
-                        declared.add(sessionBean.getBusinessRemote());
+                        declared.addAll(sessionBean.getBusinessLocal());
+                        declared.addAll(sessionBean.getBusinessRemote());
                         declared.add(sessionBean.getHome());
                         declared.add(sessionBean.getRemote());
                         declared.add(sessionBean.getLocalHome());
@@ -602,12 +602,12 @@
 
                         for (Class interfce : remotes) {
                             // TODO: This should be turned back into an array
-                            sessionBean.setBusinessRemote(interfce.getName());
+                            sessionBean.addBusinessRemote(interfce.getName());
                         }
 
                         for (Class interfce : locals) {
                             // TODO: This should be turned back into an array
-                            sessionBean.setBusinessLocal(interfce.getName());
+                            sessionBean.addBusinessLocal(interfce.getName());
                         }
                     }
                 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java Tue Apr 10 22:34:26 2007
@@ -454,8 +454,8 @@
         bean.remote = s.getRemote();
         bean.localHome = s.getLocalHome();
         bean.local = s.getLocal();
-        bean.businessLocal = s.getBusinessLocal();
-        bean.businessRemote = s.getBusinessRemote();
+        bean.businessLocal.addAll(s.getBusinessLocal());
+        bean.businessRemote.addAll(s.getBusinessRemote());
         TransactionType txType = s.getTransactionType();
         bean.transactionType = (txType != null)?txType.toString(): TransactionType.CONTAINER.toString();
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java Tue Apr 10 22:34:26 2007
@@ -174,9 +174,13 @@
         deploymentsInApplication.add(bean.ejbDeploymentId);
 
         byInterfaces.put("r=" + bean.remote + ":" + bean.home, bean);
-        byInterfaces.put("r=" + bean.businessRemote + ":" + null, bean);
+        for (String businessLocal : bean.businessLocal) {
+            byInterfaces.put("l=" + businessLocal + ":" + null, bean);
+        }
         byInterfaces.put("l=" + bean.local + ":" + bean.localHome, bean);
-        byInterfaces.put("l=" + bean.businessLocal + ":" + null, bean);
+        for (String businessRemote : bean.businessRemote) {
+            byInterfaces.put("r=" + businessRemote + ":" + null, bean);
+        }
 
         byEjbName.put(bean.ejbName, bean);
         // TODO: DMB: this path part should actually *only* be relative to the app archive,

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java Tue Apr 10 22:34:26 2007
@@ -18,6 +18,8 @@
 
 import java.lang.reflect.Method;
 import java.security.Principal;
+import java.util.List;
+import java.util.ArrayList;
 import javax.ejb.EJBLocalObject;
 import javax.ejb.EJBObject;
 import javax.ejb.SessionContext;
@@ -30,9 +32,11 @@
 import org.apache.openejb.InterfaceType;
 import org.apache.openejb.InternalErrorException;
 import org.apache.openejb.RpcContainer;
+import org.apache.openejb.BeanType;
 import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
 import org.apache.openejb.core.ivm.IntraVmProxy;
 import org.apache.openejb.core.stateless.StatelessEjbObjectHandler;
+import org.apache.openejb.core.stateful.StatefulEjbObjectHandler;
 import org.apache.openejb.spi.SecurityService;
 import org.apache.openejb.util.proxy.ProxyManager;
 
@@ -51,26 +55,26 @@
     }
 
     public EJBLocalObject getEJBLocalObject() throws IllegalStateException {
-        return ((StatelessState) getState()).getEJBLocalObject();
+        return ((SessionState) getState()).getEJBLocalObject();
     }
 
     public EJBObject getEJBObject() throws IllegalStateException {
-        return ((StatelessState) getState()).getEJBObject();
+        return ((SessionState) getState()).getEJBObject();
     }
 
     public MessageContext getMessageContext() throws IllegalStateException {
-        return ((StatelessState) getState()).getMessageContext();
+        return ((SessionState) getState()).getMessageContext();
     }
 
     public Object getBusinessObject(Class aClass) {
-        return ((StatelessState) getState()).getBusinessObject(aClass);
+        return ((SessionState) getState()).getBusinessObject(aClass);
     }
 
     public Class getInvokedBusinessInterface() {
-        return ((StatelessState) getState()).getInvokedBusinessInterface();
+        return ((SessionState) getState()).getInvokedBusinessInterface();
     }
 
-    protected static class StatelessState extends State {
+    protected static class SessionState extends State {
 
         public EJBLocalObject getEJBLocalObject() throws IllegalStateException {
             ThreadContext threadContext = ThreadContext.getThreadContext();
@@ -110,19 +114,35 @@
             ThreadContext threadContext = ThreadContext.getThreadContext();
             DeploymentInfo di = threadContext.getDeploymentInfo();
 
-            InterfaceType interfaceType;
-            if (di.getBusinessLocalInterface() != null && di.getBusinessLocalInterface().getName().equals(interfce.getName())) {
-                interfaceType = InterfaceType.BUSINESS_LOCAL;
-            } else if (di.getBusinessRemoteInterface() != null && di.getBusinessRemoteInterface().getName().equals(interfce.getName())) {
-                interfaceType = InterfaceType.BUSINESS_REMOTE;
-            } else {
-                throw new IllegalArgumentException("Component has no such interface " + interfce.getName());
+
+            InterfaceType interfaceType = di.getInterfaceType(interfce);
+
+            if (interfaceType == null){
+                throw new IllegalArgumentException("Component has no such interface: " + interfce.getName());
+            }
+
+            if (!interfaceType.isBusiness()) {
+                throw new IllegalStateException("Interface is not a business interface for this bean: " + interfce.getName());
             }
 
             try {
-                EjbObjectProxyHandler handler = new StatelessEjbObjectHandler((RpcContainer) di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(), interfaceType);
-                Class[] interfaces = new Class[]{interfce, IntraVmProxy.class};
-                return ProxyManager.newProxyInstance(interfaces, handler);
+                EjbObjectProxyHandler handler;
+                switch(di.getComponentType()){
+                    case STATEFUL: {
+                        handler = new StatefulEjbObjectHandler((RpcContainer) di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(), interfaceType);
+                        break;
+                    }
+                    case STATELESS: {
+                        handler = new StatelessEjbObjectHandler((RpcContainer) di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(), interfaceType);
+                        break;
+                    }
+                    default: throw new IllegalStateException("Bean is not a session bean: "+di.getComponentType());
+                }
+
+                List<Class> interfaces = new ArrayList<Class>();
+                interfaces.addAll(di.getInterfaces(interfaceType));
+                interfaces.add(IntraVmProxy.class);
+                return ProxyManager.newProxyInstance(interfaces.toArray(new Class[]{}), handler);
             } catch (IllegalAccessException iae) {
                 throw new InternalErrorException("Could not create IVM proxy for " + interfce.getName() + " interface", iae);
             }
@@ -142,7 +162,7 @@
     /**
      * Dependency injection methods (e.g., setSessionContext)
      */
-    public static class InjectionStatelessState extends StatelessState {
+    public static class InjectionSessionState extends SessionState {
 
         public EJBLocalObject getEJBLocalObject() throws IllegalStateException {
             throw new IllegalStateException();
@@ -212,7 +232,7 @@
     /**
      * PostConstruct, Pre-Destroy lifecycle callback interceptor methods
      */
-    public static class LifecycleStatelessState extends StatelessState {
+    public static class LifecycleSessionState extends SessionState {
 
         public MessageContext getMessageContext() throws IllegalStateException {
             throw new IllegalStateException();
@@ -271,7 +291,7 @@
      * Business method from business interface or component interface; business
      * method interceptor method
      */
-    public static class BusinessStatelessState extends StatelessState {
+    public static class BusinessSessionState extends SessionState {
 
         public MessageContext getMessageContext() throws IllegalStateException {
             throw new IllegalStateException();
@@ -285,7 +305,7 @@
     /**
      * Timeout callback method
      */
-    public static class TimeoutStatelessState extends StatelessState {
+    public static class TimeoutSessionState extends SessionState {
 
         public Class getInvokedBusinessInterface() {
             throw new IllegalStateException();

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java Tue Apr 10 22:34:26 2007
@@ -80,8 +80,8 @@
     private Class localInterface;
     private Class beanClass;
     private Class pkClass;
-    private Class businessLocal;
-    private Class businessRemote;
+    private final List<Class> businessLocals = new ArrayList<Class>();
+    private final List<Class> businessRemotes = new ArrayList<Class>();
     private Class mdbInterface;
     private Class serviceEndpointInterface;
 
@@ -148,6 +148,18 @@
         }
     }
 
+    public List<Class> getInterfaces(InterfaceType interfaceType) {
+        switch(interfaceType){
+            case BUSINESS_LOCAL: return getBusinessLocalInterfaces();
+            case BUSINESS_REMOTE: return getBusinessRemoteInterfaces();
+            default: {
+                List<Class> interfaces = new ArrayList<Class>();
+                interfaces.add(getInterface(interfaceType));
+                return interfaces;
+            }
+        }
+    }
+
     public InterfaceType getInterfaceType(Class clazz) {
         InterfaceType type = interfaces.get(clazz);
         if (type != null) return type;
@@ -165,7 +177,7 @@
                               Class remoteInterface,
                               Class localHomeInterface,
                               Class localInterface,
-                              Class businessLocal, Class businessRemote, Class pkClass,
+                              List<Class> businessLocals, List<Class> businessRemotes, Class pkClass,
                               BeanType componentType
     ) throws SystemException {
 
@@ -176,8 +188,12 @@
         this.remoteInterface = remoteInterface;
         this.localInterface = localInterface;
         this.localHomeInterface = localHomeInterface;
-        this.businessLocal = businessLocal;
-        this.businessRemote = businessRemote;
+        if (businessLocals != null){
+            this.businessLocals.addAll(businessLocals);
+        }
+        if (businessRemotes != null) {
+            this.businessRemotes.addAll(businessRemotes);
+        }
         this.remoteInterface = remoteInterface;
         this.beanClass = beanClass;
         this.pkClass = pkClass;
@@ -218,10 +234,14 @@
         addInterface(getLocalInterface(), InterfaceType.EJB_LOCAL);
 
         addInterface(DeploymentInfo.BusinessRemoteHome.class, InterfaceType.BUSINESS_REMOTE_HOME);
-        addInterface(getBusinessRemoteInterface(), InterfaceType.BUSINESS_REMOTE);
+        for (Class businessRemote : this.businessRemotes) {
+            addInterface(businessRemote, InterfaceType.BUSINESS_REMOTE);
+        }
 
         addInterface(DeploymentInfo.BusinessLocalHome.class, InterfaceType.BUSINESS_LOCAL_HOME);
-        addInterface(getBusinessLocalInterface(), InterfaceType.BUSINESS_LOCAL);
+        for (Class businessLocal : this.businessLocals) {
+            addInterface(businessLocal, InterfaceType.BUSINESS_LOCAL);
+        }
     }
 
     /**
@@ -389,11 +409,19 @@
     }
 
     public Class getBusinessLocalInterface() {
-        return businessLocal;
+        return businessLocals.size() > 0 ? businessLocals.get(0) : null;
     }
 
     public Class getBusinessRemoteInterface() {
-        return businessRemote;
+        return businessRemotes.size() > 0 ? businessRemotes.get(0) : null;
+    }
+
+    public List<Class> getBusinessLocalInterfaces() {
+        return businessLocals;
+    }
+
+    public List<Class> getBusinessRemoteInterfaces() {
+        return businessRemotes;
     }
 
     public Class getMdbInterface() {
@@ -767,10 +795,12 @@
             mapObjectInterface(localInterface);
             mapHomeInterface(localHomeInterface);
         }
-        if (businessLocal != null){
+
+        for (Class businessLocal : businessLocals) {
             mapObjectInterface(businessLocal);
         }
-        if (businessRemote != null){
+
+        for (Class businessRemote : businessRemotes) {
             mapObjectInterface(businessRemote);
         }
 
@@ -903,15 +933,19 @@
         }
     }
 
-    public Class getObjectInterface(Class homeInterface){
+    public List<Class> getObjectInterface(Class homeInterface){
         if (BusinessLocalHome.class.isAssignableFrom(homeInterface)){
-            return getBusinessLocalInterface();
+            return getBusinessLocalInterfaces();
         } else if (BusinessRemoteHome.class.isAssignableFrom(homeInterface)){
-            return getBusinessRemoteInterface();
+            return getBusinessRemoteInterfaces();
         } else if (EJBLocalHome.class.isAssignableFrom(homeInterface)){
-            return getLocalInterface();
+            List<Class> classes = new ArrayList<Class>();
+            classes.add(getLocalInterface());
+            return classes;
         } else if (EJBHome.class.isAssignableFrom(homeInterface)){
-            return getRemoteInterface();
+            List<Class> classes = new ArrayList<Class>();
+            classes.add(getRemoteInterface());
+            return classes;
         } else {
             throw new IllegalArgumentException("Cannot determine object interface for "+homeInterface);
         }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java Tue Apr 10 22:34:26 2007
@@ -677,7 +677,7 @@
         }
 
         Class callingClass = callMethod.getDeclaringClass();
-        Class objectInterface = deploymentInfo.getObjectInterface(callingClass);
+        List<Class> objectInterface = deploymentInfo.getObjectInterface(callingClass);
         return new ProxyInfo(deploymentInfo, primaryKey, objectInterface, this);
     }
 
@@ -702,7 +702,7 @@
 
             // Determine the proxy type
             Class<?> callingClass = callMethod.getDeclaringClass();
-            Class objectInterface = deploymentInfo.getObjectInterface(callingClass);
+            List<Class> objectInterface = deploymentInfo.getObjectInterface(callingClass);
 
             // create a new ProxyInfo based on the deployment info and primary key
             return new ProxyInfo(deploymentInfo, primaryKey, objectInterface, this);
@@ -731,7 +731,7 @@
             KeyGenerator kg = deploymentInfo.getKeyGenerator();
 
             Class<?> callingClass = callMethod.getDeclaringClass();
-            Class objectInterface = deploymentInfo.getObjectInterface(callingClass);
+            List<Class> objectInterface = deploymentInfo.getObjectInterface(callingClass);
 
             // The following block of code is responsible for returning ProxyInfo object(s) for each
             // matching entity bean found by the query.  If its a multi-value find operation a Vector

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java Tue Apr 10 22:34:26 2007
@@ -24,6 +24,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Vector;
+import java.util.List;
 
 import javax.ejb.EJBAccessException;
 import javax.ejb.EJBHome;
@@ -414,7 +415,7 @@
 
         // return a proxy to the bean
         Class callingClass = callMethod.getDeclaringClass();
-        Class objectInterface = deploymentInfo.getObjectInterface(callingClass);
+        List<Class> objectInterface = deploymentInfo.getObjectInterface(callingClass);
         return new ProxyInfo(deploymentInfo, primaryKey, objectInterface, this);
 
     }
@@ -427,7 +428,7 @@
         Object returnValue = invoke(callMethod, runMethod, args, callContext);
 
         Class callingClass = callMethod.getDeclaringClass();
-        Class objectInterface = deploymentInfo.getObjectInterface(callingClass);
+        List<Class> objectInterface = deploymentInfo.getObjectInterface(callingClass);
 
         /*
         * Find operations return either a single primary key or a collection of primary keys.

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java Tue Apr 10 22:34:26 2007
@@ -22,6 +22,8 @@
 import java.rmi.RemoteException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
 
 import javax.ejb.AccessLocalException;
 import javax.ejb.EJBAccessException;
@@ -91,8 +93,10 @@
             EjbObjectProxyHandler handler = newEjbObjectHandler(proxyInfo.getBeanContainer(), proxyInfo.getPrimaryKey(), proxyInfo.getDeploymentInfo().getDeploymentID(), interfaceType);
             handler.setLocal(isLocal());
             handler.doIntraVmCopy = this.doIntraVmCopy;
-            Class[] interfaces = new Class[]{proxyInfo.getInterface(), IntraVmProxy.class};
-            newProxy = ProxyManager.newProxyInstance(interfaces, handler);
+            List<Class> interfacess = new ArrayList<Class>();
+            interfacess.addAll(proxyInfo.getInterfaces());
+            interfacess.add(IntraVmProxy.class);
+            newProxy = ProxyManager.newProxyInstance(interfacess.toArray(new Class[]{}), handler);
         } catch (IllegalAccessException iae) {
             throw new RuntimeException("Could not create IVM proxy for " + proxyInfo.getInterface() + " interface");
         }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java Tue Apr 10 22:34:26 2007
@@ -163,7 +163,7 @@
     }
 
     public org.apache.openejb.ProxyInfo getProxyInfo() {
-        return new org.apache.openejb.ProxyInfo(getDeploymentInfo(), primaryKey, getDeploymentInfo().getInterface(interfaceType), container, interfaceType);
+        return new org.apache.openejb.ProxyInfo(getDeploymentInfo(), primaryKey, getDeploymentInfo().getInterfaces(interfaceType), container, interfaceType);
     }
 
     protected Object _writeReplace(Object proxy) throws ObjectStreamException {

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java Tue Apr 10 22:34:26 2007
@@ -293,7 +293,7 @@
             instanceManager.poolInstance(primaryKey, instance);
 
             Class callingClass = callMethod.getDeclaringClass();
-            Class objectInterface = deploymentInfo.getObjectInterface(callingClass);
+            List<Class> objectInterface = deploymentInfo.getObjectInterface(callingClass);
             return new ProxyInfo(deploymentInfo, primaryKey, objectInterface, this);
         } finally {
             ThreadContext.exit(oldCallContext);

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java Tue Apr 10 22:34:26 2007
@@ -57,22 +57,22 @@
     }
 
     static {
-        states[Operation.INJECTION.ordinal()] = new InjectionStatelessState();
-        states[Operation.CREATE.ordinal()] = new LifecycleStatelessState();
-        states[Operation.BUSINESS.ordinal()] = new BusinessStatelessState();
+        states[Operation.INJECTION.ordinal()] = new InjectionSessionState();
+        states[Operation.CREATE.ordinal()] = new LifecycleSessionState();
+        states[Operation.BUSINESS.ordinal()] = new BusinessSessionState();
         states[Operation.AFTER_BEGIN.ordinal()] = new BeforeCompletion();
         states[Operation.BEFORE_COMPLETION.ordinal()] = new BeforeCompletion();
         states[Operation.AFTER_COMPLETION.ordinal()] = new AfterCompletion();
-        states[Operation.TIMEOUT.ordinal()] = new TimeoutStatelessState();
-        states[Operation.PRE_DESTROY.ordinal()] = new LifecycleStatelessState();
-        states[Operation.REMOVE.ordinal()] = new LifecycleStatelessState();
+        states[Operation.TIMEOUT.ordinal()] = new TimeoutSessionState();
+        states[Operation.PRE_DESTROY.ordinal()] = new LifecycleSessionState();
+        states[Operation.REMOVE.ordinal()] = new LifecycleSessionState();
     }
 
     /**
      * afterBegin
      * beforeCompletion
      */
-    public static class BeforeCompletion extends StatelessState {
+    public static class BeforeCompletion extends SessionState {
 
         public Class getInvokedBusinessInterface() {
             throw new IllegalStateException();
@@ -90,7 +90,7 @@
     /**
      * afterCompletion
      */
-    public static class AfterCompletion extends StatelessState {
+    public static class AfterCompletion extends SessionState {
         public MessageContext getMessageContext() throws IllegalStateException {
             throw new IllegalStateException();
         }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java Tue Apr 10 22:34:26 2007
@@ -293,7 +293,7 @@
 
     protected ProxyInfo createEJBObject(org.apache.openejb.core.CoreDeploymentInfo deploymentInfo, Method callMethod) {
         Class callingClass = callMethod.getDeclaringClass();
-        Class objectInterface = deploymentInfo.getObjectInterface(callingClass);
+        List<Class> objectInterface = deploymentInfo.getObjectInterface(callingClass);
         return new ProxyInfo(deploymentInfo, null, objectInterface, this);
     }
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java Tue Apr 10 22:34:26 2007
@@ -56,19 +56,19 @@
     /**
      * Business method from web service endpoint
      */
-    private static class BusinessWsStatelessState extends StatelessState {
+    private static class BusinessWsStatelessState extends SessionState {
         public Class getInvokedBusinessInterface() {
             throw new IllegalStateException();
         }
     }
 
     static {
-        states[Operation.INJECTION.ordinal()] = new InjectionStatelessState();
-        states[Operation.CREATE.ordinal()] = new LifecycleStatelessState();
-        states[Operation.BUSINESS.ordinal()] = new BusinessStatelessState();
+        states[Operation.INJECTION.ordinal()] = new InjectionSessionState();
+        states[Operation.CREATE.ordinal()] = new LifecycleSessionState();
+        states[Operation.BUSINESS.ordinal()] = new BusinessSessionState();
         states[Operation.BUSINESS_WS.ordinal()] = new BusinessWsStatelessState();
-        states[Operation.TIMEOUT.ordinal()] = new TimeoutStatelessState();
-        states[Operation.PRE_DESTROY.ordinal()] = new LifecycleStatelessState();
+        states[Operation.TIMEOUT.ordinal()] = new TimeoutSessionState();
+        states[Operation.PRE_DESTROY.ordinal()] = new LifecycleSessionState();
     }
 
 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/CrossClassLoaderProxyTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/CrossClassLoaderProxyTest.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/CrossClassLoaderProxyTest.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/CrossClassLoaderProxyTest.java Tue Apr 10 22:34:26 2007
@@ -244,8 +244,8 @@
         StatelessBean bean = new StatelessBean("widget", WidgetBean.class.getName());
         bean.setRemote(WidgetRemote.class.getName());
         bean.setHome(WidgetHome.class.getName());
-        bean.setBusinessLocal(Widget.class.getName());
-        bean.setBusinessRemote(RemoteWidget.class.getName());
+        bean.addBusinessLocal(Widget.class.getName());
+        bean.addBusinessRemote(RemoteWidget.class.getName());
         bean.addPostConstruct("init");
         bean.addPreDestroy("destroy");
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/ExtendedInjectionTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/ExtendedInjectionTest.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/ExtendedInjectionTest.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/ExtendedInjectionTest.java Tue Apr 10 22:34:26 2007
@@ -91,8 +91,8 @@
     protected void setUp() throws Exception {
         super.setUp();
         StatelessBean bean = new StatelessBean("widget", WidgetBean.class.getName());
-        bean.setBusinessLocal(Widget.class.getName());
-        bean.setBusinessRemote(RemoteWidget.class.getName());
+        bean.addBusinessLocal(Widget.class.getName());
+        bean.addBusinessRemote(RemoteWidget.class.getName());
 
         EnvEntry envEntry = new EnvEntry("homepage", String.class.getName(), "http://people.apache.org/~dblevins/");
         envEntry.getInjectionTarget().add(new InjectionTarget(bean.getEjbClass(), "homepage"));

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java Tue Apr 10 22:34:26 2007
@@ -113,8 +113,8 @@
     protected void setUp() throws Exception {
         super.setUp();
         StatelessBean bean = new StatelessBean("widget", WidgetBean.class.getName());
-        bean.setBusinessLocal(Widget.class.getName());
-        bean.setBusinessRemote(RemoteWidget.class.getName());
+        bean.addBusinessLocal(Widget.class.getName());
+        bean.addBusinessRemote(RemoteWidget.class.getName());
         bean.addPostConstruct("init");
         bean.addPreDestroy("destroy");
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EntityBean.java Tue Apr 10 22:34:26 2007
@@ -497,12 +497,12 @@
         return this.securityRoleRef;
     }
 
-    public String getBusinessLocal() {
-        return null;
+    public List<String> getBusinessLocal() {
+        return Collections.EMPTY_LIST;
     }
 
-    public String getBusinessRemote() {
-        return null;
+    public List<String> getBusinessRemote() {
+        return Collections.EMPTY_LIST;
     }
 
     public SecurityIdentity getSecurityIdentity() {

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/RemoteBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/RemoteBean.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/RemoteBean.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/RemoteBean.java Tue Apr 10 22:34:26 2007
@@ -42,7 +42,7 @@
 
     public List<SecurityRoleRef> getSecurityRoleRef();
 
-    String getBusinessLocal();
+    List<String> getBusinessLocal();
 
-    String getBusinessRemote();
+    List<String> getBusinessRemote();
 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SessionBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SessionBean.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SessionBean.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SessionBean.java Tue Apr 10 22:34:26 2007
@@ -145,9 +145,9 @@
     protected String localHome;
     protected String local;
     @XmlElement(name = "business-local")
-    protected String businessLocal;
+    protected List<String> businessLocal;
     @XmlElement(name = "business-remote")
-    protected String businessRemote;
+    protected List<String> businessRemote;
     @XmlElement(name = "service-endpoint")
     protected String serviceEndpoint;
     @XmlElement(name = "ejb-class")
@@ -334,20 +334,28 @@
         this.local = value;
     }
 
-    public String getBusinessLocal() {
+    public List<String> getBusinessLocal() {
+        if (businessLocal == null){
+            businessLocal = new ArrayList<String>();
+        }
         return businessLocal;
     }
 
-    public void setBusinessLocal(String businessLocal) {
-        this.businessLocal = businessLocal;
+    public void addBusinessLocal(String businessLocal) {
+        if (businessLocal == null) return;
+        getBusinessLocal().add(businessLocal);
     }
 
-    public String getBusinessRemote() {
+    public List<String> getBusinessRemote() {
+        if (businessRemote == null){
+            businessRemote = new ArrayList<String>();
+        }
         return businessRemote;
     }
 
-    public void setBusinessRemote(String businessRemote) {
-        this.businessRemote = businessRemote;
+    public void addBusinessRemote(String businessRemote) {
+        if (businessRemote == null) return;
+        getBusinessRemote().add(businessRemote);
     }
 
     public String getServiceEndpoint() {

Modified: incubator/openejb/trunk/openejb3/container/openejb-jee/src/test/resources/ejb-jar-example1.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-jee/src/test/resources/ejb-jar-example1.xml?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-jee/src/test/resources/ejb-jar-example1.xml (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-jee/src/test/resources/ejb-jar-example1.xml Tue Apr 10 22:34:26 2007
@@ -65,7 +65,9 @@
             <local-home>token</local-home>
             <local>token</local>
             <business-local>token</business-local>
+            <business-local>token2</business-local>
             <business-remote>token</business-remote>
+            <business-remote>token2</business-remote>
             <service-endpoint>token</service-endpoint>
             <ejb-class>token</ejb-class>
             <session-type>Stateful</session-type>

Modified: incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBObjectHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBObjectHandler.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBObjectHandler.java (original)
+++ incubator/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBObjectHandler.java Tue Apr 10 22:34:26 2007
@@ -112,7 +112,6 @@
          */
 
         try {
-            System.out.println("method = " + m.getDeclaringClass() + "."+m.getName());
             String methodName = m.getName();
             if (m.getDeclaringClass().equals(Object.class)) {
                 if (m.equals(TOSTRING)) {

Modified: incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java?view=diff&rev=527392&r1=527391&r2=527392
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java (original)
+++ incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/main/java/org/apache/openejb/server/ejbd/EjbRequestHandler.java Tue Apr 10 22:34:26 2007
@@ -201,22 +201,6 @@
                 req.getPrimaryKey()
         );
 
-        if (result instanceof ProxyInfo) {
-            ProxyInfo info = (ProxyInfo) result;
-
-            if (EJBObject.class.isAssignableFrom(info.getInterface())) {
-                result = this.daemon.clientObjectFactory._getEJBObject(call, info);
-            } else if (EJBHome.class.isAssignableFrom(info.getInterface())) {
-                result = this.daemon.clientObjectFactory._getEJBHome(call, info);
-            } else {
-
-                result = new RemoteException("The container returned a ProxyInfo object that is neither a javax.ejb.EJBObject or javax.ejb.EJBHome: " + info.getInterface());
-                this.daemon.logger.error(req + "The container returned a ProxyInfo object that is neither a javax.ejb.EJBObject or javax.ejb.EJBHome: " + info.getInterface());
-                res.setResponse(ResponseCodes.EJB_SYS_EXCEPTION, result);
-                return;
-            }
-        }
-
         res.setResponse(ResponseCodes.EJB_OK, result);
     }
 
@@ -230,22 +214,6 @@
                 req.getMethodParameters(),
                 req.getPrimaryKey()
         );
-
-        if (result instanceof ProxyInfo) {
-            ProxyInfo info = (ProxyInfo) result;
-
-            if (EJBObject.class.isAssignableFrom(info.getInterface())) {
-                result = this.daemon.clientObjectFactory._getEJBObject(call, info);
-            } else if (EJBHome.class.isAssignableFrom(info.getInterface())) {
-                result = this.daemon.clientObjectFactory._getEJBHome(call, info);
-            } else {
-
-                result = new RemoteException("The container returned a ProxyInfo object that is neither a javax.ejb.EJBObject or javax.ejb.EJBHome: " + info.getInterface());
-                this.daemon.logger.error(req + "The container returned a ProxyInfo object that is neither a javax.ejb.EJBObject or javax.ejb.EJBHome: " + info.getInterface());
-                res.setResponse(ResponseCodes.EJB_SYS_EXCEPTION, result);
-                return;
-            }
-        }
 
         res.setResponse(ResponseCodes.EJB_OK, result);
     }