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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 5 01:00:26 EDT 2008


Author: ALRubinger
Date: 2008-08-05 01:00:25 -0400 (Tue, 05 Aug 2008)
New Revision: 76632

Added:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/InvokableContextStatefulRemoteProxyInvocationHack.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/StatefulSessionRemotingMetadata.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassAdvisor.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassProxyHack.java
Removed:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java
Modified:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/InvokableContext.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/StatefulSessionInvokableContext.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactory.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/handler/session/SessionProxyInvocationHandlerBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java
   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/StatelessRemoteProxyInvocationHandler.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/intf/StatefulSessionProxy.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/SessionContainer.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/common/container/StatelessContainer.java
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SfsbProxyEqualityTestCase.java
Log:
[EJBTHREE-1345] Change up the Remoting Invocation mechanism used by in EJB3 Proxy to match that of EJB3 Core

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/InvokableContext.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/InvokableContext.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/InvokableContext.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,8 +21,9 @@
  */
 package org.jboss.ejb3.proxy.container;
 
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.InvocationResponse;
 import org.jboss.ejb3.common.lang.SerializableMethod;
-import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
 
 /**
  * InvokableContext
@@ -34,7 +35,7 @@
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision: $
  */
-public interface InvokableContext<T extends ContainerMethodInvocation>
+public interface InvokableContext
 {
    /**
     * Invokes the method described by the specified serializable method
@@ -47,4 +48,13 @@
     * @return
     */
    Object invoke(Object proxy, SerializableMethod method, Object[] args) throws Throwable;
+
+   /**
+    * Invocation point of entry for Remoting
+    * 
+    * @param invocation
+    * @return
+    * @throws Throwable
+    */
+   InvocationResponse dynamicInvoke(Invocation invocation) throws Throwable;
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/StatefulSessionInvokableContext.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/StatefulSessionInvokableContext.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/container/StatefulSessionInvokableContext.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,7 +21,7 @@
  */
 package org.jboss.ejb3.proxy.container;
 
-import org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation;
+import java.io.Serializable;
 
 /**
  * StatefulSessionInvokableContext
@@ -33,14 +33,12 @@
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision: $
  */
-public interface StatefulSessionInvokableContext<T extends StatefulSessionContainerMethodInvocation>
-      extends
-         InvokableContext<StatefulSessionContainerMethodInvocation>
+public interface StatefulSessionInvokableContext extends InvokableContext
 {
    /**
     * Creates a new user session and returns the unique Session ID
     * 
     * @return
     */
-   Object createSession();
+   Serializable createSession();
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactory.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactory.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,6 +21,8 @@
  */
 package org.jboss.ejb3.proxy.factory.session.stateful;
 
+import java.io.Serializable;
+
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
 
 /**
@@ -42,7 +44,7 @@
     * @param sessionId
     * @return
     */
-   Object createProxyHome(Object sessionId);
+   Object createProxyHome(Serializable sessionId);
 
    /**
     * Create an EJB3 Business proxy with no 
@@ -56,7 +58,7 @@
     * @param sessionId
     * @return
     */
-   Object createProxyDefault(Object sessionId);
+   Object createProxyDefault(Serializable sessionId);
 
    /**
     * Create an EJB3 Business Proxy specific to the specified
@@ -67,7 +69,7 @@
     * @param businessInterfaceName
     * @return
     */
-   Object createProxyBusiness(Object sessionId, String businessInterfaceName);
+   Object createProxyBusiness(Serializable sessionId, String businessInterfaceName);
 
    /**
     * Create an EJB2.x Proxy 
@@ -75,6 +77,6 @@
     * @param sessionId
     * @return
     */
-   Object createProxyEjb2x(Object sessionId);
+   Object createProxyEjb2x(Serializable sessionId);
 
 }

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-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.factory.session.stateful;
 
+import java.io.Serializable;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
 import java.util.Set;
@@ -28,7 +29,6 @@
 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.interceptors.container.StatefulSessionContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.StatefulSessionInvokableContext;
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactoryBase;
 import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandlerBase;
@@ -61,7 +61,7 @@
    /**
     * The Container used by this SFSB Proxy Factory
     */
-   private transient StatefulSessionInvokableContext<?> container;
+   private transient StatefulSessionInvokableContext container;
 
    // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
@@ -133,7 +133,7 @@
    @Override
    public Object createProxyHome()
    {
-      Object sessionId = this.getNewSessionId();
+      Serializable sessionId = this.getNewSessionId();
       return this.createProxyHome(sessionId);
    }
 
@@ -151,7 +151,7 @@
    @Override
    public Object createProxyDefault()
    {
-      Object sessionId = this.getNewSessionId();
+      Serializable sessionId = this.getNewSessionId();
       return this.createProxyDefault(sessionId);
    }
 
@@ -166,7 +166,7 @@
    @Override
    public Object createProxyBusiness(final String businessInterfaceName)
    {
-      Object sessionId = this.getNewSessionId();
+      Serializable sessionId = this.getNewSessionId();
       return this.createProxyBusiness(sessionId, businessInterfaceName);
    }
 
@@ -178,7 +178,7 @@
    @Override
    public Object createProxyEjb2x()
    {
-      Object sessionId = this.getNewSessionId();
+      Serializable sessionId = this.getNewSessionId();
       return this.createProxyEjb2x(sessionId);
    }
 
@@ -192,7 +192,7 @@
     * @param sessionId
     * @return
     */
-   public Object createProxyHome(Object sessionId)
+   public Object createProxyHome(Serializable sessionId)
    {
       // Obtain Proxy using Super Implementation
       Object proxy = super.createProxyHome();
@@ -216,7 +216,7 @@
     * @param sessionId
     * @return
     */
-   public Object createProxyDefault(Object sessionId)
+   public Object createProxyDefault(Serializable sessionId)
    {
       // Obtain Proxy using Super Implementation
       Object proxy = super.createProxyDefault();
@@ -237,7 +237,7 @@
     * @param businessInterfaceName
     * @return
     */
-   public Object createProxyBusiness(Object sessionId, String businessInterfaceName)
+   public Object createProxyBusiness(Serializable sessionId, String businessInterfaceName)
    {
       // Obtain Proxy using Super Implementation
       Object proxy = super.createProxyBusiness(businessInterfaceName);
@@ -255,7 +255,7 @@
     * @param sessionId
     * @return
     */
-   public Object createProxyEjb2x(Object sessionId)
+   public Object createProxyEjb2x(Serializable sessionId)
    {
       // Obtain Proxy using Super Implementation
       Object proxy = super.createProxyEjb2x();
@@ -278,7 +278,7 @@
     * @param proxy
     * @param sessionId
     */
-   protected void associateProxyWithSession(Object proxy, Object sessionId)
+   protected void associateProxyWithSession(Object proxy, Serializable sessionId)
    {
       // Obtain the InvocationHandler
       InvocationHandler handler = Proxy.getInvocationHandler(proxy);
@@ -296,13 +296,13 @@
     * 
     * @return The ID of the new session
     */
-   protected Object getNewSessionId()
+   protected Serializable getNewSessionId()
    {
       // Obtain the Container
-      StatefulSessionInvokableContext<?> container = this.getContainer();
+      StatefulSessionInvokableContext container = this.getContainer();
 
       // Get a new Session ID from the Container
-      Object sessionId = null;
+      Serializable sessionId = null;
       try
       {
          sessionId = container.createSession();
@@ -330,12 +330,12 @@
     * 
     * @return The Container for this Proxy Factory
     */
-   protected StatefulSessionInvokableContext<?> obtainContainer()
+   protected StatefulSessionInvokableContext obtainContainer()
    {
       /*
        * Obtain the Container
        */
-      StatefulSessionInvokableContext<?> container = null;
+      StatefulSessionInvokableContext container = null;
       String containerName = this.getContainerName();
 
       // Lookup from EJB3 Registrar
@@ -345,7 +345,7 @@
          assert obj instanceof StatefulSessionInvokableContext : "Container retrieved from "
                + Ejb3Registrar.class.getSimpleName() + " was not of expected type "
                + StatefulSessionInvokableContext.class.getName() + " but was instead " + obj;
-         container = (StatefulSessionInvokableContext<?>) obj;
+         container = (StatefulSessionInvokableContext) obj;
       }
       catch (NotBoundException nbe)
       {
@@ -362,7 +362,7 @@
    // Accessors / Mutators -----------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
-   public StatefulSessionInvokableContext<?> getContainer()
+   public StatefulSessionInvokableContext getContainer()
    {
       if (this.container == null)
       {
@@ -372,8 +372,7 @@
       return this.container;
    }
 
-   public void setContainer(
-         StatefulSessionInvokableContext<? extends StatefulSessionContainerMethodInvocation> container)
+   public void setContainer(StatefulSessionInvokableContext container)
    {
       this.container = container;
    }

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-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -29,10 +29,9 @@
 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.interceptors.container.ContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 import org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase;
-import org.jboss.ejb3.proxy.invocation.StatefulRemoteProxyInvocationHack;
+import org.jboss.ejb3.proxy.invocation.InvokableContextStatefulRemoteProxyInvocationHack;
 import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
@@ -55,7 +54,7 @@
    // ------------------------------------------------------------------------------||
 
    private static final long serialVersionUID = 1L;
-   
+
    private static final Logger log = Logger.getLogger(SessionProxyInvocationHandlerBase.class);
 
    // ------------------------------------------------------------------------------||
@@ -75,7 +74,7 @@
     * 
     * @return
     */
-   protected InvokableContext<? extends ContainerMethodInvocation> getContainerLocally()
+   protected InvokableContext getContainerLocally()
    {
       // Lookup
       Object obj = Ejb3RegistrarLocator.locateRegistrar().lookup(this.getContainerName());
@@ -85,42 +84,9 @@
             + " was not of expected type " + InvokableContext.class.getName() + " but was instead " + obj;
 
       // Return
-      return (InvokableContext<?>) obj;
+      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 StatefulRemoteProxyInvocationHack(this.getContainerName(), locator, interceptors);
-      Class<?>[] interfaces = new Class<?>[]
-      {InvokableContext.class};
-      InvokableContext<? extends ContainerMethodInvocation> container = (InvokableContext<?>) Proxy.newProxyInstance(
-            InvokableContext.class.getClassLoader(), interfaces, handler);      
-
-      // Return
-      return container;
-   }
-
    // ------------------------------------------------------------------------------||
    // Contracts --------------------------------------------------------------------||
    // ------------------------------------------------------------------------------||
@@ -130,5 +96,5 @@
     * 
     * @return
     */
-   protected abstract InvokableContext<? extends ContainerMethodInvocation> getContainer();
+   protected abstract InvokableContext getContainer();
 }

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -23,10 +23,6 @@
 
 import java.lang.reflect.Method;
 
-import org.jboss.aop.Dispatcher;
-import org.jboss.aop.util.PayloadKey;
-import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
-import org.jboss.aspects.remoting.IsLocalInterceptor;
 import org.jboss.ejb3.common.lang.SerializableMethod;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 import org.jboss.ejb3.proxy.handler.NotEligibleForDirectInvocationException;
@@ -107,7 +103,7 @@
       /*
        * Obtain the Container
        */
-      InvokableContext<?> container = this.getContainer();
+      InvokableContext container = this.getContainer();
 
       /*
        * Invoke
@@ -122,7 +118,7 @@
 
       // Invoke
       Object result = container.invoke(proxy, invokedMethod, args);
-      
+
       // Return
       return result;
    }

Modified: 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	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulLocalProxyInvocationHandler.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,7 +21,6 @@
  */
 package org.jboss.ejb3.proxy.handler.session.stateful;
 
-import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 
 /**
@@ -63,7 +62,7 @@
     * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
     */
    @Override
-   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   protected InvokableContext getContainer()
    {
       return this.getContainerLocally();
    }

Modified: 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/StatefulProxyInvocationHandlerBase.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandlerBase.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,12 +21,21 @@
  */
 package org.jboss.ejb3.proxy.handler.session.stateful;
 
+import java.io.Serializable;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
+import java.net.MalformedURLException;
 
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.aspects.remoting.PojiProxy;
+import org.jboss.ejb3.proxy.container.InvokableContext;
 import org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase;
 import org.jboss.ejb3.proxy.intf.StatefulSessionProxy;
+import org.jboss.ejb3.proxy.invocation.InvokableContextStatefulRemoteProxyInvocationHack;
+import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
+import org.jboss.remoting.InvokerLocator;
 import org.jboss.util.NotImplementedException;
 
 /**
@@ -57,7 +66,7 @@
    /**
     * The Session ID of the SFSB Instance to which this ProxyHandler will delegate
     */
-   private Object sessionId;
+   private Serializable sessionId;
 
    // ------------------------------------------------------------------------------||
    // Constructors -----------------------------------------------------------------||
@@ -84,7 +93,7 @@
     * 
     * @return
     */
-   public Object getSessionId()
+   public Serializable getSessionId()
    {
       return this.sessionId;
    }
@@ -94,7 +103,7 @@
     * 
     * @param sessionId
     */
-   public void setSessionId(Object sessionId)
+   public void setSessionId(Serializable sessionId)
    {
       this.sessionId = sessionId;
    }
@@ -187,6 +196,40 @@
       return unique.hashCode();
    }
 
+   /**
+    * 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 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 InvokableContextStatefulRemoteProxyInvocationHack(this.getContainerName(), locator,
+            interceptors, this.getSessionId());
+      Class<?>[] interfaces = new Class<?>[]
+      {InvokableContext.class};
+      InvokableContext container = (InvokableContext) Proxy.newProxyInstance(InvokableContext.class.getClassLoader(),
+            interfaces, handler);
+
+      // Return
+      return container;
+   }
+
    // ------------------------------------------------------------------------------||
    // Internal Helper Methods ------------------------------------------------------||
    // ------------------------------------------------------------------------------||

Modified: 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	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulRemoteProxyInvocationHandler.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,7 +21,6 @@
  */
 package org.jboss.ejb3.proxy.handler.session.stateful;
 
-import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 
 /**
@@ -71,7 +70,7 @@
     * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
     */
    @Override
-   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   protected InvokableContext getContainer()
    {
       return this.createRemoteProxyToContainer(this.getUrl());
    }

Modified: 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	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessLocalProxyInvocationHandler.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,7 +21,6 @@
  */
 package org.jboss.ejb3.proxy.handler.session.stateless;
 
-import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 
 /**
@@ -63,7 +62,7 @@
     * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
     */
    @Override
-   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   protected InvokableContext getContainer()
    {
       return this.getContainerLocally();
    }

Modified: 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	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateless/StatelessRemoteProxyInvocationHandler.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,8 +21,16 @@
  */
 package org.jboss.ejb3.proxy.handler.session.stateless;
 
-import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
+import java.lang.reflect.Proxy;
+import java.net.MalformedURLException;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.aspects.remoting.PojiProxy;
 import org.jboss.ejb3.proxy.container.InvokableContext;
+import org.jboss.ejb3.proxy.invocation.InvokableContextStatefulRemoteProxyInvocationHack;
+import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
+import org.jboss.remoting.InvokerLocator;
 
 /**
  * StatelessRemoteProxyInvocationHandler
@@ -71,12 +79,54 @@
     * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
     */
    @Override
-   protected InvokableContext<? extends ContainerMethodInvocation> getContainer()
+   protected InvokableContext getContainer()
    {
       return this.createRemoteProxyToContainer(this.getUrl());
    }
 
    // --------------------------------------------------------------------------------||
+   // Functional Methods -------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Creates and returns a Remoting Proxy to invoke upon the container
+    * 
+    * @param url The location of the remote host holding the Container
+    * @return
+    */
+   //FIXME Mostly a copy of the SFSB Remote Handler, but passing null 
+   // as a SessionID.  Should be using more intelligent design, SLSB's have 
+   // no Sessions.  To be reworked in InvokableContextStatefulRemoteProxyInvocationHack, 
+   // as this implementation is @deprecated
+   protected InvokableContext 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 InvokableContextStatefulRemoteProxyInvocationHack(this.getContainerName(), locator,
+            interceptors, null);
+      Class<?>[] interfaces = new Class<?>[]
+      {InvokableContext.class};
+      InvokableContext container = (InvokableContext) Proxy.newProxyInstance(InvokableContext.class.getClassLoader(),
+            interfaces, handler);
+
+      // Return
+      return container;
+   }
+
+   // --------------------------------------------------------------------------------||
    // Accessors / Mutators -----------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/intf/StatefulSessionProxy.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/intf/StatefulSessionProxy.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/intf/StatefulSessionProxy.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,6 +21,8 @@
  */
 package org.jboss.ejb3.proxy.intf;
 
+import java.io.Serializable;
+
 /**
  * StatefulSessionProxy
  * 
@@ -36,12 +38,12 @@
     * 
     * @return
     */
-   Object getSessionId();
+   Serializable getSessionId();
 
    /**
     * Sets the Session ID for this SFSB instance
     * 
     * @param sessionId
     */
-   void setSessionId(Object sessionId);
+   void setSessionId(Serializable sessionId);
 }

Copied: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/InvokableContextStatefulRemoteProxyInvocationHack.java (from rev 76596, projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java)
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/InvokableContextStatefulRemoteProxyInvocationHack.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/InvokableContextStatefulRemoteProxyInvocationHack.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -0,0 +1,181 @@
+/*
+ * 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.invocation;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.aop.util.MethodHashing;
+import org.jboss.aop.util.PayloadKey;
+import org.jboss.aspects.remoting.PojiProxy;
+import org.jboss.ejb3.common.lang.SerializableMethod;
+import org.jboss.ejb3.proxy.container.InvokableContext;
+import org.jboss.ejb3.proxy.remoting.StatefulSessionRemotingMetadata;
+import org.jboss.ejb3.stateful.StatefulRemoteInvocation;
+import org.jboss.remoting.InvokerLocator;
+
+/**
+ * InvokableContextStatefulRemoteProxyInvocationHack
+ * 
+ * Constructs a Proxy to the Container using an underlying
+ * StatefulRemoteInvocation when invocations are made.
+ * 
+ * Looking forward, should be using a more flexible
+ * invocation mechanism to handle SFSB, SLSB, etc invocations
+ * in an agnostic manner.  This is put into place to avoid
+ * further refactoring within EJB3 Core 
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ * @deprecated 
+ */
+ at Deprecated
+public class InvokableContextStatefulRemoteProxyInvocationHack extends PojiProxy
+{
+
+   /**
+    * The Session ID to be used in SFSB Invocations
+    */
+   private Serializable sessionId;
+
+   public InvokableContextStatefulRemoteProxyInvocationHack(Object oid, InvokerLocator uri, Interceptor[] interceptors,
+         Serializable sessionId)
+   {
+      super(oid, uri, interceptors);
+      this.setSessionId(sessionId);
+   }
+
+   /**
+    * Constructs a MethodInvocation from the specified Method and
+    * arguments
+    * 
+    * This implementation uses a StatefulRemoteInvocation as the underlying 
+    * Invocation made, in order to support legacy EJB3 Core Containers
+    * 
+    * Additionally will compute the hash of the SerializableMethod passed
+    * to InvokableContext.invoke() for handling by the container
+    * 
+    * @param method
+    * @param args
+    * @return
+    */
+   @Override
+   protected MethodInvocation constructMethodInvocation(Method method, Object[] args)
+   {
+
+      /*
+       * Ensure this method is expected
+       */
+
+      // Obtain expected method
+      Method expectedInvokeMethod = null;
+      try
+      {
+         expectedInvokeMethod = InvokableContext.class.getDeclaredMethod("invoke", new Class<?>[]
+         {Object.class, SerializableMethod.class, Object[].class});
+      }
+      catch (NoSuchMethodException e)
+      {
+         throw new RuntimeException("Could not find expected method \"invoke\" from "
+               + InvokableContext.class.getName(), e);
+      }
+
+      // Ensure expected method equal to what was passed
+      assert method.equals(expectedInvokeMethod) : "Expected method should have been " + expectedInvokeMethod
+            + ", but was instead " + method;
+
+      /*
+       * Obtain the Method to be dynamically invoked
+       */
+
+      // Get the SerializableMethod argument
+      Object serializableMethodArg = args[1];
+      assert serializableMethodArg instanceof SerializableMethod : "2nd Argument was expected to be of type "
+            + SerializableMethod.class.getName() + ", was instead " + serializableMethodArg;
+      SerializableMethod serializableMethod = (SerializableMethod) serializableMethodArg;
+
+      // Obtain the Method represented by the SerializableMethod
+      Method dynamicInvokeMethod = serializableMethod.toMethod();
+      long hash = MethodHashing.calculateHash(dynamicInvokeMethod);
+
+      /*
+       * Build the invocation and return
+       * 
+       * This is going to be intercepted by the Container's "dynamicInvoke"
+       * because the Container itself will be registered w/ Remoting Dispatcher
+       * via ProxyTestClassProxyHack, an indirection to allow the proper CL to be set
+       */
+      MethodInvocation sri = new StatefulRemoteInvocation(this.getInterceptors(), hash, dynamicInvokeMethod,
+            dynamicInvokeMethod, null, null);
+      return sri;
+   }
+
+   /**
+    * Adds a Session ID, if specified, to the invocation metadata 
+    */
+   //FIXME Not SFSB/SLSB -agnostic
+   @Override
+   protected void addMetadataToInvocation(MethodInvocation methodInvocation)
+   {
+      // Call Super implementation
+      super.addMetadataToInvocation(methodInvocation);
+
+      // Obtain Session ID
+      Serializable sessionId = this.getSessionId();
+
+      // Add to the Invocation Metadata, if exists
+      if (sessionId != null)
+      {
+         methodInvocation.getMetaData().addMetaData(StatefulSessionRemotingMetadata.TAG_SFSB_INVOCATION,
+               StatefulSessionRemotingMetadata.KEY_SESSION_ID, sessionId, PayloadKey.AS_IS);
+      }
+
+   }
+
+   /**
+    * Add the target arguments for the invocation itself, not to those
+    * initially passed to InvokableContext.invoke()
+    */
+   @Override
+   protected void addArgumentsToInvocation(MethodInvocation invocation, Object[] originalArguments)
+   {
+      // Get the arguments, perform sanity checks, and set the true arguments to the destination method
+      Object objArguments = originalArguments[2];
+      assert objArguments instanceof Object[] : "3rd Argument to " + InvokableContext.class.getSimpleName()
+            + ".invoke should be an array of Objects";
+      Object[] arguments = (Object[]) objArguments;
+      invocation.setArguments(arguments);
+   }
+
+   protected Serializable getSessionId()
+   {
+      return sessionId;
+   }
+
+   private void setSessionId(Serializable sessionId)
+   {
+      this.sessionId = sessionId;
+   }
+
+}

Deleted: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -1,76 +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.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.aop.util.MethodHashing;
-import org.jboss.aspects.remoting.PojiProxy;
-import org.jboss.ejb3.stateful.StatefulRemoteInvocation;
-import org.jboss.remoting.InvokerLocator;
-
-/**
- * StatefulRemoteProxyInvocationHack
- * 
- * Constructs a Proxy to the Container using an underlying
- * StatefulRemoteInvocation when invocations are made.
- * 
- * Looking forward, should be using a more flexible
- * invocation mechanism to handle SFSB, SLSB, etc invocations
- * in an agnostic manner.  This is put into place to avoid
- * further refactoring within EJB3 Core 
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- * @deprecated 
- */
- at Deprecated
-public class StatefulRemoteProxyInvocationHack extends PojiProxy
-{
-
-   public StatefulRemoteProxyInvocationHack(Object oid, InvokerLocator uri, Interceptor[] interceptors)
-   {
-      super(oid, uri, interceptors);
-   }
-
-   /**
-    * Constructs a MethodInvocation from the specified Method and
-    * arguments
-    * 
-    * This implementation uses a StatefulRemoteInvocation as the underlying 
-    * Invocation made, in order to support legacy EJB3 Core Containers
-    * 
-    * @param method
-    * @param args
-    * @return
-    */
-   @Override
-   protected MethodInvocation constructMethodInvocation(Method method, Object[] args)
-   {
-      long hash = MethodHashing.calculateHash(method);
-      MethodInvocation sri = new StatefulRemoteInvocation(this.getInterceptors(), hash, method, method, null, null);
-      return sri;
-   }
-
-}

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-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -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.invocation.StatefulRemoteProxyInvocationHack;
 import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
@@ -151,7 +150,7 @@
          // Create a POJI Proxy to the Registrar
          Interceptor[] interceptors =
          {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
-         PojiProxy handler = new StatefulRemoteProxyInvocationHack(proxyFactoryRegistryKey, locator, interceptors);
+         PojiProxy handler = new PojiProxy(proxyFactoryRegistryKey, locator, interceptors);
          Class<?>[] interfaces = new Class<?>[]
          {this.getProxyFactoryClass()};
          proxyFactory = (ProxyFactory) Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, handler);

Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/StatefulSessionRemotingMetadata.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/StatefulSessionRemotingMetadata.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/StatefulSessionRemotingMetadata.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -0,0 +1,45 @@
+/*
+ * 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.remoting;
+
+/**
+ * StatefulSessionRemotingMetadata
+ * 
+ * Contains constants used in Remoting metadata
+ * for SFSB Invocations
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface StatefulSessionRemotingMetadata
+{
+
+   /**
+    * AOP Metadata Tag for SFSB Remoting Invocations
+    */
+   String TAG_SFSB_INVOCATION = "SFSB";
+
+   /**
+    * AOP Metadata Key for SFSB Session ID
+    */
+   String KEY_SESSION_ID = "SessionID";
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassAdvisor.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassAdvisor.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassAdvisor.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -0,0 +1,157 @@
+/*
+ * 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.test.proxy.common.container;
+
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.ClassAdvisor;
+import org.jboss.aop.util.MethodHashing;
+import org.jboss.logging.Logger;
+
+/**
+ * ProxyTestClassAdvisor
+ *
+ * An Advisor for SessionContainers used in the EJB3
+ * Proxy Test Suite
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class ProxyTestClassAdvisor extends ClassAdvisor
+{
+
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Logger
+    */
+   private static final Logger log = Logger.getLogger(ProxyTestClassAdvisor.class);
+
+   // --------------------------------------------------------------------------------||
+   // Instance Members ---------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * The backing SessionContainer to be advised
+    */
+   private SessionContainer container;
+
+   // --------------------------------------------------------------------------------||
+   // Constructor --------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Constructor
+    * 
+    * Creates an Advisor targeted for the specified SessionContainer,
+    * repopulating the method tables and rebuilding the method chains
+    * to include virtual methods defined by the EJB itself.
+    * 
+    * @param container
+    * @param manager
+    */
+   public ProxyTestClassAdvisor(SessionContainer container, AspectManager manager)
+   {
+      // Call Super implementation, advising the Bean Implementation class
+      super(container.getBeanClass(), manager);
+
+      // Set the Container
+      this.setContainer(container);
+
+      // Recreate Method Tables (advisedMethods)
+      try
+      {
+         this.createMethodTables();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+
+      // Reinitialize the method chain (for methodInfos)
+      this.initializeMethodChain();
+
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Overridden Implementations -----------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Overridden method tables definition to include
+    * virtual methods declared by the Container's EJB
+    */
+   @Override
+   protected void createMethodTables() throws Exception
+   {
+      // Call Super
+      super.createMethodTables();
+
+      // Obtain Virtual Methods declared by the EJB
+      Set<Method> virtualMethods = getVirtualMethods();
+
+      // If virtual methods exist
+      if (virtualMethods != null)
+      {
+         // For each virtual method
+         for (Method virtualMethod : virtualMethods)
+         {
+            // Calculate the hash
+            long hash = MethodHashing.methodHash(virtualMethod);
+
+            // Add to the advised methods
+            this.advisedMethods.put(hash, virtualMethod);
+
+            // Log
+            log.debug("Added method with hash " + hash + " to those advised for " + this.clazz + ": " + virtualMethod);
+         }
+      }
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Accessors / Mutators -----------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Delegates back to the Container to obtain virtual methods
+    * declared by the EJB
+    */
+   private Set<Method> getVirtualMethods()
+   {
+      return this.getContainer().getVirtualMethods();
+   }
+
+   protected SessionContainer getContainer()
+   {
+      return container;
+   }
+
+   private void setContainer(SessionContainer container)
+   {
+      this.container = container;
+   }
+
+}

Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassProxyHack.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassProxyHack.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/ProxyTestClassProxyHack.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.test.proxy.common.container;
+
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.InvocationResponse;
+import org.jboss.aop.proxy.ClassProxy;
+import org.jboss.aop.proxy.ProxyMixin;
+import org.jboss.ejb3.proxy.container.InvokableContext;
+import org.jboss.util.NotImplementedException;
+
+/**
+ * ProxyTestClassProxyHack
+ *
+ * Adapted from ClassProxyHack in EJB3 Core
+ * (ie. Carlo).
+ * 
+ * Used to expose the dynamic invocation handling
+ * of an InvokableContext to Remoting
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+class ProxyTestClassProxyHack implements ClassProxy
+{
+   private InvokableContext container;
+
+   ProxyTestClassProxyHack(InvokableContext container)
+   {
+      assert container != null : "Specified " + InvokableContext.class.getSimpleName() + " may not be null.";
+      this.container = container;
+   }
+
+   public InvocationResponse _dynamicInvoke(Invocation invocation) throws Throwable
+   {
+      return container.dynamicInvoke(invocation);
+   }
+
+   public void setMixins(ProxyMixin[] mixins)
+   {
+      throw new NotImplementedException();
+   }
+
+   public InstanceAdvisor _getInstanceAdvisor()
+   {
+      throw new NotImplementedException();
+   }
+
+   public void _setInstanceAdvisor(InstanceAdvisor newAdvisor)
+   {
+      throw new NotImplementedException();
+   }
+
+}

Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/SessionContainer.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/SessionContainer.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/SessionContainer.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,24 +21,42 @@
  */
 package org.jboss.ejb3.test.proxy.common.container;
 
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
+import org.jboss.aop.Advisor;
+import org.jboss.aop.AspectManager;
 import org.jboss.aop.Dispatcher;
+import org.jboss.aop.MethodInfo;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.InvocationResponse;
+import org.jboss.aop.joinpoint.MethodInvocation;
 import org.jboss.beans.metadata.api.annotations.Start;
 import org.jboss.beans.metadata.api.annotations.Stop;
 import org.jboss.ejb3.common.lang.SerializableMethod;
 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.proxy.container.InvokableContext;
+import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandlerBase;
 import org.jboss.ejb3.proxy.jndiregistrar.JndiSessionRegistrarBase;
+import org.jboss.ejb3.proxy.remoting.StatefulSessionRemotingMetadata;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.jboss.metadata.ejb.spec.BusinessLocalsMetaData;
+import org.jboss.metadata.ejb.spec.BusinessRemotesMetaData;
 
 /**
  * SessionContainer
@@ -48,7 +66,7 @@
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision: $
  */
-public abstract class SessionContainer
+public abstract class SessionContainer implements InvokableContext
 {
    // --------------------------------------------------------------------------------||
    // Class Members ------------------------------------------------------------------||
@@ -90,6 +108,11 @@
     */
    private Context jndiContext;
 
+   /**
+    * The AOP Advisor
+    */
+   private Advisor advisor;
+
    // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
    // --------------------------------------------------------------------------------||
@@ -122,6 +145,11 @@
          throw new RuntimeException("Could not find Bean Implementation class \"" + beanClassName + "\" in the "
                + ClassLoader.class.getSimpleName() + " for " + this);
       }
+
+      // Set Advisor
+      AspectManager aspectManager = AspectManager.instance(this.getClassLoader());
+      Advisor advisor = new ProxyTestClassAdvisor(this, aspectManager);
+      this.setAdvisor(advisor);
    }
 
    // --------------------------------------------------------------------------------||
@@ -157,21 +185,128 @@
       }
 
       // Obtain the method for invocation
-      Method m = this.getClassLoader().loadClass(method.getDeclaringClassName()).getDeclaredMethod(method.getName(), argTypes);
+      Method m = this.getClassLoader().loadClass(method.getDeclaringClassName()).getDeclaredMethod(method.getName(),
+            argTypes);
 
       // Invoke on the bean
       return invokeBean(proxy, m, args);
    }
 
+   /**
+    * Invocation point of entry for Remoting
+    * 
+    * @param invocation
+    * @return
+    * @throws Throwable
+    */
+   public InvocationResponse dynamicInvoke(Invocation invocation) throws Throwable
+   {
+      /*
+       * Set the proper TCL
+       */
+
+      // Hold a reference to the existing TCL
+      ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
+
+      // Set the Container's CL as TCL, required to unmarshall methods from the bean impl class
+      Thread.currentThread().setContextClassLoader(this.getClassLoader());
+
+      /*
+       * Obtain the target method (unmarshall from invocation)
+       */
+
+      // Cast
+      assert invocation instanceof MethodInvocation : SessionContainer.class.getName() + ".dynamicInoke supports only "
+            + MethodInvocation.class.getSimpleName() + ", but has been passed: " + invocation;
+      MethodInvocation mi = (MethodInvocation) invocation;
+
+      // Get the method hash
+      long methodHash = mi.getMethodHash();
+      log.debug("Received dynamic invocation for method with hash: " + methodHash);
+
+      // Get the Method via MethodInfo from the Advisor
+      Advisor advisor = this.getAdvisor();
+      MethodInfo info = advisor.getMethodInfo(mi.getMethodHash());
+
+      /*
+       * Build a new Invocation
+       */
+
+      // Construct the invocation
+      MethodInvocation newInvocation = new MethodInvocation(info, new Interceptor[]
+      {});
+      Object[] args = mi.getArguments();
+      newInvocation.setArguments(args);
+      newInvocation.setMetaData(mi.getMetaData());
+      newInvocation.setAdvisor(advisor);
+
+      // Obtain the Session ID
+      Serializable sessionId = null;
+      Object objSessionId = mi.getMetaData(StatefulSessionRemotingMetadata.TAG_SFSB_INVOCATION,
+            StatefulSessionRemotingMetadata.KEY_SESSION_ID);
+      if (objSessionId != null)
+      {
+         assert objSessionId instanceof Serializable : "Session IDs must be " + Serializable.class.getSimpleName();
+         sessionId = (Serializable) objSessionId;
+      }
+
+      // Get the target, and set on the invocation
+      Object target = this.getBeanInstance(sessionId);
+      newInvocation.setTargetObject(target);
+
+      // Create an Object reference to hold the return value
+      Object returnValue = null;
+
+      // Create a reference to the Invocation's response
+      InvocationResponse response = null;
+
+      /*
+       * Invoke
+       */
+
+      try
+      {
+         // Invoke
+         returnValue = newInvocation.invokeNext();
+
+         // Create a Response
+         response = new InvocationResponse(returnValue);
+         Map<Object, Object> responseContext = newInvocation.getResponseContextInfo();
+         response.setContextInfo(responseContext);
+      }
+      finally
+      {
+         // Reset the TCL to original
+         Thread.currentThread().setContextClassLoader(originalLoader);
+      }
+
+      // Return
+      return response;
+   }
+
    protected Object createInstance() throws InstantiationException, IllegalAccessException
    {
       return this.getBeanClass().newInstance();
    }
 
+   //FIXME: Should be agnostic to Session IDs, SLSBs have none
    public Object invokeBean(Object proxy, Method method, Object args[]) throws Throwable
    {
+      // Initialize a Session ID
+      Serializable sessionId = null;
+
+      // Obtain the InvocationHandler
+      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
+      if (handler instanceof StatefulProxyInvocationHandlerBase)
+      {
+         StatefulProxyInvocationHandlerBase sHandler = (StatefulProxyInvocationHandlerBase) handler;
+
+         // Get the Session ID
+         sessionId = sHandler.getSessionId();
+      }
+
       // Get the appropriate instance
-      Object obj = this.getBeanInstance(proxy);
+      Object obj = this.getBeanInstance(sessionId);
 
       // Invoke
       return method.invoke(obj, args);
@@ -183,7 +318,7 @@
       log.info("Starting " + this);
 
       // Register with Remoting
-      Dispatcher.singleton.registerTarget(this.getName(), this);
+      Dispatcher.singleton.registerTarget(this.getName(), new ProxyTestClassProxyHack(this));
 
       // Obtain registrar
       JndiSessionRegistrarBase registrar = this.getJndiRegistrar();
@@ -281,12 +416,151 @@
     * Obtains the appropriate bean instance for invocation
     * as called from the specified proxy
     * 
-    * @param proxy
+    * @param sessionId
     * @return
     */
-   protected abstract Object getBeanInstance(Object proxy);
+   protected abstract Object getBeanInstance(Serializable sessionId);
 
    // --------------------------------------------------------------------------------||
+   // Internal Helper Methods --------------------------------------------------------||
+   // --------------------------------------------------------------------------------||   
+
+   /**
+    * Obtains a List of all methods handled by the bean class
+    * 
+    * @return The methods handled by the bean class directly
+    */
+   public Set<Method> getVirtualMethods()
+   {
+      // Initialize
+      Set<Method> virtualMethods = new HashSet<Method>();
+
+      // Obtain Metadata
+      JBossSessionBeanMetaData smd = this.getMetaData();
+
+      // Obtain CL
+      ClassLoader cl = this.getClassLoader();
+
+      /*
+       * Business Remotes
+       */
+
+      // Obtain all specified business remotes
+      BusinessRemotesMetaData businessRemotes = smd.getBusinessRemotes();
+      if (businessRemotes != null)
+      {
+         // For each business remote
+         for (String businessRemote : businessRemotes)
+         {
+            // Load the Class
+            Class<?> businessRemoteClass = null;
+            try
+            {
+               businessRemoteClass = Class.forName(businessRemote, true, cl);
+            }
+            catch (ClassNotFoundException e)
+            {
+               throw new RuntimeException("Could not find specified business remote class: " + businessRemote, e);
+            }
+
+            // Obtain all methods declared by the class
+            Method[] declaredMethods = businessRemoteClass.getMethods();
+
+            // Add each method
+            for (Method declaredMethod : declaredMethods)
+            {
+               virtualMethods.add(declaredMethod);
+            }
+         }
+      }
+
+      /*
+       * Business Locals
+       */
+
+      // Obtain all specified business locals
+      BusinessLocalsMetaData businessLocals = smd.getBusinessLocals();
+      if (businessLocals != null)
+      {
+         // For each business local
+         for (String businessLocal : businessLocals)
+         {
+            // Load the Class
+            Class<?> businessLocalClass = null;
+            try
+            {
+               businessLocalClass = Class.forName(businessLocal, true, cl);
+            }
+            catch (ClassNotFoundException e)
+            {
+               throw new RuntimeException("Could not find specified business local class: " + businessLocal, e);
+            }
+
+            // Obtain all methods declared by the class
+            Method[] declaredMethods = businessLocalClass.getMethods();
+
+            // Add each method
+            for (Method declaredMethod : declaredMethods)
+            {
+               virtualMethods.add(declaredMethod);
+            }
+         }
+      }
+
+      // Remote Home
+      String remoteHomeClassName = smd.getHome();
+      if (remoteHomeClassName != null)
+      {
+         Class<?> remoteHomeClass = null;
+         try
+         {
+            remoteHomeClass = Class.forName(remoteHomeClassName, true, cl);
+         }
+         catch (ClassNotFoundException e)
+         {
+            throw new RuntimeException("Could not find specified Remote Home Class: " + remoteHomeClassName, e);
+         }
+         if (remoteHomeClass != null)
+         {
+            Method[] declaredMethods = remoteHomeClass.getMethods();
+            for (Method declaredMethod : declaredMethods)
+               virtualMethods.add(declaredMethod);
+
+            declaredMethods = javax.ejb.EJBObject.class.getMethods();
+            for (Method declaredMethod : declaredMethods)
+               virtualMethods.add(declaredMethod);
+         }
+      }
+
+      // Local Home
+      String localHomeClassName = smd.getLocalHome();
+      if (localHomeClassName != null)
+      {
+         Class<?> localHomeClass = null;
+         try
+         {
+            localHomeClass = Class.forName(localHomeClassName, true, cl);
+         }
+         catch (ClassNotFoundException e)
+         {
+            throw new RuntimeException("Could not find specified Local Home Class: " + localHomeClass, e);
+         }
+         if (localHomeClass != null)
+         {
+            Method[] declaredMethods = localHomeClass.getMethods();
+            for (Method declaredMethod : declaredMethods)
+               virtualMethods.add(declaredMethod);
+
+            declaredMethods = javax.ejb.EJBLocalObject.class.getMethods();
+            for (Method declaredMethod : declaredMethods)
+               virtualMethods.add(declaredMethod);
+         }
+      }
+
+      return virtualMethods;
+   }
+
+   // --------------------------------------------------------------------------------||
    // Accessors / Mutators -----------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
@@ -355,4 +629,14 @@
    {
       this.jndiContext = jndiContext;
    }
+
+   public Advisor getAdvisor()
+   {
+      return advisor;
+   }
+
+   public void setAdvisor(Advisor advisor)
+   {
+      this.advisor = advisor;
+   }
 }

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-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatefulContainer.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,15 +21,12 @@
  */
 package org.jboss.ejb3.test.proxy.common.container;
 
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
+import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
-import org.jboss.ejb3.interceptors.container.StatefulSessionContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.StatefulSessionInvokableContext;
-import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandlerBase;
 import org.jboss.ejb3.proxy.objectstore.ObjectStoreBindings;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
@@ -41,9 +38,7 @@
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision: $
  */
-public class StatefulContainer extends SessionSpecContainer
-      implements
-         StatefulSessionInvokableContext<StatefulSessionContainerMethodInvocation>
+public class StatefulContainer extends SessionSpecContainer implements StatefulSessionInvokableContext
 {
 
    // --------------------------------------------------------------------------------||
@@ -78,10 +73,10 @@
     * 
     * @return
     */
-   public Object createSession()
+   public Serializable createSession()
    {
       // Create a new Session ID
-      Object sessionId = UUID.randomUUID();
+      Serializable sessionId = UUID.randomUUID();
 
       // Create a new Instance
       Object instance = null;
@@ -126,25 +121,18 @@
     * Obtains the appropriate bean instance for invocation
     * as called from the specified proxy
     * 
-    * @param proxy
+    * @param sessionId
     * @return
     */
-   protected Object getBeanInstance(Object proxy)
+   protected Object getBeanInstance(Serializable sessionId)
    {
-      // Obtain the InvocationHandler
-      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
-      assert handler instanceof StatefulProxyInvocationHandlerBase : "SFSB Proxy must be of type "
-            + StatefulProxyInvocationHandlerBase.class.getName();
-      StatefulProxyInvocationHandlerBase sHandler = (StatefulProxyInvocationHandlerBase) handler;
+      // Sanity Check
+      assert sessionId != null : "No Session ID specified, and this is required for SFSB Invocation";
 
-      // Get the Session ID
-      Object sessionId = sHandler.getSessionId();
-      assert sessionId != null : "Proxy has no Session ID set, and this is required for SFSB Invocation";
-
       // Get the corresponding instance from the cache
       Object bean = this.getCache().get(sessionId);
-      assert bean != null : "SFSB Proxy claims Session ID of " + sessionId
-            + ", but no corresponding bean instance could be found";
+      assert bean != null : "Session ID of " + sessionId
+            + " declared, but no corresponding bean instance could be found";
 
       // Return
       return bean;

Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatelessContainer.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatelessContainer.java	2008-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/common/container/StatelessContainer.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,9 +21,9 @@
  */
 package org.jboss.ejb3.test.proxy.common.container;
 
+import java.io.Serializable;
 import java.util.UUID;
 
-import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 import org.jboss.ejb3.proxy.objectstore.ObjectStoreBindings;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
@@ -34,7 +34,7 @@
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
  * @version $Revision: $
  */
-public class StatelessContainer extends SessionSpecContainer implements InvokableContext<ContainerMethodInvocation>
+public class StatelessContainer extends SessionSpecContainer implements InvokableContext
 {
    public StatelessContainer(JBossSessionBeanMetaData metaData, ClassLoader classLoader) throws ClassNotFoundException
    {
@@ -63,13 +63,14 @@
    }
 
    /**
-    * Obtains the appropriate bean instance for invocation
-    * as called from the specified proxy
+    * Obtains the appropriate bean instance for invocation.
+    * Specified Session ID will be ignored
     * 
-    * @param proxy
+    * @param sessionId
     * @return
     */
-   protected Object getBeanInstance(Object proxy)
+   //FIXME: SLSBs have no Session ID
+   protected Object getBeanInstance(Serializable sessionId)
    {
       // Typically this would be obtained from a Pool
       try

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-08-05 04:58:52 UTC (rev 76631)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/spec_3_4_5/unit/SfsbProxyEqualityTestCase.java	2008-08-05 05:00:25 UTC (rev 76632)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.test.proxy.spec_3_4_5.unit;
 
+import java.io.Serializable;
 import java.lang.reflect.Proxy;
 import java.util.UUID;
 
@@ -135,7 +136,7 @@
     * @param proxy
     * @param id
     */
-   private void setSessionIdOnProxy(Object proxy, Object id)
+   private void setSessionIdOnProxy(Object proxy, Serializable id)
    {
       // Get the InvocationHander for the Proxy
       StatefulSessionProxy handler = (StatefulSessionProxy) Proxy.getInvocationHandler(proxy);




More information about the jboss-cvs-commits mailing list