[jboss-cvs] JBossAS SVN: r74131 - in projects/ejb3/trunk/proxy/src: main/java/org/jboss/ejb3/proxy/factory/session and 11 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 5 06:33:38 EDT 2008


Author: ALRubinger
Date: 2008-06-05 06:33:36 -0400 (Thu, 05 Jun 2008)
New Revision: 74131

Added:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulLocalProxyInvocationHandler.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandlerBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulRemoteProxyInvocationHandler.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessLocalProxyInvocationHandler.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandlerBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessRemoteProxyInvocationHandler.java
Removed:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/ProxyInvocationHandlerMetadata.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandler.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandler.java
Modified:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactory.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionLocalProxyFactory.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionLocalProxyFactory.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionProxyFactoryBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionRemoteProxyFactory.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatefulSessionRegistrar.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatelessSessionRegistrar.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/session/stateful/StatefulSessionProxyObjectFactory.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatefulContainer.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SfsbProxyEqualityTestCase.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java
Log:
[EJBTHREE-1394][EJBTHREE-1402] Allow for more than one remote invocation, correct logic to determine local/remote invocations

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactory.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactory.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -44,6 +44,14 @@
     */
    String getName();
 
+   /**
+    * Returns the name of the InvokableContext (container)
+    * upon which Proxies will invoke
+    * 
+    * @return
+    */
+   String getContainerName();
+
    // --------------------------------------------------------------------------------||
    // Lifecycle Methods --------------------------------------------------------------||
    // --------------------------------------------------------------------------------||

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryBase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -55,6 +55,8 @@
     */
    private String name;
 
+   private String containerName;
+
    private ClassLoader classloader;
 
    // --------------------------------------------------------------------------------||
@@ -65,13 +67,16 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param classloader The ClassLoader associated with the EJBContainer
     *       for which this ProxyFactory is to generate Proxies
     */
-   public ProxyFactoryBase(final String name, final ClassLoader classloader)
+   public ProxyFactoryBase(final String name, final String containerName, final ClassLoader classloader)
    {
       // Set properties
       this.setName(name);
+      this.setContainerName(containerName);
       this.setClassLoader(classloader);
    }
 
@@ -196,4 +201,14 @@
       this.name = name;
    }
 
+   public String getContainerName()
+   {
+      return containerName;
+   }
+
+   public void setContainerName(String containerName)
+   {
+      this.containerName = containerName;
+   }
+
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -22,7 +22,6 @@
 package org.jboss.ejb3.proxy.factory.session;
 
 import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -38,7 +37,6 @@
 import org.jboss.ejb3.common.string.StringUtils;
 import org.jboss.ejb3.proxy.factory.ProxyFactoryBase;
 import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
-import org.jboss.ejb3.proxy.handler.session.stateless.StatelessProxyInvocationHandler;
 import org.jboss.ejb3.proxy.intf.SessionProxy;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
@@ -98,15 +96,17 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param metadata The metadata representing this Session Bean
     * @param classloader The ClassLoader associated with the SessionContainer
     *       for which this ProxyFactory is to generate Proxies
     */
-   public SessionProxyFactoryBase(final String name, final JBossSessionBeanMetaData metadata,
-         final ClassLoader classloader)
+   public SessionProxyFactoryBase(final String name, final String containerName,
+         final JBossSessionBeanMetaData metadata, final ClassLoader classloader)
    {
       // Call Super
-      super(name, classloader);
+      super(name, containerName, classloader);
 
       // Set Metadata
       this.setMetadata(metadata);
@@ -126,11 +126,13 @@
     */
    public Object createProxyHome()
    {
+      // Create a new InvocationHandler
+      SessionProxyInvocationHandler handler = this.createInvocationHandler((String) null);
+
       try
       {
          // Create a new Proxy instance, and return
-         return this.getConstructorProxyHome().newInstance(
-               this.getInvocationHandlerConstructor().newInstance((String) null));
+         return this.getConstructorProxyHome().newInstance(handler);
 
       }
       catch (Throwable t)
@@ -158,10 +160,13 @@
       assert constructor != null : "Constructor for Default Proxy was null; perhaps the "
             + SessionProxyFactory.class.getSimpleName() + " was not properly started?";
 
+      // Create a new InvocationHandler
+      SessionProxyInvocationHandler handler = this.createInvocationHandler((String) null);
+
       try
       {
          // Create a new Proxy instance, and return
-         return constructor.newInstance(this.getInvocationHandlerConstructor().newInstance((String) null));
+         return constructor.newInstance(handler);
       }
       catch (Throwable t)
       {
@@ -193,8 +198,8 @@
          assert constructor != null : "No business proxy constructor for \"" + businessInterfaceName
                + "\" was found; not created at start() properly?  Bad value bound as RefAddr in JNDI?";
 
-         // Create new Invocation Handler
-         SessionProxyInvocationHandler handler = this.getInvocationHandlerConstructor().newInstance(businessInterfaceName);
+         // Create a new InvocationHandler
+         SessionProxyInvocationHandler handler = this.createInvocationHandler(businessInterfaceName);
 
          // Create a new Proxy instance, and return
          return constructor.newInstance(handler);
@@ -214,10 +219,13 @@
     */
    public Object createProxyEjb2x()
    {
+      // Create a new InvocationHandler
+      SessionProxyInvocationHandler handler = this.createInvocationHandler((String) null);
+
       try
       {
          // Create a new Proxy instance, and return
-         return this.getConstructorProxyEjb2x().newInstance(this.getInvocationHandlerConstructor().newInstance());
+         return this.getConstructorProxyEjb2x().newInstance(handler);
       }
       catch (Throwable t)
       {
@@ -591,7 +599,7 @@
     * 
     * @return
     */
-   protected abstract Constructor<? extends SessionProxyInvocationHandler> getInvocationHandlerConstructor();
+   protected abstract SessionProxyInvocationHandler createInvocationHandler(String businessInterfaceName);
 
    // --------------------------------------------------------------------------------||
    // Accessors / Mutators -----------------------------------------------------------||

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionLocalProxyFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionLocalProxyFactory.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionLocalProxyFactory.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -24,6 +24,8 @@
 import java.util.Set;
 
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
+import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
+import org.jboss.ejb3.proxy.handler.session.stateful.StatefulLocalProxyInvocationHandler;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
 /**
@@ -48,15 +50,17 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param metadata The metadata representing this SLSB
     * @param classloader The ClassLoader associated with the StatelessContainer
     *       for which this ProxyFactory is to generate Proxies
     */
-   public StatefulSessionLocalProxyFactory(final String name, final JBossSessionBeanMetaData metadata,
-         final ClassLoader classloader)
+   public StatefulSessionLocalProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData metadata, final ClassLoader classloader)
    {
       // Call Super
-      super(name, metadata, classloader);
+      super(name, containerName, metadata, classloader);
    }
 
    // --------------------------------------------------------------------------------||
@@ -94,4 +98,18 @@
    {
       return this.getMetadata().getLocal();
    }
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @Override
+   protected SessionProxyInvocationHandler createInvocationHandler(String businessInterfaceName)
+   {
+      // Create
+      SessionProxyInvocationHandler handler = new StatefulLocalProxyInvocationHandler(businessInterfaceName);
+
+      // Return
+      return handler;
+   }
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -21,12 +21,10 @@
  */
 package org.jboss.ejb3.proxy.factory.session.stateful;
 
-import java.lang.reflect.Constructor;
 import java.util.Set;
 
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactoryBase;
-import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandler;
 import org.jboss.ejb3.proxy.intf.StatefulSessionProxy;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
@@ -48,15 +46,17 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param metadata The metadata representing this SFSB
     * @param classloader The ClassLoader associated with the StatelessContainer
     *       for which this ProxyFactory is to generate Proxies
     */
-   public StatefulSessionProxyFactoryBase(final String name, final JBossSessionBeanMetaData metadata,
-         final ClassLoader classloader)
+   public StatefulSessionProxyFactoryBase(final String name, final String containerName,
+         final JBossSessionBeanMetaData metadata, final ClassLoader classloader)
    {
       // Call Super
-      super(name, metadata, classloader);
+      super(name, containerName, metadata, classloader);
    }
 
    // --------------------------------------------------------------------------------||
@@ -78,27 +78,6 @@
    }
 
    /**
-    * Returns the Constructor of the SessionProxyInvocationHandler to be used in 
-    * instanciating new handlers to specify in Proxy Creation
-    * 
-    * @return
-    */
-   @Override
-   protected final Constructor<StatefulProxyInvocationHandler> getInvocationHandlerConstructor()
-   {
-      try
-      {
-         return StatefulProxyInvocationHandler.class.getConstructor(new Class[]
-         {String.class});
-      }
-      catch (NoSuchMethodException e)
-      {
-         throw new RuntimeException("Could not find Constructor with one String argument for "
-               + StatefulProxyInvocationHandler.class.getName(), e);
-      }
-   }
-
-   /**
     * Returns Proxy interfaces common to all Proxies generated
     * by this ProxyFactory
     * 

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -24,6 +24,8 @@
 import java.util.Set;
 
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
+import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
+import org.jboss.ejb3.proxy.handler.session.stateful.StatefulRemoteProxyInvocationHandler;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
@@ -46,6 +48,15 @@
    private static final String STACK_NAME_STATEFUL_SESSION_CLIENT_INTERCEPTORS = "StatefulSessionClientInterceptors";
 
    // --------------------------------------------------------------------------------||
+   // Instance Members ---------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * URL to be used in Remoting
+    */
+   private String url;
+
+   // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
@@ -53,15 +64,19 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param metadata The metadata representing this SFSB
     * @param classloader The ClassLoader associated with the StatelessContainer
     *       for which this ProxyFactory is to generate Proxies
+    * @param url The URL to use for remoting
     */
-   public StatefulSessionRemoteProxyFactory(final String name, final JBossSessionBeanMetaData metadata,
-         final ClassLoader classloader)
+   public StatefulSessionRemoteProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData metadata, final ClassLoader classloader, final String url)
    {
       // Call Super
-      super(name, metadata, classloader);
+      super(name, containerName, metadata, classloader);
+      this.setUrl(url);
    }
 
    // --------------------------------------------------------------------------------||
@@ -111,4 +126,33 @@
    {
       return StatefulSessionRemoteProxyFactory.STACK_NAME_STATEFUL_SESSION_CLIENT_INTERCEPTORS;
    }
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @Override
+   protected SessionProxyInvocationHandler createInvocationHandler(String businessInterfaceName)
+   {
+      // Create
+      SessionProxyInvocationHandler handler = new StatefulRemoteProxyInvocationHandler(businessInterfaceName, this
+            .getUrl());
+
+      // Return
+      return handler;
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Accessors / Mutators -----------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   public String getUrl()
+   {
+      return url;
+   }
+
+   public void setUrl(String url)
+   {
+      this.url = url;
+   }
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionLocalProxyFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionLocalProxyFactory.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionLocalProxyFactory.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -24,6 +24,8 @@
 import java.util.Set;
 
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
+import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
+import org.jboss.ejb3.proxy.handler.session.stateless.StatelessLocalProxyInvocationHandler;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
@@ -51,15 +53,17 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param metadata The metadata representing this SLSB
     * @param classloader The ClassLoader associated with the StatelessContainer
     *       for which this ProxyFactory is to generate Proxies
     */
-   public StatelessSessionLocalProxyFactory(final String name, final JBossSessionBeanMetaData metadata,
-         final ClassLoader classloader)
+   public StatelessSessionLocalProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData metadata, final ClassLoader classloader)
    {
       // Call Super
-      super(name, metadata, classloader);
+      super(name, containerName, metadata, classloader);
    }
 
    // --------------------------------------------------------------------------------||
@@ -97,4 +101,18 @@
    {
       return this.getMetadata().getLocal();
    }
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @Override
+   protected SessionProxyInvocationHandler createInvocationHandler(String businessInterfaceName)
+   {
+      // Create
+      SessionProxyInvocationHandler handler = new StatelessLocalProxyInvocationHandler(businessInterfaceName);
+
+      // Return
+      return handler;
+   }
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionProxyFactoryBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionProxyFactoryBase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionProxyFactoryBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -21,12 +21,10 @@
  */
 package org.jboss.ejb3.proxy.factory.session.stateless;
 
-import java.lang.reflect.Constructor;
 import java.util.Set;
 
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactoryBase;
-import org.jboss.ejb3.proxy.handler.session.stateless.StatelessProxyInvocationHandler;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
@@ -47,12 +45,6 @@
    private static final Logger log = Logger.getLogger(StatelessSessionProxyFactoryBase.class);
 
    // --------------------------------------------------------------------------------||
-   // Instance Members ---------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   private Constructor<StatelessProxyInvocationHandler> invocationHandlerConstructor;
-
-   // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
@@ -60,15 +52,17 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param metadata The metadata representing this SLSB
     * @param classloader The ClassLoader associated with the StatelessContainer
     *       for which this ProxyFactory is to generate Proxies
     */
-   public StatelessSessionProxyFactoryBase(final String name, final JBossSessionBeanMetaData metadata,
-         final ClassLoader classloader)
+   public StatelessSessionProxyFactoryBase(final String name, final String containerName,
+         final JBossSessionBeanMetaData metadata, final ClassLoader classloader)
    {
       // Call Super
-      super(name, metadata, classloader);
+      super(name, containerName, metadata, classloader);
    }
 
    // --------------------------------------------------------------------------------||
@@ -88,45 +82,4 @@
    {
       return this.getReturnTypesFromCreateMethods(homeInterface, true);
    }
-
-   /**
-    * Returns the Constructor of the SessionProxyInvocationHandler to be used in 
-    * instanciating new handlers to specify in Proxy Creation
-    * 
-    * @return
-    */
-   @Override
-   protected final Constructor<StatelessProxyInvocationHandler> getInvocationHandlerConstructor()
-   {
-      // If not created
-      if (this.invocationHandlerConstructor == null)
-      {
-         // Initialize
-         Constructor<StatelessProxyInvocationHandler> ctor = null;
-         try
-         {
-            // Create
-            Class<?>[] args = new Class[]
-            {String.class};
-            log.debug("Creating " + Constructor.class.getSimpleName() + " to "
-                  + StatelessProxyInvocationHandler.class.getName() + " with arguments: " + args);
-            ctor = StatelessProxyInvocationHandler.class.getConstructor(args);
-         }
-         catch (NoSuchMethodException e)
-         {
-            throw new RuntimeException("Could not find Constructor with one String argument for "
-                  + StatelessProxyInvocationHandler.class.getName(), e);
-         }
-         this.setInvocationHandlerConstructor(ctor);
-      }
-
-      // Return
-      return this.invocationHandlerConstructor;
-   }
-
-   private void setInvocationHandlerConstructor(
-         Constructor<StatelessProxyInvocationHandler> invocationHandlerConstructor)
-   {
-      this.invocationHandlerConstructor = invocationHandlerConstructor;
-   }
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionRemoteProxyFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionRemoteProxyFactory.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateless/StatelessSessionRemoteProxyFactory.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -24,6 +24,8 @@
 import java.util.Set;
 
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
+import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
+import org.jboss.ejb3.proxy.handler.session.stateless.StatelessRemoteProxyInvocationHandler;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
@@ -46,6 +48,15 @@
    private static final String STACK_NAME_STATELESS_SESSION_CLIENT_INTERCEPTORS = "StatelessSessionClientInterceptors";
 
    // --------------------------------------------------------------------------------||
+   // Instance Members ---------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * URL to be used in Remoting
+    */
+   private String url;
+
+   // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
@@ -53,15 +64,19 @@
     * Constructor
     * 
     * @param name The unique name for this ProxyFactory
+    * @param containerName The name of the InvokableContext (container)
+    *   upon which Proxies will invoke
     * @param metadata The metadata representing this SLSB
     * @param classloader The ClassLoader associated with the StatelessContainer
     *       for which this ProxyFactory is to generate Proxies
+    * @param url The URL to use for remoting
     */
-   public StatelessSessionRemoteProxyFactory(final String name, final JBossSessionBeanMetaData metadata,
-         final ClassLoader classloader)
+   public StatelessSessionRemoteProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData metadata, final ClassLoader classloader, final String url)
    {
       // Call Super
-      super(name, metadata, classloader);
+      super(name, containerName, metadata, classloader);
+      this.setUrl(url);
    }
 
    // --------------------------------------------------------------------------------||
@@ -110,5 +125,33 @@
    protected String getInterceptorStackName()
    {
       return StatelessSessionRemoteProxyFactory.STACK_NAME_STATELESS_SESSION_CLIENT_INTERCEPTORS;
+   } // --------------------------------------------------------------------------------||
+
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @Override
+   protected SessionProxyInvocationHandler createInvocationHandler(String businessInterfaceName)
+   {
+      // Create
+      SessionProxyInvocationHandler handler = new StatelessRemoteProxyInvocationHandler(businessInterfaceName, this
+            .getUrl());
+
+      // Return
+      return handler;
    }
+
+   // --------------------------------------------------------------------------------||
+   // Accessors / Mutators -----------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   public String getUrl()
+   {
+      return url;
+   }
+
+   public void setUrl(String url)
+   {
+      this.url = url;
+   }
 }

Deleted: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/ProxyInvocationHandlerMetadata.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/ProxyInvocationHandlerMetadata.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/ProxyInvocationHandlerMetadata.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.proxy.handler;
-
-import org.jboss.remoting.InvokerLocator;
-
-/**
- * ProxyInvocationHandlerMetadata
- * 
- * Contains Thread-specific Metadata for use in 
- * Proxy Invocation Handlers, to provide
- * additional context than that represented by 
- * the API
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public abstract class ProxyInvocationHandlerMetadata
-{
-   // --------------------------------------------------------------------------------||
-   // Class Members ------------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   /**
-    * The InvokerLocator to use for Remoting for this Invocation
-    */
-   public static ThreadLocal<InvokerLocator> INVOKER_LOCATOR = new ThreadLocal<InvokerLocator>();
-}

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -24,6 +24,7 @@
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -32,12 +33,11 @@
 import org.jboss.aspects.remoting.PojiProxy;
 import org.jboss.ejb3.common.registrar.spi.Ejb3Registrar;
 import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
-import org.jboss.ejb3.common.registrar.spi.NotBoundException;
 import org.jboss.ejb3.common.string.StringUtils;
+import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 import org.jboss.ejb3.proxy.handler.NotEligibleForDirectInvocationException;
 import org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase;
-import org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerMetadata;
 import org.jboss.ejb3.proxy.lang.SerializableMethod;
 import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
@@ -112,29 +112,8 @@
       /*
        * Obtain the Container
        */
-      InvokableContext<?> container = null;
+      InvokableContext<?> container = this.getContainer();
 
-      // Attempt to obtain locally
-      try
-      {
-         Object obj = Ejb3RegistrarLocator.locateRegistrar().lookup(this.getContainerName());
-         assert obj instanceof InvokableContext : "Container retrieved from " + Ejb3Registrar.class.getSimpleName()
-               + " was not of expected type " + InvokableContext.class.getName() + " but was instead " + obj;
-         container = (InvokableContext<?>) obj;
-      }
-      // Remote
-      catch (NotBoundException nbe)
-      {
-         // Create a POJI Proxy to the Container
-         InvokerLocator locator = ProxyInvocationHandlerMetadata.INVOKER_LOCATOR.get();
-         Interceptor[] interceptors =
-         {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
-         PojiProxy handler = new PojiProxy(this.getContainerName(), locator, interceptors);
-         Class<?>[] interfaces = new Class<?>[]
-         {InvokableContext.class};
-         container = (InvokableContext<?>) Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, handler);
-      }
-
       /*
        * Invoke
        */
@@ -144,13 +123,70 @@
       log.debug("Invoking: " + methodToInvoke + " with arguments " + args + "...");
       Object result = container.invoke(proxy, methodToInvoke, args);
 
-      // Remove the Invoker Locator from this Thread, we've invoked already
-      //TODO Revisit/rethink this pattern; the InvokerLocator is set in the ObjectFactory, 
-      // yet removed after invocation in the handler here? 
-      ProxyInvocationHandlerMetadata.INVOKER_LOCATOR.set(null);
-
       // Return
       return result;
 
    }
+
+   /**
+    * Returns the container housed locally
+    * 
+    * @return
+    */
+   protected InvokableContext<? extends ContainerMethodInvocation> getContainerLocally()
+   {
+      // Lookup
+      Object obj = Ejb3RegistrarLocator.locateRegistrar().lookup(this.getContainerName());
+
+      // Ensure of correct type
+      assert obj instanceof InvokableContext : "Container retrieved from " + Ejb3Registrar.class.getSimpleName()
+            + " was not of expected type " + InvokableContext.class.getName() + " but was instead " + obj;
+
+      // Return
+      return (InvokableContext<?>) obj;
+   }
+
+   /**
+    * Creates and returns a Remoting Proxy to invoke upon the container
+    * 
+    * @param url The location of the remote host holding the Container
+    * @return
+    */
+   protected InvokableContext<? extends ContainerMethodInvocation> createRemoteProxyToContainer(String url)
+   {
+      // Create an InvokerLocator
+      InvokerLocator locator = null;
+      try
+      {
+         locator = new InvokerLocator(url);
+      }
+      catch (MalformedURLException e)
+      {
+         throw new RuntimeException("Could not create " + InvokerLocator.class.getSimpleName() + " to url \"" + url
+               + "\"", e);
+      }
+
+      // Create a POJI Proxy to the Container
+      Interceptor[] interceptors =
+      {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
+      PojiProxy handler = new PojiProxy(this.getContainerName(), locator, interceptors);
+      Class<?>[] interfaces = new Class<?>[]
+      {InvokableContext.class};
+      InvokableContext<? extends ContainerMethodInvocation> container = (InvokableContext<?>) Proxy.newProxyInstance(
+            interfaces[0].getClassLoader(), interfaces, handler);
+
+      // Return
+      return container;
+   }
+
+   // ------------------------------------------------------------------------------||
+   // Contracts --------------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /**
+    * Obtains the Container upon which this Proxy should invoke
+    * 
+    * @return
+    */
+   protected abstract InvokableContext<? extends ContainerMethodInvocation> getContainer();
 }

Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulLocalProxyInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulLocalProxyInvocationHandler.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulLocalProxyInvocationHandler.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.proxy.handler.session.stateful;
+
+import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
+import org.jboss.ejb3.proxy.container.InvokableContext;
+
+/**
+ * StatefulLocalProxyInvocationHandler
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class StatefulLocalProxyInvocationHandler extends StatefulProxyInvocationHandlerBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private static final long serialVersionUID = 1L;
+
+   // --------------------------------------------------------------------------------||
+   // Constructor --------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Constructor
+    * 
+    * @param businessInterfaceType The possibly null businessInterfaceType
+    *   marking this invocation hander as specific to a given
+    *   EJB3 Business Interface
+    */
+   public StatefulLocalProxyInvocationHandler(String businessInterfaceType)
+   {
+      super(businessInterfaceType);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /* (non-Javadoc)
+    * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
+    */
+   @Override
+   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   {
+      return this.getContainerLocally();
+   }
+
+}

Deleted: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandler.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandler.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -1,221 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.proxy.handler.session.stateful;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-
-import org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase;
-import org.jboss.ejb3.proxy.intf.StatefulSessionProxy;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-
-/**
- * StatefulProxyInvocationHandler
- * 
- * Implementation of a SFSB Proxy Invocation Handler 
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class StatefulProxyInvocationHandler extends SessionSpecProxyInvocationHandlerBase
-      implements
-         StatefulSessionProxy
-{
-
-   // ------------------------------------------------------------------------------||
-   // Class Members ----------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   private static final long serialVersionUID = 1L;
-
-   private static final Logger log = Logger.getLogger(StatefulProxyInvocationHandler.class);
-
-   // ------------------------------------------------------------------------------||
-   // Instance Members -------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   /**
-    * The Session ID of the SFSB Instance to which this ProxyHandler will delegate
-    */
-   private Object sessionId;
-
-   // ------------------------------------------------------------------------------||
-   // Constructors -----------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   /**
-    * Constructor
-    */
-   public StatefulProxyInvocationHandler()
-   {
-      this(null);
-   }
-
-   /**
-    * Constructor
-    * 
-    * @param businessInterfaceType The possibly null businessInterfaceType
-    *   marking this invocation hander as specific to a given
-    *   EJB3 Business Interface
-    */
-   public StatefulProxyInvocationHandler(String businessInterfaceType)
-   {
-      super(businessInterfaceType);
-   }
-
-   // ------------------------------------------------------------------------------||
-   // Required Implementations -----------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   /**
-    * Obtains the Session ID for this SFSB instance
-    * 
-    * @return
-    */
-   public Object getSessionId()
-   {
-      return this.sessionId;
-   }
-
-   /**
-    * Sets the Session ID for this SFSB instance
-    * 
-    * @param sessionId
-    */
-   public void setSessionId(Object sessionId)
-   {
-      this.sessionId = sessionId;
-   }
-
-   /**
-    * EJB 3.0 Core Specification 3.4.5.1
-    * 
-    * Determines Equality for SFSB Proxies
-    * 
-    * @param proxy
-    * @param argument
-    */
-   @Override
-   protected boolean invokeEquals(Object proxy, Object argument)
-   {
-      /*
-       * EJB 3.0 Core Specification 3.4.5.1: 
-       * 
-       * A stateful session object has a unique identity that is assigned by the 
-       * container at the time the object is created. A client of the stateful 
-       * session bean business interface can determine if two business interface 
-       * references refer to the same session object by use of the equals method.
-       * 
-       * All stateful session bean references to the same business interface for 
-       * the same stateful session bean instance will be equal. Stateful session 
-       * bean references to different interface types or to different session bean 
-       * instances will not have the same identity.
-       */
-
-      // If these objects are not of the same type
-      if (!argument.getClass().equals(proxy.getClass()))
-      {
-         // Not equal
-         if (log.isTraceEnabled())
-         {
-            log.trace(argument + " is not equal to " + proxy + " as they are different types");
-         }
-         return false;
-      }
-
-      // Get Invocation Handlers
-      InvocationHandler proxyHandler = this.getInvocationHandler(proxy);
-      InvocationHandler argumentHandler = Proxy.getInvocationHandler(argument);
-
-      // If argument handler is not SLSB Handler
-      if (!(argumentHandler instanceof StatefulProxyInvocationHandler))
-      {
-         return false;
-      }
-
-      // Cast
-      StatefulProxyInvocationHandler sHandler = (StatefulProxyInvocationHandler) proxyHandler;
-      StatefulProxyInvocationHandler sArgument = (StatefulProxyInvocationHandler) argumentHandler;
-
-      // Ensure target containers are equal
-      String proxyContainerName = sHandler.getContainerName();
-      assert proxyContainerName != null : "Container Name for " + sHandler + " was not set and is required";
-      if (!proxyContainerName.equals(sArgument.getContainerName()))
-      {
-         return false;
-      }
-
-      // Equal if Session IDs are equal
-      Object sessionId = sHandler.getSessionId();
-      assert sessionId != null : "Required Session ID is not present in " + proxy;
-      boolean equal = sessionId.equals(sArgument.getSessionId());
-
-      // Return
-      log.debug("SFSB Equality Check for " + sHandler.getSessionId() + " and " + sArgument.getSessionId() + " = "
-            + equal);
-      return equal;
-   }
-
-   /**
-    * Handles invocation of "hashCode()" upon the proxy
-    * 
-    * @param proxy
-    * @return
-    */
-   protected int invokeHashCode(Object proxy)
-   {
-      // Get the InvocationHandler
-      StatefulProxyInvocationHandler handler = this.getInvocationHandler(proxy);
-
-      // Generate unique String by value according to rules in "invokeEquals"; 
-      // Destination Container, Session ID, and Business Interface
-      String unique = handler.getContainerName() + handler.getBusinessInterfaceType() + handler.getSessionId();
-
-      // Hash the String
-      return unique.hashCode();
-   }
-
-   // ------------------------------------------------------------------------------||
-   // Internal Helper Methods ------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   protected StatefulProxyInvocationHandler getInvocationHandler(Object proxy)
-   {
-      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
-      assert handler instanceof StatefulProxyInvocationHandler : "Expected " + InvocationHandler.class.getSimpleName()
-            + " of type " + StatefulProxyInvocationHandler.class.getName() + ", but instead was " + handler;
-      return (StatefulProxyInvocationHandler) handler;
-   }
-
-   // ------------------------------------------------------------------------------||
-   // TO BE IMPLEMENTED ------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   /* (non-Javadoc)
-    * @see org.jboss.ejb3.proxy.handler.ProxyInvocationHandler#getAsynchronousProxy(java.lang.Object)
-    */
-   public Object getAsynchronousProxy(Object proxy)
-   {
-      throw new NotImplementedException("ALR");
-   }
-}

Copied: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandlerBase.java (from rev 74113, projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandler.java)
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandlerBase.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandlerBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -0,0 +1,214 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.proxy.handler.session.stateful;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+
+import org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase;
+import org.jboss.ejb3.proxy.intf.StatefulSessionProxy;
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+
+/**
+ * StatefulProxyInvocationHandlerBase
+ * 
+ * Implementation of a SFSB Proxy Invocation Handler 
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public abstract class StatefulProxyInvocationHandlerBase extends SessionSpecProxyInvocationHandlerBase
+      implements
+         StatefulSessionProxy
+{
+
+   // ------------------------------------------------------------------------------||
+   // Class Members ----------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   private static final long serialVersionUID = 1L;
+
+   private static final Logger log = Logger.getLogger(StatefulProxyInvocationHandlerBase.class);
+
+   // ------------------------------------------------------------------------------||
+   // Instance Members -------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /**
+    * The Session ID of the SFSB Instance to which this ProxyHandler will delegate
+    */
+   private Object sessionId;
+
+   // ------------------------------------------------------------------------------||
+   // Constructors -----------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /**
+    * Constructor
+    * 
+    * @param businessInterfaceType The possibly null businessInterfaceType
+    *   marking this invocation hander as specific to a given
+    *   EJB3 Business Interface
+    */
+   public StatefulProxyInvocationHandlerBase(String businessInterfaceType)
+   {
+      super(businessInterfaceType);
+   }
+
+   // ------------------------------------------------------------------------------||
+   // Required Implementations -----------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /**
+    * Obtains the Session ID for this SFSB instance
+    * 
+    * @return
+    */
+   public Object getSessionId()
+   {
+      return this.sessionId;
+   }
+
+   /**
+    * Sets the Session ID for this SFSB instance
+    * 
+    * @param sessionId
+    */
+   public void setSessionId(Object sessionId)
+   {
+      this.sessionId = sessionId;
+   }
+
+   /**
+    * EJB 3.0 Core Specification 3.4.5.1
+    * 
+    * Determines Equality for SFSB Proxies
+    * 
+    * @param proxy
+    * @param argument
+    */
+   @Override
+   protected boolean invokeEquals(Object proxy, Object argument)
+   {
+      /*
+       * EJB 3.0 Core Specification 3.4.5.1: 
+       * 
+       * A stateful session object has a unique identity that is assigned by the 
+       * container at the time the object is created. A client of the stateful 
+       * session bean business interface can determine if two business interface 
+       * references refer to the same session object by use of the equals method.
+       * 
+       * All stateful session bean references to the same business interface for 
+       * the same stateful session bean instance will be equal. Stateful session 
+       * bean references to different interface types or to different session bean 
+       * instances will not have the same identity.
+       */
+
+      // If these objects are not of the same type
+      if (!argument.getClass().equals(proxy.getClass()))
+      {
+         // Not equal
+         if (log.isTraceEnabled())
+         {
+            log.trace(argument + " is not equal to " + proxy + " as they are different types");
+         }
+         return false;
+      }
+
+      // Get Invocation Handlers
+      InvocationHandler proxyHandler = this.getInvocationHandler(proxy);
+      InvocationHandler argumentHandler = Proxy.getInvocationHandler(argument);
+
+      // If argument handler is not SLSB Handler
+      if (!(argumentHandler instanceof StatefulProxyInvocationHandlerBase))
+      {
+         return false;
+      }
+
+      // Cast
+      StatefulProxyInvocationHandlerBase sHandler = (StatefulProxyInvocationHandlerBase) proxyHandler;
+      StatefulProxyInvocationHandlerBase sArgument = (StatefulProxyInvocationHandlerBase) argumentHandler;
+
+      // Ensure target containers are equal
+      String proxyContainerName = sHandler.getContainerName();
+      assert proxyContainerName != null : "Container Name for " + sHandler + " was not set and is required";
+      if (!proxyContainerName.equals(sArgument.getContainerName()))
+      {
+         return false;
+      }
+
+      // Equal if Session IDs are equal
+      Object sessionId = sHandler.getSessionId();
+      assert sessionId != null : "Required Session ID is not present in " + proxy;
+      boolean equal = sessionId.equals(sArgument.getSessionId());
+
+      // Return
+      log.debug("SFSB Equality Check for " + sHandler.getSessionId() + " and " + sArgument.getSessionId() + " = "
+            + equal);
+      return equal;
+   }
+
+   /**
+    * Handles invocation of "hashCode()" upon the proxy
+    * 
+    * @param proxy
+    * @return
+    */
+   protected int invokeHashCode(Object proxy)
+   {
+      // Get the InvocationHandler
+      StatefulProxyInvocationHandlerBase handler = this.getInvocationHandler(proxy);
+
+      // Generate unique String by value according to rules in "invokeEquals"; 
+      // Destination Container, Session ID, and Business Interface
+      String unique = handler.getContainerName() + handler.getBusinessInterfaceType() + handler.getSessionId();
+
+      // Hash the String
+      return unique.hashCode();
+   }
+
+   // ------------------------------------------------------------------------------||
+   // Internal Helper Methods ------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   protected StatefulProxyInvocationHandlerBase getInvocationHandler(Object proxy)
+   {
+      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
+      assert handler instanceof StatefulProxyInvocationHandlerBase : "Expected "
+            + InvocationHandler.class.getSimpleName() + " of type "
+            + StatefulProxyInvocationHandlerBase.class.getName() + ", but instead was " + handler;
+      return (StatefulProxyInvocationHandlerBase) handler;
+   }
+
+   // ------------------------------------------------------------------------------||
+   // TO BE IMPLEMENTED ------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /* (non-Javadoc)
+    * @see org.jboss.ejb3.proxy.handler.ProxyInvocationHandler#getAsynchronousProxy(java.lang.Object)
+    */
+   public Object getAsynchronousProxy(Object proxy)
+   {
+      throw new NotImplementedException("ALR");
+   }
+}

Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulRemoteProxyInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulRemoteProxyInvocationHandler.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulRemoteProxyInvocationHandler.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.proxy.handler.session.stateful;
+
+import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
+import org.jboss.ejb3.proxy.container.InvokableContext;
+
+/**
+ * StatefulRemoteProxyInvocationHandler
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class StatefulRemoteProxyInvocationHandler extends StatefulProxyInvocationHandlerBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private static final long serialVersionUID = 1L;
+
+   // --------------------------------------------------------------------------------||
+   // Instance Members ---------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private String url;
+
+   // --------------------------------------------------------------------------------||
+   // Constructor --------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Constructor
+    * 
+    * @param businessInterfaceType The possibly null businessInterfaceType
+    *   marking this invocation hander as specific to a given
+    *   EJB3 Business Interface
+    *   @param url The URL to the Remote Host
+    */
+   public StatefulRemoteProxyInvocationHandler(String businessInterfaceType, String url)
+   {
+      super(businessInterfaceType);
+      this.setUrl(url);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /* (non-Javadoc)
+    * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
+    */
+   @Override
+   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   {
+      return this.createRemoteProxyToContainer(this.getUrl());
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Accessors / Mutators -----------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   public String getUrl()
+   {
+      return url;
+   }
+
+   public void setUrl(String url)
+   {
+      this.url = url;
+   }
+
+}

Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessLocalProxyInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessLocalProxyInvocationHandler.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessLocalProxyInvocationHandler.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.proxy.handler.session.stateless;
+
+import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
+import org.jboss.ejb3.proxy.container.InvokableContext;
+
+/**
+ * StatelessLocalProxyInvocationHandler
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class StatelessLocalProxyInvocationHandler extends StatelessProxyInvocationHandlerBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private static final long serialVersionUID = 1L;
+
+   // --------------------------------------------------------------------------------||
+   // Constructor --------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Constructor
+    * 
+    * @param businessInterfaceType The possibly null businessInterfaceType
+    *   marking this invocation hander as specific to a given
+    *   EJB3 Business Interface
+    */
+   public StatelessLocalProxyInvocationHandler(String businessInterfaceType)
+   {
+      super(businessInterfaceType);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /* (non-Javadoc)
+    * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
+    */
+   @Override
+   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   {
+      return this.getContainerLocally();
+   }
+
+}

Deleted: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandler.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandler.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -1,205 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.proxy.handler.session.stateless;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-
-import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
-import org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-
-/**
- * StatelessProxyInvocationHandler
- * 
- * Implementation of a SLSB Proxy Invocation Handler 
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class StatelessProxyInvocationHandler extends SessionSpecProxyInvocationHandlerBase
-      implements
-         SessionProxyInvocationHandler
-{
-
-   // ------------------------------------------------------------------------------||
-   // Class Members ----------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   private static final long serialVersionUID = 1L;
-
-   private static final Logger log = Logger.getLogger(StatelessProxyInvocationHandler.class);
-
-   // ------------------------------------------------------------------------------||
-   // Constructors -----------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   /**
-    * Constructor
-    */
-   public StatelessProxyInvocationHandler()
-   {
-      this(null);
-   }
-
-   /**
-    * Constructor
-    * 
-    * @param businessInterfaceType The possibly null businessInterfaceType
-    *   marking this invocation hander as specific to a given
-    *   EJB3 Business Interface
-    */
-   public StatelessProxyInvocationHandler(String businessInterfaceType)
-   {
-      super(businessInterfaceType);
-   }
-
-   // ------------------------------------------------------------------------------||
-   // Required Implementations -----------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   /**
-    * Handles invocation of "equals(Object)" upon a SLSB Proxy
-    * 
-    * EJB 3.0 Specification 3.4.5.2
-    * 
-    * @param proxy
-    * @param args
-    * @return
-    */
-   protected boolean invokeEquals(Object proxy, Object argument)
-   {
-      /*
-       * EJB 3.0 Specification 3.4.5.2:
-       * 
-       * All business object references of the same interface type for the same 
-       * stateless session bean have the same object identity, which is 
-       * assigned by the container.
-       *
-       * The equals method always returns true when used to compare references 
-       * to the same business interface type of the same session bean.
-       * 
-       * Session bean references to either different business interface types
-       * or different session beans will not be equal."
-       */
-
-      // If these are not of the same type
-      if (!proxy.getClass().equals(argument.getClass()))
-      {
-         // Return false
-         return false;
-      }
-
-      // If the argument is not a proxy
-      if (!Proxy.isProxyClass(argument.getClass()))
-      {
-         return false;
-      }
-
-      // Get the InvocationHandlers
-      InvocationHandler proxyHandler = this.getInvocationHandler(proxy);
-      InvocationHandler argumentHandler = Proxy.getInvocationHandler(argument);
-
-      // If argument handler is not SLSB Handler
-      if (!(argumentHandler instanceof StatelessProxyInvocationHandler))
-      {
-         return false;
-      }
-
-      // Cast
-      StatelessProxyInvocationHandler proxySHandler = (StatelessProxyInvocationHandler) proxyHandler;
-      StatelessProxyInvocationHandler argumentSHandler = (StatelessProxyInvocationHandler) argumentHandler;
-
-      // Ensure target containers are equal
-      String proxyContainerName = proxySHandler.getContainerName();
-      assert proxyContainerName != null : "Container Name for " + proxySHandler + " was not set and is required";
-      if (!proxyContainerName.equals(argumentSHandler.getContainerName()))
-      {
-         return false;
-      }
-
-      // Obtain target business interfaces
-      String proxyBusinessInterface = proxySHandler.getBusinessInterfaceType();
-      String argumentBusinessInterface = argumentSHandler.getBusinessInterfaceType();
-
-      // If no business interface is specified for the proxy, but is for the argument
-      if (proxyBusinessInterface == null && argumentBusinessInterface != null)
-      {
-         return false;
-      }
-
-      // If the business interface of the proxy does not match that of the argument
-      if (proxyBusinessInterface != null && !proxyBusinessInterface.equals(argumentBusinessInterface))
-      {
-         return false;
-      }
-
-      // All conditions passed, so true
-      return true;
-
-   }
-
-   /**
-    * Handles invocation of "hashCode()" upon the proxy
-    * 
-    * @param proxy
-    * @return
-    */
-   protected int invokeHashCode(Object proxy)
-   {
-      // Get the InvocationHandler
-      StatelessProxyInvocationHandler handler = this.getInvocationHandler(proxy);
-
-      // Generate unique String by value according to rules in "invokeEquals"; 
-      // Destination Container and Business Interface
-      String unique = handler.getContainerName() + handler.getBusinessInterfaceType();
-
-      // Hash the String
-      return unique.hashCode();
-   }
-
-   // ------------------------------------------------------------------------------||
-   // Internal Helper Methods ------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   protected StatelessProxyInvocationHandler getInvocationHandler(Object proxy)
-   {
-      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
-      assert handler instanceof StatelessProxyInvocationHandler : "Expected " + InvocationHandler.class.getSimpleName()
-            + " of type " + StatelessProxyInvocationHandler.class.getName() + ", but instead was " + handler;
-      return (StatelessProxyInvocationHandler) handler;
-   }
-
-   // ------------------------------------------------------------------------------||
-   // TO BE IMPLEMENTED ------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   /* (non-Javadoc)
-    * @see org.jboss.ejb3.proxy.handler.ProxyInvocationHandler#getAsynchronousProxy(java.lang.Object)
-    */
-   public Object getAsynchronousProxy(Object proxy)
-   {
-      throw new NotImplementedException("ALR");
-   }
-
-}

Copied: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandlerBase.java (from rev 74113, projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandler.java)
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandlerBase.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessProxyInvocationHandlerBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -0,0 +1,205 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.proxy.handler.session.stateless;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+
+import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
+import org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase;
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+
+/**
+ * StatelessProxyInvocationHandlerBase
+ * 
+ * Implementation of a SLSB Proxy Invocation Handler 
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public abstract class StatelessProxyInvocationHandlerBase extends SessionSpecProxyInvocationHandlerBase
+      implements
+         SessionProxyInvocationHandler
+{
+
+   // ------------------------------------------------------------------------------||
+   // Class Members ----------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   private static final long serialVersionUID = 1L;
+
+   private static final Logger log = Logger.getLogger(StatelessProxyInvocationHandlerBase.class);
+
+   // ------------------------------------------------------------------------------||
+   // Constructors -----------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /**
+    * Constructor
+    */
+   public StatelessProxyInvocationHandlerBase()
+   {
+      this(null);
+   }
+
+   /**
+    * Constructor
+    * 
+    * @param businessInterfaceType The possibly null businessInterfaceType
+    *   marking this invocation hander as specific to a given
+    *   EJB3 Business Interface
+    */
+   public StatelessProxyInvocationHandlerBase(String businessInterfaceType)
+   {
+      super(businessInterfaceType);
+   }
+
+   // ------------------------------------------------------------------------------||
+   // Required Implementations -----------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /**
+    * Handles invocation of "equals(Object)" upon a SLSB Proxy
+    * 
+    * EJB 3.0 Specification 3.4.5.2
+    * 
+    * @param proxy
+    * @param args
+    * @return
+    */
+   protected boolean invokeEquals(Object proxy, Object argument)
+   {
+      /*
+       * EJB 3.0 Specification 3.4.5.2:
+       * 
+       * All business object references of the same interface type for the same 
+       * stateless session bean have the same object identity, which is 
+       * assigned by the container.
+       *
+       * The equals method always returns true when used to compare references 
+       * to the same business interface type of the same session bean.
+       * 
+       * Session bean references to either different business interface types
+       * or different session beans will not be equal."
+       */
+
+      // If these are not of the same type
+      if (!proxy.getClass().equals(argument.getClass()))
+      {
+         // Return false
+         return false;
+      }
+
+      // If the argument is not a proxy
+      if (!Proxy.isProxyClass(argument.getClass()))
+      {
+         return false;
+      }
+
+      // Get the InvocationHandlers
+      InvocationHandler proxyHandler = this.getInvocationHandler(proxy);
+      InvocationHandler argumentHandler = Proxy.getInvocationHandler(argument);
+
+      // If argument handler is not SLSB Handler
+      if (!(argumentHandler instanceof StatelessProxyInvocationHandlerBase))
+      {
+         return false;
+      }
+
+      // Cast
+      StatelessProxyInvocationHandlerBase proxySHandler = (StatelessProxyInvocationHandlerBase) proxyHandler;
+      StatelessProxyInvocationHandlerBase argumentSHandler = (StatelessProxyInvocationHandlerBase) argumentHandler;
+
+      // Ensure target containers are equal
+      String proxyContainerName = proxySHandler.getContainerName();
+      assert proxyContainerName != null : "Container Name for " + proxySHandler + " was not set and is required";
+      if (!proxyContainerName.equals(argumentSHandler.getContainerName()))
+      {
+         return false;
+      }
+
+      // Obtain target business interfaces
+      String proxyBusinessInterface = proxySHandler.getBusinessInterfaceType();
+      String argumentBusinessInterface = argumentSHandler.getBusinessInterfaceType();
+
+      // If no business interface is specified for the proxy, but is for the argument
+      if (proxyBusinessInterface == null && argumentBusinessInterface != null)
+      {
+         return false;
+      }
+
+      // If the business interface of the proxy does not match that of the argument
+      if (proxyBusinessInterface != null && !proxyBusinessInterface.equals(argumentBusinessInterface))
+      {
+         return false;
+      }
+
+      // All conditions passed, so true
+      return true;
+
+   }
+
+   /**
+    * Handles invocation of "hashCode()" upon the proxy
+    * 
+    * @param proxy
+    * @return
+    */
+   protected int invokeHashCode(Object proxy)
+   {
+      // Get the InvocationHandler
+      StatelessProxyInvocationHandlerBase handler = this.getInvocationHandler(proxy);
+
+      // Generate unique String by value according to rules in "invokeEquals"; 
+      // Destination Container and Business Interface
+      String unique = handler.getContainerName() + handler.getBusinessInterfaceType();
+
+      // Hash the String
+      return unique.hashCode();
+   }
+
+   // ------------------------------------------------------------------------------||
+   // Internal Helper Methods ------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   protected StatelessProxyInvocationHandlerBase getInvocationHandler(Object proxy)
+   {
+      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
+      assert handler instanceof StatelessProxyInvocationHandlerBase : "Expected " + InvocationHandler.class.getSimpleName()
+            + " of type " + StatelessProxyInvocationHandlerBase.class.getName() + ", but instead was " + handler;
+      return (StatelessProxyInvocationHandlerBase) handler;
+   }
+
+   // ------------------------------------------------------------------------------||
+   // TO BE IMPLEMENTED ------------------------------------------------------------||
+   // ------------------------------------------------------------------------------||
+
+   /* (non-Javadoc)
+    * @see org.jboss.ejb3.proxy.handler.ProxyInvocationHandler#getAsynchronousProxy(java.lang.Object)
+    */
+   public Object getAsynchronousProxy(Object proxy)
+   {
+      throw new NotImplementedException("ALR");
+   }
+
+}

Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessRemoteProxyInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessRemoteProxyInvocationHandler.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessRemoteProxyInvocationHandler.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.proxy.handler.session.stateless;
+
+import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
+import org.jboss.ejb3.proxy.container.InvokableContext;
+
+/**
+ * StatelessRemoteProxyInvocationHandler
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class StatelessRemoteProxyInvocationHandler extends StatelessProxyInvocationHandlerBase
+{
+
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private static final long serialVersionUID = 1L;
+
+   // --------------------------------------------------------------------------------||
+   // Instance Members ---------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private String url;
+
+   // --------------------------------------------------------------------------------||
+   // Constructor --------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Constructor
+    * 
+    * @param businessInterfaceType The possibly null businessInterfaceType
+    *   marking this invocation hander as specific to a given
+    *   EJB3 Business Interface
+    *   @param url The URL to the Remote Host
+    */
+   public StatelessRemoteProxyInvocationHandler(String businessInterfaceType, String url)
+   {
+      super(businessInterfaceType);
+      this.setUrl(url);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /* (non-Javadoc)
+    * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
+    */
+   @Override
+   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   {
+      return this.createRemoteProxyToContainer(this.getUrl());
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Accessors / Mutators -----------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   public String getUrl()
+   {
+      return url;
+   }
+
+   public void setUrl(String url)
+   {
+      this.url = url;
+   }
+
+}

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiSessionRegistrarBase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -192,9 +192,16 @@
 
       if (hasRemoteView)
       {
+         // Obtain RemoteBinding URL
+         List<RemoteBindingMetaData> bindings = smd.getRemoteBindings();
+         assert bindings != null && bindings.size() > 0 : "Remote Bindings are required and none are present";
+         RemoteBindingMetaData remoteBinding = smd.getRemoteBindings().get(0);
+         String url = remoteBinding.getClientBindUrl();
+
          // Create and register a remote proxy factory
          String remoteProxyFactoryKey = this.getProxyFactoryRegistryKey(smd, false);
-         SessionProxyFactory factory = this.createRemoteProxyFactory(remoteProxyFactoryKey, smd, cl);
+         SessionProxyFactory factory = this
+               .createRemoteProxyFactory(remoteProxyFactoryKey, containerName, smd, cl, url);
          this.registerProxyFactory(remoteProxyFactoryKey, factory, smd);
 
          // Initialize Reference Addresses to attach to default remote JNDI Reference
@@ -290,7 +297,7 @@
       {
          // Create and register a local proxy factory
          String localProxyFactoryKey = this.getProxyFactoryRegistryKey(smd, true);
-         SessionProxyFactory factory = this.createLocalProxyFactory(localProxyFactoryKey, smd, cl);
+         SessionProxyFactory factory = this.createLocalProxyFactory(localProxyFactoryKey, containerName, smd, cl);
          this.registerProxyFactory(localProxyFactoryKey, factory, smd);
 
          // Initialize Reference Addresses to attach to default local JNDI Reference
@@ -385,21 +392,26 @@
     * Creates and returns a new local proxy factory for this Session Bean
     * 
     * @param name The unique name for the ProxyFactory
+    * @param containerName The name of the Container upon which Proxies 
+    *   from the returned ProxyFactory will invoke
     * @param smd The metadata representing this Session EJB
     * @param cl The ClassLoader for this EJB Container
     */
-   protected abstract SessionProxyFactory createLocalProxyFactory(final String name,
+   protected abstract SessionProxyFactory createLocalProxyFactory(final String name, final String containerName,
          final JBossSessionBeanMetaData smd, final ClassLoader cl);
 
    /**
     * Creates and returns a new remote proxy factory for this Session Bean
     * 
     * @param name The unique name for the ProxyFactory
+    * @param containerName The name of the Container upon which Proxies 
+    *   from the returned ProxyFactory will invoke
     * @param smd The metadata representing this Session EJB
     * @param cl The ClassLoader for this EJB Container
+    * @param url The URL to use for Remoting
     */
-   protected abstract SessionProxyFactory createRemoteProxyFactory(final String name,
-         final JBossSessionBeanMetaData smd, final ClassLoader cl);
+   protected abstract SessionProxyFactory createRemoteProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData smd, final ClassLoader cl, final String url);
 
    // --------------------------------------------------------------------------------||
    // Helper Methods -----------------------------------------------------------------||

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatefulSessionRegistrar.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatefulSessionRegistrar.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatefulSessionRegistrar.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -73,29 +73,34 @@
     * Creates and returns a new local proxy factory for this SFSB
     * 
     * @param name The unique name for the ProxyFactory
+    * @param containerName The name of the Container upon which Proxies 
+    *   from the returned ProxyFactory will invoke
     * @param smd The metadata representing this SFSB
     * @param cl The ClassLoader for this EJB Container
     */
    @Override
-   protected SessionProxyFactory createLocalProxyFactory(final String name, final JBossSessionBeanMetaData smd,
-         final ClassLoader cl)
+   protected SessionProxyFactory createLocalProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData smd, final ClassLoader cl)
    {
-      return new StatefulSessionLocalProxyFactory(name, smd, cl);
+      return new StatefulSessionLocalProxyFactory(name, containerName, smd, cl);
    }
 
    /**
     * Creates and returns a new remote proxy factory for this SFSB
     * 
     * @param name The unique name for the ProxyFactory
+    * @param containerName The name of the Container upon which Proxies 
+    *   from the returned ProxyFactory will invoke
     * @param smd The metadata representing this SFSB
     * @param cl The ClassLoader for this EJB Container
+    * @param url The URL to use for Remoting
     */
    @Override
-   protected SessionProxyFactory createRemoteProxyFactory(final String name, final JBossSessionBeanMetaData smd,
-         final ClassLoader cl)
+   protected SessionProxyFactory createRemoteProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData smd, final ClassLoader cl, final String url)
    {
       // Create
-      SessionProxyFactory factory = new StatefulSessionRemoteProxyFactory(name, smd, cl);
+      SessionProxyFactory factory = new StatefulSessionRemoteProxyFactory(name, containerName, smd, cl, url);
 
       // Register with Remoting
       log.debug("Registering with Remoting Dispatcher under name \"" + factory.getName() + "\": " + factory);

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatelessSessionRegistrar.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatelessSessionRegistrar.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/jndiregistrar/JndiStatelessSessionRegistrar.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -72,28 +72,34 @@
     * Creates and returns a new local proxy factory for this SLSB
     * 
     * @param name The unique name for the ProxyFactory
+    * @param containerName The name of the Container upon which Proxies 
+    *   from the returned ProxyFactory will invoke
     * @param smd The metadata representing this SLSB
     * @param cl The ClassLoader for this EJB Container
     */
    @Override
-   protected SessionProxyFactory createLocalProxyFactory(final String name, JBossSessionBeanMetaData smd, ClassLoader cl)
+   protected SessionProxyFactory createLocalProxyFactory(final String name, final String containerName,
+         JBossSessionBeanMetaData smd, ClassLoader cl)
    {
-      return new StatelessSessionLocalProxyFactory(name, smd, cl);
+      return new StatelessSessionLocalProxyFactory(name, containerName, smd, cl);
    }
 
    /**
     * Creates and returns a new remote proxy factory for this Session Bean
     * 
     * @param name The unique name for the ProxyFactory
+    * @param containerName The name of the Container upon which Proxies 
+    *   from the returned ProxyFactory will invoke
     * @param smd The metadata representing this Session EJB
     * @param cl The ClassLoader for this EJB Container
+    * @param url The URL to use for Remoting
     */
    @Override
-   protected SessionProxyFactory createRemoteProxyFactory(final String name, final JBossSessionBeanMetaData smd,
-         final ClassLoader cl)
+   protected SessionProxyFactory createRemoteProxyFactory(final String name, final String containerName,
+         final JBossSessionBeanMetaData smd, final ClassLoader cl, final String url)
    {
       // Create
-      SessionProxyFactory factory = new StatelessSessionRemoteProxyFactory(name, smd, cl);
+      SessionProxyFactory factory = new StatelessSessionRemoteProxyFactory(name, containerName, smd, cl, url);
 
       // Register with Remoting
       log.debug("Registering with Remoting Dispatcher under name \"" + factory.getName() + "\": " + factory);

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -43,7 +43,6 @@
 import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
 import org.jboss.ejb3.common.registrar.spi.NotBoundException;
 import org.jboss.ejb3.proxy.factory.ProxyFactory;
-import org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerMetadata;
 import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
@@ -117,6 +116,8 @@
       try
       {
          // Attempt to get local EJB3 Registrar
+         //TODO EJBTHREE-1403
+         // This is the wrong way to determine local/remote 
          Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();
 
          // Local lookup succeeded, so use it
@@ -144,9 +145,6 @@
          // Create an InvokerLocator
          InvokerLocator locator = new InvokerLocator(url);
 
-         // Make the Locator available within Thread scope
-         ProxyInvocationHandlerMetadata.INVOKER_LOCATOR.set(locator);
-
          // Create a POJI Proxy to the Registrar
          Interceptor[] interceptors =
          {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/session/stateful/StatefulSessionProxyObjectFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/session/stateful/StatefulSessionProxyObjectFactory.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/session/stateful/StatefulSessionProxyObjectFactory.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -23,6 +23,7 @@
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
+import java.net.MalformedURLException;
 import java.util.List;
 import java.util.Map;
 
@@ -36,8 +37,7 @@
 import org.jboss.ejb3.common.registrar.spi.NotBoundException;
 import org.jboss.ejb3.proxy.container.StatefulSessionInvokableContext;
 import org.jboss.ejb3.proxy.factory.ProxyFactory;
-import org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerMetadata;
-import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandler;
+import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandlerBase;
 import org.jboss.ejb3.proxy.objectfactory.ProxyFactoryReferenceAddressTypes;
 import org.jboss.ejb3.proxy.objectfactory.session.SessionProxyObjectFactory;
 import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
@@ -79,9 +79,9 @@
 
       // Obtain the InvocationHandler
       InvocationHandler handler = Proxy.getInvocationHandler(proxy);
-      assert handler instanceof StatefulProxyInvocationHandler : "SFSB Proxy must be of type "
-            + StatefulProxyInvocationHandler.class.getName();
-      StatefulProxyInvocationHandler sHandler = (StatefulProxyInvocationHandler) handler;
+      assert handler instanceof StatefulProxyInvocationHandlerBase : "SFSB Proxy must be of type "
+            + StatefulProxyInvocationHandlerBase.class.getName();
+      StatefulProxyInvocationHandlerBase sHandler = (StatefulProxyInvocationHandlerBase) handler;
 
       /*
        * Obtain the Container
@@ -103,7 +103,17 @@
       catch (NotBoundException nbe)
       {
          // Create a POJI Proxy to the Container
-         InvokerLocator locator = ProxyInvocationHandlerMetadata.INVOKER_LOCATOR.get();
+         String url = this.getSingleRequiredReferenceAddressValue(name, referenceAddresses,
+               ProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_INVOKER_LOCATOR_URL);
+         InvokerLocator locator = null;
+         try
+         {
+            locator = new InvokerLocator(url);
+         }
+         catch (MalformedURLException e)
+         {
+            throw new RuntimeException();
+         }
          Interceptor[] interceptors =
          {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
          PojiProxy proxyHandler = new PojiProxy(containerName, locator, interceptors);

Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatefulContainer.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatefulContainer.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatefulContainer.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -28,7 +28,7 @@
 import java.util.UUID;
 
 import org.jboss.ejb3.proxy.container.StatefulSessionInvokableContext;
-import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandler;
+import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandlerBase;
 import org.jboss.ejb3.proxy.invocation.StatefulSessionContainerMethodInvocation;
 import org.jboss.ejb3.proxy.objectstore.ObjectStoreBindings;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
@@ -133,9 +133,9 @@
    {
       // Obtain the InvocationHandler
       InvocationHandler handler = Proxy.getInvocationHandler(proxy);
-      assert handler instanceof StatefulProxyInvocationHandler : "SFSB Proxy must be of type "
-            + StatefulProxyInvocationHandler.class.getName();
-      StatefulProxyInvocationHandler sHandler = (StatefulProxyInvocationHandler) handler;
+      assert handler instanceof StatefulProxyInvocationHandlerBase : "SFSB Proxy must be of type "
+            + StatefulProxyInvocationHandlerBase.class.getName();
+      StatefulProxyInvocationHandlerBase sHandler = (StatefulProxyInvocationHandlerBase) handler;
 
       // Get the Session ID
       Object sessionId = sHandler.getSessionId();

Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SfsbProxyEqualityTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SfsbProxyEqualityTestCase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SfsbProxyEqualityTestCase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -204,7 +204,7 @@
 
       // Make a Local Proxy Factory
       StatefulSessionLocalProxyFactory factory = new StatefulSessionLocalProxyFactory(
-            StatefulSessionLocalProxyFactory.class.getName(), sfsb.getMetaData(), sfsb.getClassLoader());
+            StatefulSessionLocalProxyFactory.class.getName(), sfsb.getName(), sfsb.getMetaData(), sfsb.getClassLoader());
 
       // Start
       factory.start();
@@ -227,7 +227,8 @@
 
       // Make a Remote Proxy Factory
       StatefulSessionRemoteProxyFactory factory = new StatefulSessionRemoteProxyFactory(
-            StatefulSessionRemoteProxyFactory.class.getName(), sfsb.getMetaData(), sfsb.getClassLoader());
+            StatefulSessionRemoteProxyFactory.class.getName(), sfsb.getName(), sfsb.getMetaData(), sfsb
+                  .getClassLoader(),null);
 
       // Start
       factory.start();

Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java	2008-06-05 10:12:42 UTC (rev 74130)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java	2008-06-05 10:33:36 UTC (rev 74131)
@@ -159,7 +159,8 @@
 
       // Create the Factory
       StatelessSessionLocalProxyFactory factory = new StatelessSessionLocalProxyFactory(
-            StatelessSessionLocalProxyFactory.class.getName(), container.getMetaData(), container.getClassLoader());
+            StatelessSessionLocalProxyFactory.class.getName(), container.getName(), container.getMetaData(), container
+                  .getClassLoader());
 
       // Start
       factory.start();
@@ -182,7 +183,8 @@
 
       // Create the Factory
       StatelessSessionRemoteProxyFactory factory = new StatelessSessionRemoteProxyFactory(
-            StatelessSessionRemoteProxyFactory.class.getName(), container.getMetaData(), container.getClassLoader());
+            StatelessSessionRemoteProxyFactory.class.getName(), container.getName(), container.getMetaData(), container
+                  .getClassLoader(), null);
 
       // Start
       factory.start();




More information about the jboss-cvs-commits mailing list