[jboss-cvs] JBossAS SVN: r107899 - in projects/ejb3/branches/infinispan-int: core and 28 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 30 17:27:53 EDT 2010


Author: pferraro
Date: 2010-08-30 17:27:51 -0400 (Mon, 30 Aug 2010)
New Revision: 107899

Added:
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/test/resources/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase-jboss-beans.xml
Removed:
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java
Modified:
   projects/ejb3/branches/infinispan-int/build/pom.xml
   projects/ejb3/branches/infinispan-int/core/pom.xml
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/EJBContainer.java
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3AnnotationHandler.java
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/InfinitePool.java
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/core/resolvers/ScopedEJBReferenceResolver.java
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/AbstractPool.java
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/ThreadlocalPool.java
   projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/statistics/InvocationStatistics.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/common/MockEjb3Deployment.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/NoopBean.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/unit/ThreadLocalPoolStatsTestCase.java
   projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/test/threadlocal/unit/ThreadLocalPoolUnitTestCase.java
   projects/ejb3/branches/infinispan-int/metrics-deployer/pom.xml
   projects/ejb3/branches/infinispan-int/metrics-deployer/src/main/java/org/jboss/ejb3/metrics/deployer/InvocationStatisticMetaMapper.java
   projects/ejb3/branches/infinispan-int/proxy-clustered/pom.xml
   projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateful/StatefulSessionClusteredProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateless/StatelessSessionClusteredProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateful/StatefulClusteredProxyInvocationHandler.java
   projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateless/StatelessClusteredProxyInvocationHandler.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionProxyFactoryBase.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionSpecProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceLocalProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceRemoteProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionLocalProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionProxyFactoryBase.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionRemoteProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionLocalProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionRemoteProxyFactory.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionLocalProxyInvocationHandler.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionProxyInvocationHandlerBase.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionRemoteProxyInvocationHandler.java
   projects/ejb3/branches/infinispan-int/proxy-impl/src/test/java/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java
Log:
merge --depth=infinity -r107376:107885

Modified: projects/ejb3/branches/infinispan-int/build/pom.xml
===================================================================
--- projects/ejb3/branches/infinispan-int/build/pom.xml	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/build/pom.xml	2010-08-30 21:27:51 UTC (rev 107899)
@@ -117,7 +117,7 @@
     <version.ant_ant>1.6.5</version.ant_ant>
     <version.commons-validator_commons-validator>1.3.1</version.commons-validator_commons-validator>
     <version.junit_junit>4.4</version.junit_junit>
-    <version.org.jboss.aop_jboss-aop>2.1.1.GA</version.org.jboss.aop_jboss-aop>
+    <version.org.jboss.aop_jboss-aop>2.1.6.GA</version.org.jboss.aop_jboss-aop>
     <version.org.jboss.aop_jboss-aop-aspects>2.0.0.SP1</version.org.jboss.aop_jboss-aop-aspects>
     <version.org.jboss.common.core>2.2.14.GA</version.org.jboss.common.core>
     <version.org.jboss.deployers>2.0.0.CR5</version.org.jboss.deployers>

Modified: projects/ejb3/branches/infinispan-int/core/pom.xml
===================================================================
--- projects/ejb3/branches/infinispan-int/core/pom.xml	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/pom.xml	2010-08-30 21:27:51 UTC (rev 107899)
@@ -17,7 +17,7 @@
   <!-- Artifact Information -->
   <artifactId>jboss-ejb3-core</artifactId>
   <packaging>jar</packaging>
-  <version>1.5.0-SNAPSHOT</version>
+  <version>1.5.1-SNAPSHOT</version>
   <name>JBoss EJB 3.0 Core</name>
   <url>http://labs.jboss.com/jbossejb3</url>
   <description>JBoss EJB 3.0 Core</description>
@@ -48,6 +48,7 @@
     <version.org.jboss.ejb3.tx2>0.0.1</version.org.jboss.ejb3.tx2>
     <version.sun-jaxws>2.1.1</version.sun-jaxws>
     <version.org.jboss.ejb3.async>1.0.0-alpha-5</version.org.jboss.ejb3.async>
+    <version.org.jboss.ejb3.instantiator>1.0.0-alpha-2</version.org.jboss.ejb3.instantiator>
   </properties>
 
   <!-- Build Information -->
@@ -508,13 +509,13 @@
     <dependency>
       <groupId>org.jboss.ejb3.timeout</groupId>
       <artifactId>jboss-ejb3-timeout-spi</artifactId>
-      <version>0.2.0-SNAPSHOT</version>
+      <version>0.2.0</version>
     </dependency>
 
     <dependency>
       <groupId>org.jboss.ejb3.timeout</groupId>
       <artifactId>jboss-ejb3-timeout-3.0</artifactId>
-      <version>0.2.0-SNAPSHOT</version>
+      <version>0.2.0</version>
       <scope>test</scope>
     </dependency>
 
@@ -529,6 +530,18 @@
       <artifactId>jboss-ejb3-vfs-spi</artifactId>
       <version>1.0.0-alpha-1</version>
     </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.ejb3.instantiator</groupId>
+      <artifactId>jboss-ejb3-instantiator-spi</artifactId>
+      <version>${version.org.jboss.ejb3.instantiator}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3.instantiator</groupId>
+      <artifactId>jboss-ejb3-instantiator-impl</artifactId>
+      <version>${version.org.jboss.ejb3.instantiator}</version>
+      <scope>test</scope>
+    </dependency>
 
     <dependency>
       <groupId>org.jboss.embedded</groupId>

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/EJBContainer.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/EJBContainer.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/EJBContainer.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -83,6 +83,9 @@
 import org.jboss.ejb3.common.spi.ErrorCodes;
 import org.jboss.ejb3.deployers.JBoss5DependencyPolicy;
 import org.jboss.ejb3.injection.InjectionInvocation;
+import org.jboss.ejb3.instantiator.spi.BeanInstantiationException;
+import org.jboss.ejb3.instantiator.spi.BeanInstantiator;
+import org.jboss.ejb3.instantiator.spi.InvalidConstructionParamsException;
 import org.jboss.ejb3.interceptor.InterceptorInfoRepository;
 import org.jboss.ejb3.interceptor.InterceptorInjector;
 import org.jboss.ejb3.interceptors.container.ManagedObjectAdvisor;
@@ -152,6 +155,11 @@
    private static final Logger log = Logger.getLogger(EJBContainer.class);
 
    private static TimeoutMethodCallbackRequirements timeoutMethodCallbackRequirements = Service.loadService(TimeoutMethodCallbackRequirements.class);
+   
+   /**
+    * Empty parameter set used to create new EJB3 bean instances
+    */
+   private static final Object[] BEAN_INSTANCE_CONSTRUCTION_PARAMS = new Object[]{};
 
    private final String name;
    
@@ -194,6 +202,11 @@
    private HashMap<Class<?>, InterceptorInjector> interceptorInjectors = new HashMap<Class<?>, InterceptorInjector>();
 
    private Ejb3Deployment deployment;
+   
+   /**
+    * Used to construct bean instances
+    */
+   protected BeanInstantiator beanInstantiator;
 
    private DependencyPolicy dependencyPolicy;
 
@@ -283,14 +296,27 @@
 
       initialContextProperties = ctxProperties;
 
+      // pull out some info from the deployment (if present)
       if(deployment != null)
+      {
+         // set the dependency policy
          this.dependencyPolicy = deployment.createDependencyPolicy(this);
+         
+         // Set the bean instantiator
+         final BeanInstantiator beanInstantiator = deployment.getBeanInstantiator();
+         if (beanInstantiator != null)
+         {
+            this.beanInstantiator = beanInstantiator;            
+         }
 
+      }
+
       Advisor advisor = getAdvisor();
       AdviceStack stack = advisor.getManager().getAdviceStack("InjectionCallbackStack");
       if(stack == null)
          throw new IllegalStateException("EJBTHREE-2020: No InjectionCallbackStack defined for domain " + domain + " of " + this);
       injectionCallbackStack = stack.createInterceptors(advisor, null);
+      
    }
    
    /**
@@ -909,34 +935,25 @@
       return partitionName;
    }
 
+   /**
+    * Delegates bean instance construction to the
+    * {@link EJBContainer#beanInstantiator}
+    * @return
+    */
    protected Object construct()
    {
-      /*
       try
       {
-         return beanContainer.construct();
+         return beanInstantiator.create(beanClass, BEAN_INSTANCE_CONSTRUCTION_PARAMS);
       }
-      catch (SecurityException e)
+      catch (final InvalidConstructionParamsException e)
       {
          throw new RuntimeException(e);
       }
-      catch (NoSuchMethodException e)
+      catch (final BeanInstantiationException e)
       {
          throw new RuntimeException(e);
       }
-      */
-      try
-      {
-         return beanClass.newInstance();
-      }
-      catch (InstantiationException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (IllegalAccessException e)
-      {
-         throw new RuntimeException(e);
-      }
    }
    
    protected void reinitialize()
@@ -959,6 +976,12 @@
 
    public void create() throws Exception
    {
+      if (this.beanInstantiator == null)
+      {
+         throw new IllegalStateException("Bean instantiator hasn't been configured in container, for EJB named: "
+               + this.getEjbName());
+      }
+      
       // Blocking invocations until start()
       this.blockInvocations();
 
@@ -1998,4 +2021,9 @@
       interceptors.addAll(Arrays.asList(stack.createInterceptors(this.getAdvisor(), joinPoint)));
       return interceptors.toArray(new Interceptor[]{});
    }
+   
+   protected BeanInstantiator getBeanInstantiator()
+   {
+      return this.beanInstantiator;
+   }
 }

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3AnnotationHandler.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3AnnotationHandler.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3AnnotationHandler.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -261,8 +261,11 @@
       DomainDefinition domain = AspectManager.instance().getContainer(containerName);
 
       if (domain == null)
-         throw new RuntimeException("No container configured with name '"
-                 + containerName + "''");
+      {
+         throw new RuntimeException("Could not get container for bean class " + beanMetaData.getEjbClass()
+               + " with bean name " + beanMetaData.getEjbName() + " because no container configured with name '"
+               + containerName + "'");
+      }
 
       return new ServiceContainer(deployment.getMbeanServer(), di.getClassLoader(), className,
               ejbNames.get(ejbIndex), (Domain) domain.getManager(), ctxProperties,
@@ -276,8 +279,11 @@
       DomainDefinition domain = AspectManager.instance().getContainer(containerName);
 
       if (domain == null)
-         throw new RuntimeException("No container configured with name '"
-                 + containerName + "''");
+      {
+         throw new RuntimeException("Could not get container for bean class " + beanMetaData.getEjbClass()
+               + " with bean name " + beanMetaData.getEjbName() + " because no container configured with name '"
+               + containerName + "'");
+      }
 
       return new ConsumerContainer(ejbNames.get(ejbIndex), (Domain) domain.getManager(),
               di.getClassLoader(), className, ctxProperties,
@@ -291,8 +297,11 @@
       DomainDefinition domain = AspectManager.instance().getContainer(containerName);
 
       if (domain == null)
-         throw new RuntimeException("No container configured with name '"
-                 + containerName + "''");
+      {
+         throw new RuntimeException("Could not get container for bean class " + beanMetaData.getEjbClass()
+               + " with bean name " + beanMetaData.getEjbName() + " because no container configured with name '"
+               + containerName + "'");
+      }
 
       return new StatefulContainer(di.getClassLoader(), className, ejbNames.get(ejbIndex),
             (Domain) domain.getManager(), ctxProperties, deployment, beanMetaData, deployment
@@ -307,8 +316,11 @@
       DomainDefinition domain = AspectManager.instance().getContainer(containerName);
 
       if (domain == null)
-         throw new RuntimeException("No container configured with name '"
-                 + containerName + "''");
+      {
+         throw new RuntimeException("Could not get container for bean class " + beanMetaData.getEjbClass()
+               + " with bean name " + beanMetaData.getEjbName() + " because no container configured with name '"
+               + containerName + "'");
+      }
 
       return new StatelessContainer(di.getClassLoader(), className, ejbNames.get(ejbIndex), (Domain) domain
             .getManager(), ctxProperties, deployment, beanMetaData, deployment.getAsynchronousProcessor());
@@ -332,8 +344,11 @@
       DomainDefinition domain = AspectManager.instance().getContainer(containerName);
 
       if (domain == null)
-         throw new RuntimeException("No container configured with name '"
-                 + containerName + "''");
+      {
+         throw new RuntimeException("Could not get container for bean class " + beanMetaData.getEjbClass()
+               + " with bean name " + beanMetaData.getEjbName() + " because no container configured with name '"
+               + containerName + "'");
+      }
 
       MDB container = new MDB(ejbNames.get(ejbIndex), (Domain) domain.getManager(), di.getClassLoader(), className,
               ctxProperties, deployment, beanMetaData);

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -51,6 +51,8 @@
 import org.jboss.ejb3.common.lang.ClassHelper;
 import org.jboss.ejb3.common.resolvers.spi.EjbReference;
 import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
+import org.jboss.ejb3.instantiator.spi.AttachmentNames;
+import org.jboss.ejb3.instantiator.spi.BeanInstantiator;
 import org.jboss.ejb3.javaee.JavaEEApplication;
 import org.jboss.ejb3.javaee.JavaEEComponent;
 import org.jboss.ejb3.javaee.JavaEEComponentHelper;
@@ -137,6 +139,11 @@
    private PersistenceUnitDependencyResolver persistenceUnitDependencyResolver;
    
    private final ExecutorService asynchronousProcessor;
+   
+   /**
+    * Used to construct bean instances
+    */
+   private final BeanInstantiator beanInstantiator;
 
    /**
     * Do not deploy persistence unit anymore.
@@ -175,6 +182,15 @@
          throw new IllegalStateException(unit + " must contain an attachment of name " + asyncInvocationProcessorName);
       }
       this.asynchronousProcessor = es;
+      
+      // Get the Bean Instantiator
+      final String beanInstantiatorAttachmentName = AttachmentNames.NAME_BEAN_INSTANCE_INSTANTIATOR;
+      final BeanInstantiator beanInstantiator = (BeanInstantiator) unit.getAttachment(beanInstantiatorAttachmentName);
+      if (beanInstantiator == null)
+      {
+         throw new IllegalStateException(unit + " must contain an attachment of name " + beanInstantiatorAttachmentName);
+      }
+      this.beanInstantiator = beanInstantiator;
    }
 
    @Deprecated
@@ -242,6 +258,11 @@
    {
       return asynchronousProcessor;
    }
+   
+   public BeanInstantiator getBeanInstantiator()
+   {
+      return beanInstantiator;
+   }
 
    @Inject
    public void setMessageDestinationReferenceResolver(MessageDestinationReferenceResolver resolver)

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/InfinitePool.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/InfinitePool.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/InfinitePool.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -35,7 +35,12 @@
 public class InfinitePool extends AbstractPool
 {
    private List<BeanContext> active = new LinkedList<BeanContext>();
-   
+
+   /**
+    * Needs to be part of the sync block, because else other threads will miss it.
+    */
+   private int size;
+
    public void destroy()
    {
       for(BeanContext ctx : active)
@@ -44,6 +49,7 @@
          super.remove(ctx);
       }
       active = null;
+      size = 0;
    }
 
    public BeanContext<?> get()
@@ -57,6 +63,7 @@
       synchronized(active)
       {
          active.add(ctx);
+         size = active.size();
       }
       return ctx;
    }
@@ -68,7 +75,7 @@
 
    public int getCurrentSize()
    {
-      return active.size();
+      return size;
    }
 
    public int getMaxSize()
@@ -86,6 +93,7 @@
       synchronized(active)
       {
          active.remove(ctx);
+         size = active.size();
       }
       
       super.remove(ctx);

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/core/resolvers/ScopedEJBReferenceResolver.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/core/resolvers/ScopedEJBReferenceResolver.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/core/resolvers/ScopedEJBReferenceResolver.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,8 @@
  */
 package org.jboss.ejb3.core.resolvers;
 
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 
 import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -53,7 +55,9 @@
     * @param du
     * @param reference
     * @return
+    * @deprecated Use {@link #resolveWithinDeploymentUnit(DeploymentUnit, Collection, EjbReference)}
     */
+   @Deprecated
    protected String findWithin(DeploymentUnit du, DeploymentUnit excludeChild, EjbReference reference)
    {
       String jndiName = find(du, reference);
@@ -81,11 +85,86 @@
       return null;
    }
    
+   /**
+    * {@inheritDoc}
+    */
+   @Override
    public String resolveEjb(DeploymentUnit du, EjbReference reference) throws UnresolvableReferenceException
    {
-      String jndiName = findWithin(du, null, reference);
+      String jndiName = resolveWithinDeploymentUnit(du, new HashSet<DeploymentUnit>(), reference);
       if(jndiName == null)
          throw new UnresolvableReferenceException("Could not resolve reference " + reference + " in " + du);
       return jndiName;
    }
+   
+   /**
+    * This method first tries to resolve the passed {@link EjbReference} in the passed <code>du</code>.
+    * If the jndi name cannot be resolved in that {@link DeploymentUnit}, then it tries to <i>recursively</i> resolve the reference
+    * in the child {@link DeploymentUnit}s of that {@link DeploymentUnit}. If the jndi-name still can't be resolved, then
+    * this method recursively repeats the resolution steps with the parent of the passed {@link DeploymentUnit}
+    * 
+    * <p>
+    *   If the jndi-name cannot be resolved in any of the {@link DeploymentUnit}s in the hierarchy, then this method
+    *   returns null. Else it returns the resolved jndi-name.
+    * </p>
+    *  
+    * @param du The deployment unit within which the {@link EjbReference} will be resolved
+    * @param alreadyScannedDUs The {@link DeploymentUnit}s which have already been scanned for resolving the {@link EjbReference}
+    * @param reference The {@link EjbReference} which is being resolved
+    * @return Returns the jndi-name resolved out the {@link EjbReference}. If the jndi-name cannot be resolved, then this
+    *           method returns null.
+    */
+   protected String resolveWithinDeploymentUnit(DeploymentUnit du, Collection<DeploymentUnit> alreadyScannedDUs, EjbReference reference)
+   {
+      // first find in the passed DU
+      String jndiName = find(du, reference);
+      // found, just return it
+      if(jndiName != null)
+      {
+         return jndiName;
+      }
+      
+      if (alreadyScannedDUs == null)
+      {
+         alreadyScannedDUs = new HashSet<DeploymentUnit>();
+      }
+      
+      // jndi-name not resolved in the passed DU, so let's
+      // check try resolving in its children DUs
+      List<DeploymentUnit> children = du.getChildren();
+      if(children != null)
+      {
+         for(DeploymentUnit child : children)
+         {
+            // already searched that one
+            if(alreadyScannedDUs.contains(child))
+            {
+               continue;
+            }
+            // try resolving in this child DU
+            jndiName = resolveWithinDeploymentUnit(child, alreadyScannedDUs, reference);
+            // found in this child DU (or its nested child), return the jndi name
+            if(jndiName != null)
+            {
+               return jndiName;
+            }
+            // add the child DU to the already scanned DU collection
+            // so that we don't scan it again
+            alreadyScannedDUs.add(child);
+         }
+      }
+      
+      // add this DU to the already scanned DU collection
+      alreadyScannedDUs.add(du);
+      
+      // we haven't yet resolved the jndi-name, so let's
+      // try resolving in our parent (and any of its children)
+      DeploymentUnit parent = du.getParent();
+      if(parent != null)
+      {
+         return resolveWithinDeploymentUnit(parent, alreadyScannedDUs, reference);
+      }
+      // couldn't resolve in the entire DU hierarchy, return null
+      return null;
+   }
 }

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/AbstractPool.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/AbstractPool.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/AbstractPool.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -26,6 +26,8 @@
 import org.jboss.injection.Injector;
 import org.jboss.logging.Logger;
 
+import java.util.concurrent.atomic.AtomicInteger;
+
 /**
  * The base of all pool implementations.
  *
@@ -40,8 +42,8 @@
 
    protected Injector[] injectors;
    protected Container container;
-   protected int createCount = 0;
-   protected int removeCount = 0;
+   private AtomicInteger createCount = new AtomicInteger(0);
+   private AtomicInteger removeCount = new AtomicInteger(0);
 
    public AbstractPool()
    {
@@ -50,12 +52,12 @@
 
    public int getCreateCount()
    {
-      return createCount;
+      return createCount.get();
    }
 
    public int getRemoveCount()
    {
-      return removeCount;
+      return removeCount.get();
    }
 
    public void initialize(Container container, int maxSize, long timeout)
@@ -91,7 +93,7 @@
 
       // the init method only applies to stateful session beans
 
-      ++createCount;
+      createCount.incrementAndGet();
 
       return ctx;
    }
@@ -131,7 +133,7 @@
       finally
       {
          ctx.remove();
-         ++removeCount;
+         removeCount.incrementAndGet();
       }
    }
 }

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/ThreadlocalPool.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/ThreadlocalPool.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/pool/ThreadlocalPool.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -28,7 +28,9 @@
 import org.jboss.lang.ref.WeakThreadLocal;
 import org.jboss.logging.Logger;
 
+import java.util.concurrent.atomic.AtomicInteger;
 
+
 /**
  * Pools EJBs within a ThreadLocal.
  *
@@ -41,7 +43,7 @@
    
    protected Pool pool = new InfinitePool();
    protected WeakThreadLocal<BeanContext> currentBeanContext = new WeakThreadLocal<BeanContext>();
-   private int inUse = 0;
+   private AtomicInteger inUse = new AtomicInteger();
    
    public ThreadlocalPool()
    {
@@ -60,7 +62,7 @@
    public void discard(BeanContext obj)
    {
       pool.discard(obj);
-      --inUse;
+      inUse.decrementAndGet();
    }
    
    public void destroy()
@@ -72,47 +74,32 @@
       // This really serves little purpose, because we want the whole thread local map to die
       currentBeanContext.remove();
       
-      inUse = 0;
+      inUse.getAndSet(0);
    }
    
    public BeanContext get()
    {
-      BeanContext ctx = null;
-      
-      synchronized(pool)
-      {
-         ctx = currentBeanContext.get();
-         if (ctx != null)
-         {
-            currentBeanContext.set(null);
-            ++inUse;
-            return ctx;
-         }
-   
+      BeanContext ctx = currentBeanContext.get();
+      if (ctx != null)
+         currentBeanContext.set(null);
+      else
          ctx = create();
-         ++inUse;
-      }
+
+      inUse.incrementAndGet();
       
       return ctx;
    }
 
    public BeanContext get(Class[] initTypes, Object[] initValues)
    {
-      BeanContext ctx = null;
-      synchronized(pool)
-      {
-         ctx = currentBeanContext.get();
-         if (ctx != null)
-         {
-            currentBeanContext.set(null);
-            ++inUse;
-            return ctx;
-         }
-   
+      BeanContext ctx = currentBeanContext.get();
+      if (ctx != null)
+         currentBeanContext.set(null);
+      else
          ctx = create(initTypes, initValues);
-         ++inUse;
-      }
-      
+
+      inUse.incrementAndGet();
+
       return ctx;
    }
 
@@ -123,19 +110,12 @@
    
    public void release(BeanContext ctx)
    {
-      synchronized(pool)
-      {
-         if (currentBeanContext.get() != null)
-         {
-            remove(ctx);
-         }
-         else
-         {
-            currentBeanContext.set(ctx);
-         }
-         
-         --inUse;
-      }
+      if (currentBeanContext.get() != null)
+         remove(ctx);
+      else
+         currentBeanContext.set(ctx);
+
+      inUse.decrementAndGet();
    }
    
    public void remove(BeanContext ctx)
@@ -155,7 +135,7 @@
    
    public int getAvailableCount()
    {
-      return getMaxSize() - inUse;
+      return getMaxSize() - inUse.get();
    }
    
    public int getCreateCount()

Modified: projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/statistics/InvocationStatistics.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/statistics/InvocationStatistics.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/main/java/org/jboss/ejb3/statistics/InvocationStatistics.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -29,6 +29,7 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
 
 /** A method invocation statistics collection class.
  *
@@ -42,25 +43,45 @@
    /** The method invocations */
    private Map<String, TimeStatistic> methodStats;
 
-   public long concurrentCalls = 0;
-   public long maxConcurrentCalls = 0;
+   public AtomicLong concurrentCalls = new AtomicLong();
+   public volatile long maxConcurrentCalls = 0;
    public long lastResetTime = System.currentTimeMillis();
 
    public class TimeStatistic implements Serializable
    {
       private static final long serialVersionUID = -3717837456831579570L;
       
-      public volatile long count;
-      public volatile long minTime = Long.MAX_VALUE;
-      public volatile long maxTime;
-      public volatile long totalTime;
+      private AtomicLong count = new AtomicLong();
+      private volatile long minTime = Long.MAX_VALUE;
+      private volatile long maxTime;
+      private AtomicLong totalTime = new AtomicLong();
 
+      public long getCount()
+      {
+         return count.get();
+      }
+
+      public long getMaxTime()
+      {
+         return maxTime;
+      }
+
+      public long getMinTime()
+      {
+         return minTime;
+      }
+
+      public long getTotalTime()
+      {
+         return totalTime.get();
+      }
+
       public void reset()
       {
-         count = 0;
+         count.set(0);
          minTime = Long.MAX_VALUE;
          maxTime = 0;
-         totalTime = 0;
+         totalTime.set(0);
       }
    }
 
@@ -75,32 +96,41 @@
     * @param m the method to update the statistics for.
     * @param elapsed the elapsed time in milliseconds for the invocation.
     */
-   public synchronized void updateStats(Method m, long elapsed)
+   public void updateStats(Method m, long elapsed)
    {
-      TimeStatistic stat = (TimeStatistic) methodStats.get(m.getName());
+      TimeStatistic stat = methodStats.get(m.getName());
       if (stat == null)
       {
-         stat = new TimeStatistic();
-         methodStats.put(m.getName(), stat);
+         synchronized (methodStats)
+         {
+            stat = methodStats.get(m.getName());
+            if (stat == null)
+            {
+               stat = new TimeStatistic();
+               methodStats.put(m.getName(), stat);
+            }
+         }
       }
-      stat.count++;
-      stat.totalTime += elapsed;
+      // Does it really matter if a stat is off for a tick?
+      stat.count.incrementAndGet();
+      stat.totalTime.addAndGet(elapsed);
+      // Eventually it'll be close to accurate
       if (stat.minTime > elapsed)
          stat.minTime = elapsed;
       if (stat.maxTime < elapsed)
          stat.maxTime = elapsed;
    }
 
-   public synchronized void callIn()
+   public void callIn()
    {
-      concurrentCalls++;
-      if (concurrentCalls > maxConcurrentCalls)
-         maxConcurrentCalls = concurrentCalls;
+      long calls = concurrentCalls.incrementAndGet();
+      if (calls > maxConcurrentCalls)
+         maxConcurrentCalls = calls;
    }
 
-   public synchronized void callOut()
+   public void callOut()
    {
-      concurrentCalls--;
+      concurrentCalls.decrementAndGet();
    }
 
    /** Resets all current TimeStatistics.

Modified: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/common/MockEjb3Deployment.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/common/MockEjb3Deployment.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/common/MockEjb3Deployment.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -41,6 +41,7 @@
 import org.jboss.ejb3.common.resolvers.plugins.FirstMatchEjbReferenceResolver;
 import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
 import org.jboss.ejb3.deployers.JBoss5DependencyPolicy;
+import org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator;
 import org.jboss.ejb3.javaee.JavaEEComponent;
 import org.jboss.ejb3.pool.PoolFactory;
 import org.jboss.ejb3.pool.PoolFactoryRegistry;
@@ -58,12 +59,16 @@
    public static MockEjb3Deployment create(DeploymentUnit unit)
    {
       unit.addAttachment(AttachmentNames.ASYNC_INVOCATION_PROCESSOR, Executors.newCachedThreadPool());
+      unit.addAttachment(org.jboss.ejb3.instantiator.spi.AttachmentNames.NAME_BEAN_INSTANCE_INSTANTIATOR,
+            new Ejb31SpecBeanInstantiator());
       return new MockEjb3Deployment(unit);
    }
 
    public static MockEjb3Deployment create(DeploymentUnit unit, org.jboss.deployers.structure.spi.DeploymentUnit du)
    {
       unit.addAttachment(AttachmentNames.ASYNC_INVOCATION_PROCESSOR, Executors.newCachedThreadPool());
+      unit.addAttachment(org.jboss.ejb3.instantiator.spi.AttachmentNames.NAME_BEAN_INSTANCE_INSTANTIATOR,
+            new Ejb31SpecBeanInstantiator());
       return new MockEjb3Deployment(unit, du);
    }
    

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference)

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver)

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.test.ejbreference.resolver;
-
-/**
- * Calculator
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
-public interface Calculator
-{
-
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Calculator.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.core.test.ejbreference.resolver;
+
+/**
+ * Calculator
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface Calculator
+{
+
+}

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.test.ejbreference.resolver;
-
-/**
- * Echo
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
-public interface Echo
-{
-
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/Echo.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.core.test.ejbreference.resolver;
+
+/**
+ * Echo
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface Echo
+{
+
+}

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.test.ejbreference.resolver;
-
-import javax.ejb.Local;
-import javax.ejb.Stateless;
-
-/**
- * EchoBean
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
- at Stateless
- at Local (Echo.class)
-public class EchoBean
-{
-
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/EchoBean.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.core.test.ejbreference.resolver;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+/**
+ * EchoBean
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local (Echo.class)
+public class EchoBean
+{
+
+}

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.test.ejbreference.resolver;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
-
-/**
- * A Mock DeploymentUnit with support to:
- * 
- * - Add attachments
- * - Manage the parent/child relationship
- * - toString()
- * - Get the ClassLoader
- */
-public class MockDeploymentUnit extends AbstractDeploymentUnit implements DeploymentUnit
-{
-
-   // --------------------------------------------------------------------------------||
-   // Instance Members ---------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   private String name;
-
-   private DeploymentUnit parent;
-
-   private List<DeploymentUnit> children;
-
-   private Map<String, Object> attachments;
-
-   // --------------------------------------------------------------------------------||
-   // Constructors -------------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   public MockDeploymentUnit(String name)
-   {
-      this.name = name;
-      this.children = new ArrayList<DeploymentUnit>();
-      this.attachments = new HashMap<String, Object>();
-   }
-
-   public MockDeploymentUnit(String name, DeploymentUnit parent)
-   {
-      this(name);
-      this.parent = parent;
-   }
-
-   // --------------------------------------------------------------------------------||
-   // Functional Methods -------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   public void addChild(DeploymentUnit child)
-   {
-      this.children.add(child);
-   }
-
-   // --------------------------------------------------------------------------------||
-   // Overridden Implementations -----------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   @Override
-   public List<DeploymentUnit> getChildren()
-   {
-      return this.children;
-   }
-
-   @Override
-   public DeploymentUnit getParent()
-   {
-      return this.parent;
-   }
-
-   @Override
-   public Object addAttachment(String name, Object attachment)
-   {
-      return this.attachments.put(name, attachment);
-   }
-
-   @Override
-   public Object getAttachment(String name)
-   {
-      return this.attachments.get(name);
-   }
-
-   @Override
-   public Map<String, Object> getAttachments()
-   {
-      return Collections.unmodifiableMap(this.attachments);
-   }
-
-   @Override
-   public String toString()
-   {
-      return this.getClass().getName() + ": " + this.name;
-   }
-
-   @Override
-   public ClassLoader getClassLoader()
-   {
-      return Thread.currentThread().getContextClassLoader();
-   }
-
-   @Override
-   public DeploymentUnit getTopLevel()
-   {
-      // if this is the top most level, then it won't have a parent,
-      // so return this deployment unit as the top most deployment unit
-      if (parent == null)
-      {
-         return this;
-      }
-      // this is not the top most level, so let's go to parent and 
-      // keep traversing till the top most level
-      return parent.getTopLevel();
-   }
-}
\ No newline at end of file

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/MockDeploymentUnit.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.core.test.ejbreference.resolver;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
+
+/**
+ * A Mock DeploymentUnit with support to:
+ * 
+ * - Add attachments
+ * - Manage the parent/child relationship
+ * - toString()
+ * - Get the ClassLoader
+ */
+public class MockDeploymentUnit extends AbstractDeploymentUnit implements DeploymentUnit
+{
+
+   // --------------------------------------------------------------------------------||
+   // Instance Members ---------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private String name;
+
+   private DeploymentUnit parent;
+
+   private List<DeploymentUnit> children;
+
+   private Map<String, Object> attachments;
+
+   // --------------------------------------------------------------------------------||
+   // Constructors -------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   public MockDeploymentUnit(String name)
+   {
+      this.name = name;
+      this.children = new ArrayList<DeploymentUnit>();
+      this.attachments = new HashMap<String, Object>();
+   }
+
+   public MockDeploymentUnit(String name, DeploymentUnit parent)
+   {
+      this(name);
+      this.parent = parent;
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Functional Methods -------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   public void addChild(DeploymentUnit child)
+   {
+      this.children.add(child);
+   }
+
+   // --------------------------------------------------------------------------------||
+   // Overridden Implementations -----------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @Override
+   public List<DeploymentUnit> getChildren()
+   {
+      return this.children;
+   }
+
+   @Override
+   public DeploymentUnit getParent()
+   {
+      return this.parent;
+   }
+
+   @Override
+   public Object addAttachment(String name, Object attachment)
+   {
+      return this.attachments.put(name, attachment);
+   }
+
+   @Override
+   public Object getAttachment(String name)
+   {
+      return this.attachments.get(name);
+   }
+
+   @Override
+   public Map<String, Object> getAttachments()
+   {
+      return Collections.unmodifiableMap(this.attachments);
+   }
+
+   @Override
+   public String toString()
+   {
+      return this.getClass().getName() + ": " + this.name;
+   }
+
+   @Override
+   public ClassLoader getClassLoader()
+   {
+      return Thread.currentThread().getContextClassLoader();
+   }
+
+   @Override
+   public DeploymentUnit getTopLevel()
+   {
+      // if this is the top most level, then it won't have a parent,
+      // so return this deployment unit as the top most deployment unit
+      if (parent == null)
+      {
+         return this;
+      }
+      // this is not the top most level, so let's go to parent and 
+      // keep traversing till the top most level
+      return parent.getTopLevel();
+   }
+}
\ No newline at end of file

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.test.ejbreference.resolver;
-
-import javax.ejb.Local;
-import javax.ejb.Stateless;
-
-/**
- * NotSoSimpleCalculator
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
- at Stateless
- at Local (Calculator.class)
-public class NotSoSimpleCalculator
-{
-
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/NotSoSimpleCalculator.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.core.test.ejbreference.resolver;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+/**
+ * NotSoSimpleCalculator
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local (Calculator.class)
+public class NotSoSimpleCalculator
+{
+
+}

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.test.ejbreference.resolver;
-
-import javax.ejb.Local;
-import javax.ejb.Stateless;
-
-/**
- * SimpleCalculator
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
- at Stateless
- at Local (Calculator.class)
-public class SimpleCalculator
-{
-
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/SimpleCalculator.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.core.test.ejbreference.resolver;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+/**
+ * SimpleCalculator
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local (Calculator.class)
+public class SimpleCalculator
+{
+
+}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit)

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,153 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.test.ejbreference.resolver.unit;
-
-import java.lang.reflect.AnnotatedElement;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.Assert;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb3.common.deployers.spi.AttachmentNames;
-import org.jboss.ejb3.common.metadata.MetadataUtil;
-import org.jboss.ejb3.common.resolvers.spi.EjbReference;
-import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
-import org.jboss.ejb3.core.resolvers.ScopedEJBReferenceResolver;
-import org.jboss.ejb3.core.test.ejbreference.resolver.Echo;
-import org.jboss.ejb3.core.test.ejbreference.resolver.EchoBean;
-import org.jboss.ejb3.core.test.ejbreference.resolver.MockDeploymentUnit;
-import org.jboss.ejb3.core.test.ejbreference.resolver.NotSoSimpleCalculator;
-import org.jboss.ejb3.core.test.ejbreference.resolver.SimpleCalculator;
-import org.jboss.metadata.annotation.creator.ejb.jboss.JBoss50Creator;
-import org.jboss.metadata.annotation.finder.AnnotationFinder;
-import org.jboss.metadata.annotation.finder.DefaultAnnotationFinder;
-import org.jboss.metadata.ejb.jboss.JBoss50MetaData;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests that the {@link ScopedEJBReferenceResolver} functions as expected.
- * 
- * 
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
-public class ScopedEjbReferenceResolverUnitTestCase
-{
-
-   private EjbReferenceResolver scopedResolver;
-
-   @Before
-   public void before()
-   {
-      scopedResolver = new ScopedEJBReferenceResolver();
-   }
-
-   /**
-    * Tests that the {@link ScopedEJBReferenceResolver} returns the expected 
-    * jndi name when a Deployment unit consists more than 2 child deployment units.
-    * 
-    * This test is to make sure that the bug fix for https://jira.jboss.org/browse/EJBTHREE-2145 
-    * works.
-    * 
-    * @throws Exception
-    */
-   @Test
-   public void testParentDUWithMoreThanTwoChildDU() throws Exception
-   {
-      // Make an annotation finder
-      AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
-      JBoss50Creator creator = new JBoss50Creator(finder);
-
-      // Configure to scan the test EJBs
-      Collection<Class<?>> echoBeanDUClasses = new ArrayList<Class<?>>();
-      echoBeanDUClasses.add(EchoBean.class);
-
-      Collection<Class<?>> childOneDUClasses = new ArrayList<Class<?>>();
-      childOneDUClasses.add(SimpleCalculator.class);
-
-      Collection<Class<?>> childTwoDUClasses = new ArrayList<Class<?>>();
-      childTwoDUClasses.add(NotSoSimpleCalculator.class);
-
-      // Make the metadata
-      JBoss50MetaData echoBeanMetaData = creator.create(echoBeanDUClasses);
-      JBoss50MetaData childOneBeanMetaData = creator.create(childOneDUClasses);
-      JBoss50MetaData childTwoBeanMetaData = creator.create(childTwoDUClasses);
-
-      // Decorate all EJBs w/ JNDI Policy
-      MetadataUtil.decorateEjbsWithJndiPolicy(echoBeanMetaData, Thread.currentThread().getContextClassLoader());
-      MetadataUtil.decorateEjbsWithJndiPolicy(childOneBeanMetaData, Thread.currentThread().getContextClassLoader());
-      MetadataUtil.decorateEjbsWithJndiPolicy(childTwoBeanMetaData, Thread.currentThread().getContextClassLoader());
-
-      // create a parent DU
-      MockDeploymentUnit parentDU = new MockDeploymentUnit("Parent DU");
-      // Child1 DU
-      DeploymentUnit childOneDU = new MockDeploymentUnit("Child One DU", parentDU);
-      childOneDU.addAttachment(AttachmentNames.PROCESSED_METADATA, childOneBeanMetaData);
-
-      // Child2 DU
-      DeploymentUnit childTwoDU = new MockDeploymentUnit("Child One DU", parentDU);
-      childTwoDU.addAttachment(AttachmentNames.PROCESSED_METADATA, childTwoBeanMetaData);
-
-      // the DU with the echo bean
-      DeploymentUnit duWithEchoBean = new MockDeploymentUnit("DU With Echo bean", parentDU);
-      duWithEchoBean.addAttachment(AttachmentNames.PROCESSED_METADATA, echoBeanMetaData);
-
-      // Set children of parents for bi-directional support
-      parentDU.addChild(childOneDU);
-      parentDU.addChild(childTwoDU);
-      parentDU.addChild(duWithEchoBean);
-
-      // Create reference to the Echo bean
-      EjbReference echoEjbReference = new EjbReference(null, Echo.class.getName(), null);
-      // resolve it from the child1 DU
-      String jndiNameResolvedFromChildOneDU = this.scopedResolver.resolveEjb(childOneDU, echoEjbReference);
-
-      // Test
-      Assert.assertNotNull("Could not resolve jndi name for " + Echo.class.getName()
-            + " business interface from child1 DU", jndiNameResolvedFromChildOneDU);
-
-      // now resolve the jndi name for the same reference from the other DUs.
-      // Note that since there's only one Echo business interface and bean in the entire DU hierarchy
-      // we should always get back the same jndi name, irrespective of from which DU we start the resolution
-
-      // resolve from child2 DU
-      String jndiNameResolvedFromChildTwoDU = this.scopedResolver.resolveEjb(childTwoDU, echoEjbReference);
-      Assert.assertEquals("Unexpected jndi name for " + Echo.class.getName() + " business interface from child2 DU",
-            jndiNameResolvedFromChildOneDU, jndiNameResolvedFromChildTwoDU);
-
-      // resolve from parent DU
-      String jndiNameResolvedFromParentDU = this.scopedResolver.resolveEjb(parentDU, echoEjbReference);
-      Assert.assertEquals("Unexpected jndi name for " + Echo.class.getName() + " business interface from parent DU",
-            jndiNameResolvedFromChildOneDU, jndiNameResolvedFromParentDU);
-
-      // resolve from the DU which has the EchoBean
-      String jndiNameResolvedFromDUContainingEchoBean = this.scopedResolver
-            .resolveEjb(duWithEchoBean, echoEjbReference);
-      Assert.assertEquals("Unexpected jndi name for " + Echo.class.getName()
-            + " business interface from the DU containing the EchoBean", jndiNameResolvedFromChildOneDU,
-            jndiNameResolvedFromDUContainingEchoBean);
-
-   }
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbreference/resolver/unit/ScopedEjbReferenceResolverUnitTestCase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.core.test.ejbreference.resolver.unit;
+
+import java.lang.reflect.AnnotatedElement;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import junit.framework.Assert;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.ejb3.common.deployers.spi.AttachmentNames;
+import org.jboss.ejb3.common.metadata.MetadataUtil;
+import org.jboss.ejb3.common.resolvers.spi.EjbReference;
+import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
+import org.jboss.ejb3.core.resolvers.ScopedEJBReferenceResolver;
+import org.jboss.ejb3.core.test.ejbreference.resolver.Echo;
+import org.jboss.ejb3.core.test.ejbreference.resolver.EchoBean;
+import org.jboss.ejb3.core.test.ejbreference.resolver.MockDeploymentUnit;
+import org.jboss.ejb3.core.test.ejbreference.resolver.NotSoSimpleCalculator;
+import org.jboss.ejb3.core.test.ejbreference.resolver.SimpleCalculator;
+import org.jboss.metadata.annotation.creator.ejb.jboss.JBoss50Creator;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.annotation.finder.DefaultAnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBoss50MetaData;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests that the {@link ScopedEJBReferenceResolver} functions as expected.
+ * 
+ * 
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class ScopedEjbReferenceResolverUnitTestCase
+{
+
+   private EjbReferenceResolver scopedResolver;
+
+   @Before
+   public void before()
+   {
+      scopedResolver = new ScopedEJBReferenceResolver();
+   }
+
+   /**
+    * Tests that the {@link ScopedEJBReferenceResolver} returns the expected 
+    * jndi name when a Deployment unit consists more than 2 child deployment units.
+    * 
+    * This test is to make sure that the bug fix for https://jira.jboss.org/browse/EJBTHREE-2145 
+    * works.
+    * 
+    * @throws Exception
+    */
+   @Test
+   public void testParentDUWithMoreThanTwoChildDU() throws Exception
+   {
+      // Make an annotation finder
+      AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
+      JBoss50Creator creator = new JBoss50Creator(finder);
+
+      // Configure to scan the test EJBs
+      Collection<Class<?>> echoBeanDUClasses = new ArrayList<Class<?>>();
+      echoBeanDUClasses.add(EchoBean.class);
+
+      Collection<Class<?>> childOneDUClasses = new ArrayList<Class<?>>();
+      childOneDUClasses.add(SimpleCalculator.class);
+
+      Collection<Class<?>> childTwoDUClasses = new ArrayList<Class<?>>();
+      childTwoDUClasses.add(NotSoSimpleCalculator.class);
+
+      // Make the metadata
+      JBoss50MetaData echoBeanMetaData = creator.create(echoBeanDUClasses);
+      JBoss50MetaData childOneBeanMetaData = creator.create(childOneDUClasses);
+      JBoss50MetaData childTwoBeanMetaData = creator.create(childTwoDUClasses);
+
+      // Decorate all EJBs w/ JNDI Policy
+      MetadataUtil.decorateEjbsWithJndiPolicy(echoBeanMetaData, Thread.currentThread().getContextClassLoader());
+      MetadataUtil.decorateEjbsWithJndiPolicy(childOneBeanMetaData, Thread.currentThread().getContextClassLoader());
+      MetadataUtil.decorateEjbsWithJndiPolicy(childTwoBeanMetaData, Thread.currentThread().getContextClassLoader());
+
+      // create a parent DU
+      MockDeploymentUnit parentDU = new MockDeploymentUnit("Parent DU");
+      // Child1 DU
+      DeploymentUnit childOneDU = new MockDeploymentUnit("Child One DU", parentDU);
+      childOneDU.addAttachment(AttachmentNames.PROCESSED_METADATA, childOneBeanMetaData);
+
+      // Child2 DU
+      DeploymentUnit childTwoDU = new MockDeploymentUnit("Child One DU", parentDU);
+      childTwoDU.addAttachment(AttachmentNames.PROCESSED_METADATA, childTwoBeanMetaData);
+
+      // the DU with the echo bean
+      DeploymentUnit duWithEchoBean = new MockDeploymentUnit("DU With Echo bean", parentDU);
+      duWithEchoBean.addAttachment(AttachmentNames.PROCESSED_METADATA, echoBeanMetaData);
+
+      // Set children of parents for bi-directional support
+      parentDU.addChild(childOneDU);
+      parentDU.addChild(childTwoDU);
+      parentDU.addChild(duWithEchoBean);
+
+      // Create reference to the Echo bean
+      EjbReference echoEjbReference = new EjbReference(null, Echo.class.getName(), null);
+      // resolve it from the child1 DU
+      String jndiNameResolvedFromChildOneDU = this.scopedResolver.resolveEjb(childOneDU, echoEjbReference);
+
+      // Test
+      Assert.assertNotNull("Could not resolve jndi name for " + Echo.class.getName()
+            + " business interface from child1 DU", jndiNameResolvedFromChildOneDU);
+
+      // now resolve the jndi name for the same reference from the other DUs.
+      // Note that since there's only one Echo business interface and bean in the entire DU hierarchy
+      // we should always get back the same jndi name, irrespective of from which DU we start the resolution
+
+      // resolve from child2 DU
+      String jndiNameResolvedFromChildTwoDU = this.scopedResolver.resolveEjb(childTwoDU, echoEjbReference);
+      Assert.assertEquals("Unexpected jndi name for " + Echo.class.getName() + " business interface from child2 DU",
+            jndiNameResolvedFromChildOneDU, jndiNameResolvedFromChildTwoDU);
+
+      // resolve from parent DU
+      String jndiNameResolvedFromParentDU = this.scopedResolver.resolveEjb(parentDU, echoEjbReference);
+      Assert.assertEquals("Unexpected jndi name for " + Echo.class.getName() + " business interface from parent DU",
+            jndiNameResolvedFromChildOneDU, jndiNameResolvedFromParentDU);
+
+      // resolve from the DU which has the EchoBean
+      String jndiNameResolvedFromDUContainingEchoBean = this.scopedResolver
+            .resolveEjb(duWithEchoBean, echoEjbReference);
+      Assert.assertEquals("Unexpected jndi name for " + Echo.class.getName()
+            + " business interface from the DU containing the EchoBean", jndiNameResolvedFromChildOneDU,
+            jndiNameResolvedFromDUContainingEchoBean);
+
+   }
+}

Modified: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/NoopBean.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/NoopBean.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/NoopBean.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,18 +21,17 @@
  */
 package org.jboss.ejb3.core.test.ejbthree1703;
 
-import static java.util.concurrent.TimeUnit.SECONDS;
+import org.jboss.logging.Logger;
 
+import javax.annotation.Resource;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
 import java.util.concurrent.BrokenBarrierException;
 import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.TimeoutException;
 
-import javax.annotation.Resource;
-import javax.ejb.SessionContext;
-import javax.ejb.Stateless;
+import static java.util.concurrent.TimeUnit.SECONDS;
 
-import org.jboss.logging.Logger;
-
 /**
  * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
  * @version $Revision: $
@@ -63,7 +62,7 @@
 
    public void shoo(CyclicBarrier entree, CyclicBarrier exit)
    {
-      log.debug("entering barriers");
+      log.debug(Thread.currentThread() + ": entering barriers");
       try
       {
          entree.await(5, SECONDS);

Modified: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/unit/ThreadLocalPoolStatsTestCase.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/unit/ThreadLocalPoolStatsTestCase.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1703/unit/ThreadLocalPoolStatsTestCase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,15 +21,6 @@
  */
 package org.jboss.ejb3.core.test.ejbthree1703.unit;
 
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static junit.framework.Assert.assertEquals;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.ejb3.core.test.common.AbstractEJB3TestCase;
 import org.jboss.ejb3.core.test.ejbthree1703.NoopBean;
@@ -40,7 +31,18 @@
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.concurrent.Callable;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeoutException;
 
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static junit.framework.Assert.assertEquals;
+
+
 /**
  * (created - removed) = (inUse + available)
  * 
@@ -190,20 +192,49 @@
       Future<?> futures[] = new Future[2];
       futures[0] = service.submit(task);
       futures[1] = service.submit(task);
-      
-      entree.await(5, SECONDS);
-      
-      Pool pool = container.getPool();
-      assertEquals(2, pool.getCreateCount());
-      assertEquals("the pool should have grown", 2, pool.getMaxSize());
-      int inUse = pool.getMaxSize() - pool.getAvailableCount();
-      assertEquals("the instance should be in use", 2, inUse);
-      
-      exit.await(5, SECONDS);
-      
-      futures[0].get(5, SECONDS);
-      futures[1].get(5, SECONDS);
-      
+
+      try
+      {
+         entree.await(5, SECONDS);
+
+         try
+         {
+            Pool pool = container.getPool();
+            assertEquals(2, pool.getCreateCount());
+            assertEquals("the pool should have grown", 2, pool.getMaxSize());
+            int inUse = pool.getMaxSize() - pool.getAvailableCount();
+            assertEquals("the instance should be in use", 2, inUse);
+         }
+         finally
+         {
+            exit.await(5, SECONDS);
+         }
+
+         futures[0].get(5, SECONDS);
+         futures[1].get(5, SECONDS);
+      }
+      catch(TimeoutException e)
+      {
+         // something bad must have happened
+         try
+         {
+            futures[0].get(5, SECONDS);
+         }
+         catch(ExecutionException ee)
+         {
+            ee.getCause().printStackTrace();
+         }
+         try
+         {
+            futures[1].get(5, SECONDS);
+         }
+         catch(ExecutionException ee)
+         {
+            ee.getCause().printStackTrace();
+         }
+         throw e;
+      }
+
       service.shutdown();
 
    }

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146 (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146)

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright (c) 2010, JBoss Inc., 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.core.test.ejbthree2146;
-
-import javax.ejb.Stateless;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- */
- at Stateless
-public class AuroraBean implements AuroraLocal
-{
-   @Override
-   public void sleep(long timeout, TimeUnit unit) throws InterruptedException
-   {
-      Thread.sleep(unit.toMillis(timeout));
-   }
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraBean.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., 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.core.test.ejbthree2146;
+
+import javax.ejb.Stateless;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+ at Stateless
+public class AuroraBean implements AuroraLocal
+{
+   @Override
+   public void sleep(long timeout, TimeUnit unit) throws InterruptedException
+   {
+      Thread.sleep(unit.toMillis(timeout));
+   }
+}

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright (c) 2010, JBoss Inc., 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.core.test.ejbthree2146;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- */
-public interface AuroraLocal
-{
-   void sleep(long timeout, TimeUnit unit) throws InterruptedException;
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/AuroraLocal.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., 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.core.test.ejbthree2146;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+public interface AuroraLocal
+{
+   void sleep(long timeout, TimeUnit unit) throws InterruptedException;
+}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit)

Deleted: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java	2010-08-30 12:21:59 UTC (rev 107885)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright (c) 2010, JBoss Inc., 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.core.test.ejbthree2146.unit;
-
-import org.jboss.ejb3.core.test.common.AbstractEJB3TestCase;
-import org.jboss.ejb3.core.test.ejbthree2146.AuroraBean;
-import org.jboss.ejb3.core.test.ejbthree2146.AuroraLocal;
-import org.jboss.ejb3.session.SessionContainer;
-import org.jboss.ejb3.statistics.InvocationStatistics;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Test whether we can actually get some stats.
- * This is to the contract with ejb3-metrics-deployer.
- * 
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- */
-public class WaiterTestCase extends AbstractEJB3TestCase
-{
-   private static SessionContainer container;
-
-   @AfterClass
-   public static void afterClass() throws Exception
-   {
-      undeployEjb(container);
-
-      AbstractEJB3TestCase.afterClass();
-   }
-
-   @BeforeClass
-   public static void beforeClass() throws Exception
-   {
-      AbstractEJB3TestCase.beforeClass();
-      
-      container = deploySessionEjb(AuroraBean.class);
-   }
-
-   @Test
-   public void testStats() throws Exception
-   {
-      AuroraLocal bean = lookup("AuroraBean/local", AuroraLocal.class);
-
-      InvocationStatistics stats = container.getInvokeStats();
-
-      // Since we don't have a prince at hand, lets not sleep forever
-      bean.sleep(100, MILLISECONDS);
-      
-      InvocationStatistics.TimeStatistic methodStat = stats.getStats().get("sleep");
-      assertNotNull(methodStat);
-      long count = methodStat.getCount();
-      assertEquals(1, count);
-      long maxTime = methodStat.getMaxTime();
-      long minTime = methodStat.getMinTime();
-      long totalTime = methodStat.getTotalTime();
-      assertTrue(maxTime == minTime);
-      assertTrue(minTime == totalTime);
-   }
-}

Copied: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java (from rev 107885, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java)
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/core/test/ejbthree2146/unit/WaiterTestCase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., 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.core.test.ejbthree2146.unit;
+
+import org.jboss.ejb3.core.test.common.AbstractEJB3TestCase;
+import org.jboss.ejb3.core.test.ejbthree2146.AuroraBean;
+import org.jboss.ejb3.core.test.ejbthree2146.AuroraLocal;
+import org.jboss.ejb3.session.SessionContainer;
+import org.jboss.ejb3.statistics.InvocationStatistics;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Test whether we can actually get some stats.
+ * This is to the contract with ejb3-metrics-deployer.
+ * 
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+public class WaiterTestCase extends AbstractEJB3TestCase
+{
+   private static SessionContainer container;
+
+   @AfterClass
+   public static void afterClass() throws Exception
+   {
+      undeployEjb(container);
+
+      AbstractEJB3TestCase.afterClass();
+   }
+
+   @BeforeClass
+   public static void beforeClass() throws Exception
+   {
+      AbstractEJB3TestCase.beforeClass();
+      
+      container = deploySessionEjb(AuroraBean.class);
+   }
+
+   @Test
+   public void testStats() throws Exception
+   {
+      AuroraLocal bean = lookup("AuroraBean/local", AuroraLocal.class);
+
+      InvocationStatistics stats = container.getInvokeStats();
+
+      // Since we don't have a prince at hand, lets not sleep forever
+      bean.sleep(100, MILLISECONDS);
+      
+      InvocationStatistics.TimeStatistic methodStat = stats.getStats().get("sleep");
+      assertNotNull(methodStat);
+      long count = methodStat.getCount();
+      assertEquals(1, count);
+      long maxTime = methodStat.getMaxTime();
+      long minTime = methodStat.getMinTime();
+      long totalTime = methodStat.getTotalTime();
+      assertTrue(maxTime == minTime);
+      assertTrue(minTime == totalTime);
+   }
+}

Modified: projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/test/threadlocal/unit/ThreadLocalPoolUnitTestCase.java
===================================================================
--- projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/test/threadlocal/unit/ThreadLocalPoolUnitTestCase.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/core/src/test/java/org/jboss/ejb3/test/threadlocal/unit/ThreadLocalPoolUnitTestCase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -78,7 +78,31 @@
       assertEquals(1, pool.getRemoveCount());
       assertEquals(1, MockBean.finalizers);
    }
-   
+
+   public void testInUse1()
+   {
+      ThreadlocalPool pool = new ThreadlocalPool();
+      Container container = new MockContainer();
+      int maxSize = -1;
+      int timeout = -1;
+      pool.initialize(container, maxSize, timeout);
+
+      assertEquals(0, pool.getAvailableCount());
+      
+      BeanContext ctx = pool.get();
+
+      assertEquals(0, pool.getAvailableCount());
+
+      pool.release(ctx);
+      ctx = null;
+
+      assertEquals(1, pool.getAvailableCount());
+
+      pool.destroy();
+
+      gc();
+   }
+
    public void testWithThreads() throws Exception
    {
       final ThreadlocalPool pool = new ThreadlocalPool();

Modified: projects/ejb3/branches/infinispan-int/metrics-deployer/pom.xml
===================================================================
--- projects/ejb3/branches/infinispan-int/metrics-deployer/pom.xml	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/metrics-deployer/pom.xml	2010-08-30 21:27:51 UTC (rev 107899)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.jboss.ejb3</groupId>
     <artifactId>jboss-ejb3-build</artifactId>
-    <version>1.0.3</version>
+    <version>1.0.13</version>
     <relativePath>../build/pom.xml</relativePath>
   </parent>
 
@@ -14,7 +14,7 @@
   <!-- Artifact Information -->
   <groupId>org.jboss.ejb3</groupId>
   <artifactId>jboss-ejb3-metrics-deployer</artifactId>
-  <version>1.0.3-SNAPSHOT</version>
+  <version>1.1.1-SNAPSHOT</version>
   <packaging>jar</packaging>
   <name>JBoss EJB 3.x Metrics Implementation</name>
   <description>Metrics Implementation for EJB 3.x Containers</description>
@@ -28,7 +28,7 @@
   
     <!-- Versioning -->
     <version.org.jboss.deployers.jboss_deployers_spi>2.0.7.GA</version.org.jboss.deployers.jboss_deployers_spi>
-    <version.org.jboss.ejb3_jboss.ejb3.core>1.1.10</version.org.jboss.ejb3_jboss.ejb3.core>
+    <version.org.jboss.ejb3_jboss.ejb3.core>1.3.6</version.org.jboss.ejb3_jboss.ejb3.core>
     <version.org.jboss.man_jboss.managed>2.1.0.SP1</version.org.jboss.man_jboss.managed>
     <version.org.jboss.microcontainer_jboss.jmx.mc.int>2.2.0.M2</version.org.jboss.microcontainer_jboss.jmx.mc.int>
   

Modified: projects/ejb3/branches/infinispan-int/metrics-deployer/src/main/java/org/jboss/ejb3/metrics/deployer/InvocationStatisticMetaMapper.java
===================================================================
--- projects/ejb3/branches/infinispan-int/metrics-deployer/src/main/java/org/jboss/ejb3/metrics/deployer/InvocationStatisticMetaMapper.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/metrics-deployer/src/main/java/org/jboss/ejb3/metrics/deployer/InvocationStatisticMetaMapper.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,12 +21,6 @@
  */
 package org.jboss.ejb3.metrics.deployer;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
 import org.jboss.ejb3.statistics.InvocationStatistics;
 import org.jboss.ejb3.statistics.InvocationStatistics.TimeStatistic;
 import org.jboss.metatype.api.types.CompositeMetaType;
@@ -39,6 +33,11 @@
 import org.jboss.metatype.api.values.SimpleValueSupport;
 import org.jboss.metatype.spi.values.MetaMapper;
 
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * InvocationStatisticMetaMapper
  *
@@ -167,10 +166,10 @@
 
             // Create a composite view of the stat's state
             final MapCompositeValueSupport cvs = new MapCompositeValueSupport(METHOD_STATS_TYPE);
-            cvs.put(PROP_NAME_METHODSTATS_COUNT, SimpleValueSupport.wrap(stat.count));
-            cvs.put(PROP_NAME_METHODSTATS_MAXTIME, SimpleValueSupport.wrap(stat.maxTime));
-            cvs.put(PROP_NAME_METHODSTATS_MINTIME, SimpleValueSupport.wrap(stat.minTime));
-            cvs.put(PROP_NAME_METHODSTATS_TOTALTIME, SimpleValueSupport.wrap(stat.totalTime));
+            cvs.put(PROP_NAME_METHODSTATS_COUNT, SimpleValueSupport.wrap(stat.getCount()));
+            cvs.put(PROP_NAME_METHODSTATS_MAXTIME, SimpleValueSupport.wrap(stat.getMaxTime()));
+            cvs.put(PROP_NAME_METHODSTATS_MINTIME, SimpleValueSupport.wrap(stat.getMinTime()));
+            cvs.put(PROP_NAME_METHODSTATS_TOTALTIME, SimpleValueSupport.wrap(stat.getTotalTime()));
 
             // Add the stat to the method map
             methodMap.put(method, cvs);

Modified: projects/ejb3/branches/infinispan-int/proxy-clustered/pom.xml
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-clustered/pom.xml	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-clustered/pom.xml	2010-08-30 21:27:51 UTC (rev 107899)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.jboss.ejb3</groupId>
     <artifactId>jboss-ejb3-build</artifactId>
-    <version>1.0.3</version>
+    <version>1.0.13</version>
   </parent>
 
   <!-- Model Version -->
@@ -90,7 +90,7 @@
     <dependency>
       <groupId>org.jboss.ejb3</groupId>
       <artifactId>jboss-ejb3-proxy-impl</artifactId>
-      <version>1.0.10</version>
+      <version>1.0.11-alpha-1</version>
     </dependency>
     
     <dependency>

Modified: projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateful/StatefulSessionClusteredProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateful/StatefulSessionClusteredProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateful/StatefulSessionClusteredProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,8 @@
  */
 package org.jboss.ejb3.proxy.clustered.factory.session.stateful;
 
+import java.io.Serializable;
+
 import org.jboss.aop.Advisor;
 import org.jboss.aop.Dispatcher;
 import org.jboss.aop.advice.Interceptor;
@@ -137,34 +139,36 @@
    
    
    @Override
-   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler()
+   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler(final Serializable sessionId)
    {
-      return createInvocationHandler(null, false);
+      return createInvocationHandler(null, false, sessionId);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(String businessInterfaceName)
+   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(
+         final Serializable sessionId, String businessInterfaceName)
    {
-      return createInvocationHandler(businessInterfaceName, false);
+      return createInvocationHandler(businessInterfaceName, false, sessionId);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler()
+   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler(final Serializable sessionId)
    {
-      return createInvocationHandler(null, false);
+      return createInvocationHandler(null, false, sessionId);
    }
 
    @Override
    protected SessionProxyInvocationHandler createHomeInvocationHandler()
    {
-      return createInvocationHandler(null, true);
+      return createInvocationHandler(null, true, null);
    }
 
    // --------------------------------------------------------------------------------||
    // Private ------------------------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
-   private SessionProxyInvocationHandler createInvocationHandler(String businessInterfaceName, boolean isOnlyHome)   
+   private SessionProxyInvocationHandler createInvocationHandler(String businessInterfaceName, boolean isOnlyHome,
+         final Serializable sessionId)   
    {
       // Obtain target properties
       String containerName = this.getContainerName();
@@ -187,8 +191,8 @@
       
       // Create
       SessionProxyInvocationHandler handler = new StatefulClusteredProxyInvocationHandler(containerName, containerGuid,
-            interceptors, businessInterfaceName, url, beanClusteringInfo.getFamilyWrapper(), 
-            lbp, beanClusteringInfo.getPartitionName());
+            interceptors, businessInterfaceName, sessionId, url, beanClusteringInfo.getFamilyWrapper(), lbp,
+            beanClusteringInfo.getPartitionName());
 
       // Return
       return handler;

Modified: projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateless/StatelessSessionClusteredProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateless/StatelessSessionClusteredProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/factory/session/stateless/StatelessSessionClusteredProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,8 @@
  */
 package org.jboss.ejb3.proxy.clustered.factory.session.stateless;
 
+import java.io.Serializable;
+
 import org.jboss.aop.Advisor;
 import org.jboss.aop.Dispatcher;
 import org.jboss.aop.advice.Interceptor;
@@ -134,19 +136,20 @@
    
    
    @Override
-   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler()
+   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler(final Serializable sessionId)
    {
       return createInvocationHandler(null, false);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(String businessInterfaceName)
+   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(
+         final Serializable sessionId, String businessInterfaceName)
    {
       return createInvocationHandler(businessInterfaceName, false);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler()
+   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler(final Serializable sessionId)
    {
       return createInvocationHandler(null, false);
    }

Modified: projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateful/StatefulClusteredProxyInvocationHandler.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateful/StatefulClusteredProxyInvocationHandler.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateful/StatefulClusteredProxyInvocationHandler.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -23,6 +23,7 @@
 package org.jboss.ejb3.proxy.clustered.handler.session.stateful;
 
 import java.io.Serializable;
+import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.net.MalformedURLException;
 
@@ -58,6 +59,11 @@
    private FamilyWrapper family;
    private LoadBalancePolicy lbPolicy;
    private String partitionName;
+   
+   /**
+    * Remote clustering proxy to the container
+    */
+   private final InvokableContext container;
 
    // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
@@ -71,10 +77,10 @@
     * @param partitionName  name of the cluster partition. Cannot be <code>null</code>.
     */
    public StatefulClusteredProxyInvocationHandler(String containerName, String containerGuid,
-         Interceptor[] interceptors, String businessInterfaceType, String url, FamilyWrapper family,
+         Interceptor[] interceptors, String businessInterfaceType, Object target, String url, FamilyWrapper family,
          LoadBalancePolicy lb, String partitionName)
    {
-      super(containerName, containerGuid, interceptors, businessInterfaceType, url);
+      super(containerName, containerGuid, interceptors, businessInterfaceType, target, url);
       
       assert family != null        : "family is null";
       assert lb != null            : "lb is null";
@@ -83,15 +89,12 @@
       this.family = family;
       this.lbPolicy = lb;
       this.partitionName = partitionName;  
-   }
-
-   // --------------------------------------------------------------------------------||
-   // Required Implementations -------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   @Override
-   protected InvokableContext createRemoteProxyToContainer(String url)
-   {
+      
+      
+      /*
+       * Now create the clustering remote proxy to the container
+       */
+      
       // Create an InvokerLocator
       InvokerLocator locator = null;
       try
@@ -109,23 +112,35 @@
        */
 
       // Get interceptors from the stack
-      Interceptor[] interceptors = this.getInterceptors();
+      final Interceptor[] resolvedInterceptors = this.getInterceptors();
 
       /*
        * Create Proxy
        */
 
       // Create a POJI Proxy to the Container
-      String containerName = this.getContainerName();
       assert containerName != null && containerName.trim().length() > 0 : "Container Name must be set";
-      PojiProxy handler = new InvokableContextClusteredProxyInvocationHandler(this.getContainerName(), this
-            .getContainerGuid(), locator, interceptors, (Serializable) this.getTarget(), this.getFamilyWrapper(), this
-            .getLoadBalancePolicy(), this.getPartitionName(), true);
+      PojiProxy handler = new InvokableContextClusteredProxyInvocationHandler(this.getContainerName(),
+            this.getContainerGuid(), locator, resolvedInterceptors, (Serializable) this.getTarget(),
+            this.getFamilyWrapper(), this.getLoadBalancePolicy(), this.getPartitionName(), true);
       Class<?>[] interfaces = new Class<?>[]
       {InvokableContext.class};
-      InvokableContext container = (InvokableContext) Proxy.newProxyInstance(InvokableContext.class.getClassLoader(),
-            interfaces, handler);
+      final InvokableContext container = (InvokableContext) Proxy.newProxyInstance(
+            InvokableContext.class.getClassLoader(), interfaces, handler);
+      this.container = container;
+   }
 
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler#getContainer(java.lang.reflect.Method, java.lang.Object[])
+    */
+   @Override
+   protected InvokableContext getContainer(final Method method, final Object[] args)
+   {
       // Return
       return container;
    }

Modified: projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateless/StatelessClusteredProxyInvocationHandler.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateless/StatelessClusteredProxyInvocationHandler.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-clustered/src/main/java/org/jboss/ejb3/proxy/clustered/handler/session/stateless/StatelessClusteredProxyInvocationHandler.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.clustered.handler.session.stateless;
 
+import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.net.MalformedURLException;
 
@@ -55,6 +56,8 @@
    private FamilyWrapper family;
    private LoadBalancePolicy lbPolicy;
    private String partitionName;
+   
+   private final InvokableContext container;
 
    // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
@@ -71,33 +74,17 @@
          final Interceptor[] interceptors, final String businessInterfaceType, final String url, 
          FamilyWrapper family, LoadBalancePolicy lb, String partitionName)
    {
-      super(containerName, containerGuid, interceptors, businessInterfaceType, url);
-      
-      assert family != null        : "family is null";
-      assert lb != null            : "lb is null";
+      super(containerName, containerGuid, interceptors, businessInterfaceType, null, url);
+
+      assert family != null : "family is null";
+      assert lb != null : "lb is null";
       assert partitionName != null : "partitionName is null";
-      
+
       this.family = family;
       this.lbPolicy = lb;
-      this.partitionName = partitionName;  
-   }
+      this.partitionName = partitionName;
 
-   // --------------------------------------------------------------------------------||
-   // 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
+      // Create an InvokerLocator
       InvokerLocator locator = null;
       try
       {
@@ -109,36 +96,34 @@
                + "\"", e);
       }
 
-      /*
-       * Define interceptors
-       */
-
-      // Get interceptors from the stack
-      Interceptor[] interceptors = this.getInterceptors();
-
-      /*
-       * Create Proxy
-       */
-
       // Create a POJI Proxy to the Container
-      String containerName = this.getContainerName();
       assert containerName != null && containerName.trim().length() > 0 : "Container Name must be set";
-      PojiProxy handler = new InvokableContextClusteredProxyInvocationHandler(this.getContainerName(), 
-            this.getContainerGuid(), locator, interceptors, null, this.getFamilyWrapper(), 
-            this.getLoadBalancePolicy(), this.getPartitionName(), false);
+      PojiProxy handler = new InvokableContextClusteredProxyInvocationHandler(this.getContainerName(),
+            this.getContainerGuid(), locator, interceptors, null, this.getFamilyWrapper(), this.getLoadBalancePolicy(),
+            this.getPartitionName(), false);
       Class<?>[] interfaces = new Class<?>[]
       {InvokableContext.class};
       InvokableContext container = (InvokableContext) Proxy.newProxyInstance(InvokableContext.class.getClassLoader(),
             interfaces, handler);
-
-      // Return
-      return container;
+      this.container = container;
    }
 
+
    // --------------------------------------------------------------------------------||
    // Accessors / Mutators -----------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler#getContainer(java.lang.reflect.Method, java.lang.Object[])
+    */
+   @Override
+   protected InvokableContext getContainer(Method method, Object[] args)
+   {
+      return container;
+   }
+
+
    public FamilyWrapper getFamilyWrapper()
    {
       return family;

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionProxyFactoryBase.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionProxyFactoryBase.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionProxyFactoryBase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.impl.factory.session;
 
+import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -157,7 +158,7 @@
     * 
     * @return
     */
-   public Object createProxyDefault()
+   public Object createProxyDefault(final Serializable sessionId)
    {
       // Obtain Constructor to Default Proxy
       Constructor<?> constructor = this.getConstructorProxyDefault();
@@ -165,7 +166,7 @@
             + SessionProxyFactory.class.getSimpleName() + " was not properly started?";
 
       // Create a new InvocationHandler
-      SessionProxyInvocationHandler handler = this.createBusinessDefaultInvocationHandler();
+      SessionProxyInvocationHandler handler = this.createBusinessDefaultInvocationHandler(sessionId);
 
       try
       {
@@ -187,7 +188,7 @@
     * @param businessInterfaceName
     * @return
     */
-   public Object createProxyBusiness(final String businessInterfaceName)
+   public Object createProxyBusiness(final Serializable sessionId, final String businessInterfaceName)
    {
       // Ensure businessInterfaceName is specified
       assert businessInterfaceName != null && businessInterfaceName.trim().length() > 0 : "Required business interface type name was not specified";
@@ -204,8 +205,8 @@
                + "\" was found; not created at start() properly?  Bad value bound as RefAddr in JNDI?";
 
          // Create a new InvocationHandler
-         SessionProxyInvocationHandler handler = this
-               .createBusinessInterfaceSpecificInvocationHandler(businessInterfaceName);
+         SessionProxyInvocationHandler handler = this.createBusinessInterfaceSpecificInvocationHandler(sessionId,
+               businessInterfaceName);
 
          // Create a new Proxy instance
          Object proxy = constructor.newInstance(handler);
@@ -226,10 +227,10 @@
     * 
     * @return
     */
-   public Object createProxyEjb2x()
+   public Object createProxyEjb2x(final Serializable sessionId)
    {
       // Create a new InvocationHandler
-      SessionProxyInvocationHandler handler = this.createEjb2xComponentInterfaceInvocationHandler();
+      SessionProxyInvocationHandler handler = this.createEjb2xComponentInterfaceInvocationHandler(sessionId);
 
       try
       {
@@ -591,7 +592,7 @@
     * @return
     */
    protected abstract SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(
-         String businessInterfaceName);
+         Serializable target, String businessInterfaceName);
 
    /**
     * Returns the Constructor of the SessionProxyInvocationHandler to be used in 
@@ -601,7 +602,7 @@
     * 
     * @return
     */
-   protected abstract SessionProxyInvocationHandler createBusinessDefaultInvocationHandler();
+   protected abstract SessionProxyInvocationHandler createBusinessDefaultInvocationHandler(Serializable target);
 
    /**
     * Returns the Constructor of the SessionProxyInvocationHandler to be used in 
@@ -611,7 +612,7 @@
     * 
     * @return
     */
-   protected abstract SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler();
+   protected abstract SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler(Serializable target);
 
    /**
     * Returns the Constructor of the SessionProxyInvocationHandler to be used in 

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionSpecProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionSpecProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/SessionSpecProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.impl.factory.session;
 
+
 /**
  * SessionSpecProxyFactory
  * 

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceLocalProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceLocalProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceLocalProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -99,8 +99,8 @@
       Interceptor[] interceptors = this.getInterceptors();
 
       // Create
-      SessionLocalProxyInvocationHandler handler = new SessionLocalProxyInvocationHandler(containerName,
-            containerGuid, interceptors, null);
+      SessionLocalProxyInvocationHandler handler = new SessionLocalProxyInvocationHandler(containerName, containerGuid,
+            interceptors, null, null);
 
       // Return
       return handler;

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceRemoteProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceRemoteProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/service/ServiceRemoteProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -121,7 +121,7 @@
 
       // Create
       SessionRemoteProxyInvocationHandler handler = new SessionRemoteProxyInvocationHandler(containerName,
-            containerGuid, interceptors, null, url);
+            containerGuid, interceptors, null, null, url);
 
       // Return
       return handler;

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionLocalProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionLocalProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionLocalProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.impl.factory.session.stateful;
 
+import java.io.Serializable;
 import java.util.Set;
 
 import org.jboss.aop.Advisor;
@@ -115,7 +116,8 @@
    // --------------------------------------------------------------------------------||
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(String businessInterfaceName)
+   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(
+         final Serializable sessionId, String businessInterfaceName)
    {
       // Obtain target container name
       String containerName = this.getContainerName();
@@ -126,28 +128,28 @@
 
       // Create
       SessionProxyInvocationHandler handler = new SessionLocalProxyInvocationHandler(containerName, containerGuid,
-            interceptors, businessInterfaceName);
+            interceptors, businessInterfaceName, sessionId);
 
       // Return
       return handler;
    }
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler()
+   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler(final Serializable sessionId)
    {
-      return this.createBusinessInterfaceSpecificInvocationHandler(null);
+      return this.createBusinessInterfaceSpecificInvocationHandler(sessionId, null);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler()
+   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler(final Serializable sessionId)
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(sessionId);
    }
 
    @Override
    protected SessionProxyInvocationHandler createHomeInvocationHandler()
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(null);
    }
    
    /**

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionProxyFactoryBase.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionProxyFactoryBase.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionProxyFactoryBase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -22,8 +22,6 @@
 package org.jboss.ejb3.proxy.impl.factory.session.stateful;
 
 import java.io.Serializable;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
 import java.util.Set;
 
 import org.jboss.aop.Advisor;
@@ -31,7 +29,6 @@
 import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
 import org.jboss.ejb3.common.registrar.spi.NotBoundException;
 import org.jboss.ejb3.proxy.impl.factory.session.SessionProxyFactoryBase;
-import org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandler;
 import org.jboss.ejb3.proxy.spi.container.StatefulSessionFactory;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
@@ -176,30 +173,6 @@
    }
 
    /**
-    * Create an EJB3 Business proxy with no 
-    * specific target business interface.  The 
-    * returned proxy will implement all appropriate
-    * business interfaces.  Additionally, if
-    * the Home interface is bound alongside 
-    * the Default (same JNDI Name), this 
-    * Proxy will implement the Home interface as well. 
-    * 
-    * @param sessionId
-    * @return
-    */
-   public Object createProxyDefault(Serializable sessionId)
-   {
-      // Obtain Proxy using Super Implementation
-      Object proxy = super.createProxyDefault();
-
-      // Associate with session
-      this.associateProxyWithSession(proxy, sessionId);
-
-      // Return
-      return proxy;
-   }
-
-   /**
     * Create an EJB3 Business Proxy specific to the specified
     * target business interface name (expressed as 
     * a fully-qualified class name)
@@ -211,11 +184,8 @@
    public Object createProxyBusiness(Serializable sessionId, String businessInterfaceName)
    {
       // Obtain Proxy using Super Implementation
-      Object proxy = super.createProxyBusiness(businessInterfaceName);
+      Object proxy = super.createProxyBusiness(sessionId, businessInterfaceName);
 
-      // Associate with session
-      this.associateProxyWithSession(proxy, sessionId);
-
       // Return
       return proxy;
    }
@@ -229,11 +199,8 @@
    public Object createProxyEjb2x(Serializable sessionId)
    {
       // Obtain Proxy using Super Implementation
-      Object proxy = super.createProxyEjb2x();
+      Object proxy = super.createProxyEjb2x(sessionId);
 
-      // Associate with session
-      this.associateProxyWithSession(proxy, sessionId);
-
       // Return
       return proxy;
    }
@@ -241,28 +208,8 @@
    // --------------------------------------------------------------------------------||
    // Internal Helper Methods --------------------------------------------------------||
    // --------------------------------------------------------------------------------||
-   
 
    /**
-    * Associates the specified Proxy with the session denoted by 
-    * the specified sessionId
-    * 
-    * @param proxy
-    * @param sessionId
-    */
-   protected void associateProxyWithSession(Object proxy, Serializable sessionId)
-   {
-      // Obtain the InvocationHandler
-      InvocationHandler handler = Proxy.getInvocationHandler(proxy);
-      assert handler instanceof SessionProxyInvocationHandler : "SFSB Proxy must be of type "
-            + SessionProxyInvocationHandler.class.getName();
-      SessionProxyInvocationHandler sHandler = (SessionProxyInvocationHandler) handler;
-
-      // Set the Session ID on the Proxy
-      sHandler.setTarget(sessionId);
-   }
-
-   /**
     * Creates a new Session on the container and returns the ID
     * representing this newly-created session
     * 

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionRemoteProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionRemoteProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateful/StatefulSessionRemoteProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.impl.factory.session.stateful;
 
+import java.io.Serializable;
 import java.util.Set;
 
 import org.jboss.aop.Advisor;
@@ -132,7 +133,8 @@
    // --------------------------------------------------------------------------------||
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(String businessInterfaceName)
+   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(Serializable target,
+         String businessInterfaceName)
    {
       // Obtain target properties
       String containerName = this.getContainerName();
@@ -144,28 +146,28 @@
 
       // Create
       SessionProxyInvocationHandler handler = new SessionRemoteProxyInvocationHandler(containerName, containerGuid,
-            interceptors, businessInterfaceName, url);
+            interceptors, businessInterfaceName, target, url);
 
       // Return
       return handler;
    }
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler()
+   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler(final Serializable target)
    {
-      return this.createBusinessInterfaceSpecificInvocationHandler(null);
+      return this.createBusinessInterfaceSpecificInvocationHandler(target,null);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler()
+   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler(final Serializable target)
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(target);
    }
 
    @Override
    protected SessionProxyInvocationHandler createHomeInvocationHandler()
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(null);
    }
    
    /**

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionLocalProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionLocalProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionLocalProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.impl.factory.session.stateless;
 
+import java.io.Serializable;
 import java.util.Set;
 
 import org.jboss.aop.Advisor;
@@ -48,7 +49,7 @@
    // --------------------------------------------------------------------------------||
 
    private static final Logger logger = Logger.getLogger(StatelessSessionLocalProxyFactory.class);
-   
+
    /**
     * Default interceptor stack name
     */
@@ -118,7 +119,8 @@
    // --------------------------------------------------------------------------------||
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(String businessInterfaceName)
+   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(final Serializable target,
+         final String businessInterfaceName)
    {
       // Obtain container name
       String containerName = this.getContainerName();
@@ -129,30 +131,30 @@
 
       // Create
       SessionProxyInvocationHandler handler = new SessionLocalProxyInvocationHandler(containerName, containerGuid,
-            interceptors, businessInterfaceName);
+            interceptors, businessInterfaceName, target);
 
       // Return
       return handler;
    }
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler()
+   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler(final Serializable target)
    {
-      return this.createBusinessInterfaceSpecificInvocationHandler(null);
+      return this.createBusinessInterfaceSpecificInvocationHandler(null, null);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler()
+   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler(final Serializable target)
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(target);
    }
 
    @Override
    protected SessionProxyInvocationHandler createHomeInvocationHandler()
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(null);
    }
-   
+
    /**
     * {@inheritDoc}
     * @see org.jboss.ejb3.proxy.impl.factory.ProxyFactoryBase#getDefaultInterceptorStackName()
@@ -162,4 +164,26 @@
    {
       return DEFAULT_STACK_NAME_LOCAL_CLIENT_INTERCEPTORS;
    }
+
+   @Override
+   public Object createProxyBusiness(String businessInterfaceName)
+   {
+      return this.createProxyBusiness(null, businessInterfaceName);
+   }
+
+   @Override
+   public Object createProxyEjb2x()
+   {
+      return this.createProxyEjb2x(null);
+   }
+
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.factory.session.SessionProxyFactory#createProxyDefault()
+    */
+   @Override
+   public Object createProxyDefault()
+   {
+      return super.createProxyDefault(null);
+   }
 }

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionRemoteProxyFactory.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionRemoteProxyFactory.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/factory/session/stateless/StatelessSessionRemoteProxyFactory.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.proxy.impl.factory.session.stateless;
 
+import java.io.Serializable;
 import java.util.Set;
 
 import org.jboss.aop.Advisor;
@@ -134,7 +135,8 @@
    // --------------------------------------------------------------------------------||
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(String businessInterfaceName)
+   protected SessionProxyInvocationHandler createBusinessInterfaceSpecificInvocationHandler(Serializable target,
+         String businessInterfaceName)
    {
       // Obtain properties
       String containerName = this.getContainerName();
@@ -146,28 +148,28 @@
 
       // Create
       SessionProxyInvocationHandler handler = new SessionRemoteProxyInvocationHandler(containerName, containerGuid,
-            interceptors, businessInterfaceName, url);
+            interceptors, businessInterfaceName, target, url);
 
       // Return
       return handler;
    }
 
    @Override
-   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler()
+   protected SessionProxyInvocationHandler createBusinessDefaultInvocationHandler(final Serializable target)
    {
-      return this.createBusinessInterfaceSpecificInvocationHandler(null);
+      return this.createBusinessInterfaceSpecificInvocationHandler(target, null);
    }
 
    @Override
-   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler()
+   protected SessionProxyInvocationHandler createEjb2xComponentInterfaceInvocationHandler(final Serializable target)
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(target);
    }
 
    @Override
    protected SessionProxyInvocationHandler createHomeInvocationHandler()
    {
-      return this.createBusinessDefaultInvocationHandler();
+      return this.createBusinessDefaultInvocationHandler(null);
    }
    
    /**
@@ -180,6 +182,36 @@
       return DEFAULT_STACK_NAME_STATELESS_SESSION_CLIENT_INTERCEPTORS;
    }
 
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.factory.session.SessionSpecProxyFactory#createProxyBusiness(java.lang.String)
+    */
+   @Override
+   public Object createProxyBusiness(String businessInterfaceName)
+   {
+      return this.createProxyBusiness(null, businessInterfaceName);
+   }
+
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.factory.session.SessionSpecProxyFactory#createProxyEjb2x()
+    */
+   @Override
+   public Object createProxyEjb2x()
+   {
+      return this.createProxyEjb2x(null);
+   }
+   
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.factory.session.SessionProxyFactory#createProxyDefault()
+    */
+   @Override
+   public Object createProxyDefault()
+   {
+      return super.createProxyDefault(null);
+   }
+   
    // --------------------------------------------------------------------------------||
    // Accessors / Mutators -----------------------------------------------------------||
    // --------------------------------------------------------------------------------||

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionLocalProxyInvocationHandler.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionLocalProxyInvocationHandler.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionLocalProxyInvocationHandler.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -22,9 +22,18 @@
 package org.jboss.ejb3.proxy.impl.handler.session;
 
 import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
 
+import org.jboss.aop.Advisor;
 import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.util.MethodHashing;
+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.proxy.impl.invocation.StatefulRemoteInvocation;
 import org.jboss.ejb3.proxy.spi.container.InvokableContext;
 
 /**
@@ -70,22 +79,126 @@
     * @param interceptors The interceptors to apply to invocations upon this handler
     */
    public SessionLocalProxyInvocationHandler(final String containerName, final String containerGuid,
-         final Interceptor[] interceptors, final String businessInterfaceType)
+         final Interceptor[] interceptors, final String businessInterfaceType, final Serializable sessionId)
    {
-      super(containerName, containerGuid, interceptors, businessInterfaceType, null);
+      super(containerName, containerGuid, interceptors, businessInterfaceType, sessionId);
    }
 
    // --------------------------------------------------------------------------------||
    // Required Implementations -------------------------------------------------------||
    // --------------------------------------------------------------------------------||
-
-   /* (non-Javadoc)
-    * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
+   
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase#getContainer(java.lang.reflect.Method, java.lang.Object[])
     */
    @Override
    protected InvokableContext getContainer(final Method method, final Object[] args)
    {
-      return this.getContainerLocally(method,args);
+      // 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;
+
+      final InvokableContext container = (InvokableContext) obj;
+
+      final InvokableContext proxyToContainer = (InvokableContext) Proxy.newProxyInstance(InvokableContext.class
+            .getClassLoader(), new Class<?>[]
+      {InvokableContext.class}, new LocalInvokableContextHandler(method, args, this.getTarget(), this.getInterceptors(),
+            container));
+
+      // Return
+      return proxyToContainer;
    }
+   
+   // --------------------------------------------------------------------------------||
+   // Internal Helper Members --------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+   
+   /**
+    * Invocation handler to adapt interceptors to local invocations
+    * upon the container
+    * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+    */
+   private static final class LocalInvokableContextHandler implements InvocationHandler
+   {
 
+      private final Method realMethod;
+
+      private final Object[] realArgs;
+
+      private final Object session;
+
+      private final Interceptor[] interceptors;
+      final InvokableContext container;
+
+      LocalInvokableContextHandler(final Method realMethod, final Object[] realArgs, final Object session,
+            final Interceptor[] interceptors,final InvokableContext container)
+      {
+         assert realMethod != null : "method must be specified";
+         assert realArgs != null : "realArgs must be specified";
+         assert interceptors != null : "interceptors must be specified";
+         assert container != null : "container must be specified";
+         this.realMethod = realMethod;
+         this.realArgs = realArgs;
+         this.session = session;
+         this.interceptors = interceptors;
+         this.container = container;
+         
+      }
+
+      public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable
+      {
+         final long hash = MethodHashing.calculateHash(realMethod);
+         final LocalContainerInvocation invocation = new LocalContainerInvocation(interceptors, hash, realMethod,
+               realMethod, null, session);
+         invocation.setTargetObject(container);
+         invocation.setArguments(args);
+         return invocation.invokeNext();
+      }
+   }
+   
+   /**
+    * Adaptor invocation implementation to intercept based on real methods, 
+    * yet invoke the target {@link InvokableContext} at the end 
+    * of the interceptor chain
+    * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+    */
+   private static class LocalContainerInvocation extends StatefulRemoteInvocation{
+
+      public LocalContainerInvocation(Interceptor[] interceptors, long methodHash, Method advisedMethod,
+            Method unadvisedMethod, Advisor advisor, Object id)
+      {
+         super(interceptors, methodHash, advisedMethod, unadvisedMethod, advisor, id);
+      }
+
+      @Override
+      public Object invokeTarget() throws Throwable
+      {
+         try
+         {
+            final Method methodToInvoke =InvokableContext.class.getMethod("invoke", Object.class,
+                  SerializableMethod.class, Object[].class);
+            return methodToInvoke.invoke(getTargetObject(), arguments);
+         }
+         catch (Throwable t)
+         {
+            throw handleErrors(getTargetObject(), getMethod(), arguments, t);
+         }
+      }
+      
+      @Override
+      public Invocation copy()
+      {
+         final LocalContainerInvocation copy = new LocalContainerInvocation(this.interceptors, this.methodHash, this.advisedMethod,
+               this.unadvisedMethod, this.advisor, this.id);
+         copy.setMetaData(this.getMetaData());
+         copy.setArguments(this.getArguments());
+         copy.setTargetObject(targetObject);
+         return copy;
+      }
+   }
+
 }

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionProxyInvocationHandlerBase.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionProxyInvocationHandlerBase.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionProxyInvocationHandlerBase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -28,16 +28,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.jboss.aop.Advisor;
 import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.InvocationResponse;
-import org.jboss.aop.util.MethodHashing;
 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.proxy.impl.invocation.StatefulRemoteInvocation;
-import org.jboss.ejb3.proxy.impl.remoting.ProxyRemotingUtils;
 import org.jboss.ejb3.proxy.spi.container.InvokableContext;
 import org.jboss.logging.Logger;
 
@@ -405,136 +397,6 @@
       return hash;
    }
 
-   /**
-    * Returns the container housed locally
-    * 
-    * @return
-    */
-   protected InvokableContext getContainerLocally(final Method method, final Object[] args)
-   {
-      // 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;
-
-      final InvokableContext container = (InvokableContext) obj;
-
-      final InvokableContext proxyToContainer = (InvokableContext) Proxy.newProxyInstance(InvokableContext.class
-            .getClassLoader(), new Class<?>[]
-      {InvokableContext.class}, new LocalInvokableContextHandler(method, args, this.target, this.interceptors,
-            container));
-
-      // Return
-      return proxyToContainer;
-   }
-   
-   /**
-    * Invocation handler to adapt interceptors to local invocations
-    * upon the container
-    * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
-    */
-   private static final class LocalInvokableContextHandler implements InvocationHandler
-   {
-
-      private final Method realMethod;
-
-      private final Object[] realArgs;
-
-      private final Object session;
-
-      private final Interceptor[] interceptors;
-      final InvokableContext container;
-
-      LocalInvokableContextHandler(final Method realMethod, final Object[] realArgs, final Object session,
-            final Interceptor[] interceptors,final InvokableContext container)
-      {
-         assert realMethod != null : "method must be specified";
-         assert realArgs != null : "realArgs must be specified";
-         assert interceptors != null : "interceptors must be specified";
-         assert container != null : "container must be specified";
-         this.realMethod = realMethod;
-         this.realArgs = realArgs;
-         this.session = session;
-         this.interceptors = interceptors;
-         this.container = container;
-         
-      }
-
-      public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable
-      {
-         final long hash = MethodHashing.calculateHash(realMethod);
-         final LocalContainerInvocation invocation = new LocalContainerInvocation(interceptors, hash, realMethod,
-               realMethod, null, session);
-         invocation.setTargetObject(container);
-         invocation.setArguments(args);
-         return invocation.invokeNext();
-      }
-
-   }
-   
-   /**
-    * Adaptor invocation implementation to intercept based on real methods, 
-    * yet invoke the target {@link InvokableContext} at the end 
-    * of the interceptor chain
-    * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
-    */
-   private static class LocalContainerInvocation extends StatefulRemoteInvocation{
-
-      public LocalContainerInvocation(Interceptor[] interceptors, long methodHash, Method advisedMethod,
-            Method unadvisedMethod, Advisor advisor, Object id)
-      {
-         super(interceptors, methodHash, advisedMethod, unadvisedMethod, advisor, id);
-      }
-
-      @Override
-      public Object invokeTarget() throws Throwable
-      {
-         try
-         {
-            final Method methodToInvoke =InvokableContext.class.getMethod("invoke", Object.class,
-                  SerializableMethod.class, Object[].class);
-            return methodToInvoke.invoke(getTargetObject(), arguments);
-         }
-         catch (Throwable t)
-         {
-            throw handleErrors(getTargetObject(), getMethod(), arguments, t);
-         }
-      }
-      
-      @Override
-      public Invocation copy()
-      {
-         final LocalContainerInvocation copy = new LocalContainerInvocation(this.interceptors, this.methodHash, this.advisedMethod,
-               this.unadvisedMethod, this.advisor, this.id);
-         copy.setMetaData(this.getMetaData());
-         copy.setArguments(this.getArguments());
-         copy.setTargetObject(targetObject);
-         return copy;
-      }
-
-
-      
-   }
-
-   /**
-    * Creates and returns a Remoting Proxy to invoke upon the container
-    * 
-    * This implementation is marked as FIXME as remoting should be an add-on
-    * capability atop ejb3-proxy
-    * 
-    * @param url The location of the remote host holding the Container
-    * @return
-    */
-   //FIXME
-   protected InvokableContext createRemoteProxyToContainer(String url)
-   {
-      InvokableContext container = ProxyRemotingUtils.createRemoteProxyToContainer(this.getContainerName(),
-            this.getContainerGuid(), url, this.getInterceptors(), this.getTarget());
-      return container;
-   }
-
    // ------------------------------------------------------------------------------||
    // Contracts --------------------------------------------------------------------||
    // ------------------------------------------------------------------------------||

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionRemoteProxyInvocationHandler.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionRemoteProxyInvocationHandler.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/main/java/org/jboss/ejb3/proxy/impl/handler/session/SessionRemoteProxyInvocationHandler.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -25,6 +25,7 @@
 import java.lang.reflect.Method;
 
 import org.jboss.aop.advice.Interceptor;
+import org.jboss.ejb3.proxy.impl.remoting.ProxyRemotingUtils;
 import org.jboss.ejb3.proxy.spi.container.InvokableContext;
 
 /**
@@ -48,11 +49,32 @@
 
    private String url;
 
+   /**
+    * Remote hook to the container
+    */
+   private final InvokableContext container;
+
    // --------------------------------------------------------------------------------||
    // Constructor --------------------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
    /**
+    * For use by singleton-proxy.
+    *
+    * @param containerName
+    * @param containerGuid
+    * @param interceptors
+    * @param businessInterfaceType
+    * @param url
+    */
+   @Deprecated
+   public SessionRemoteProxyInvocationHandler(final String containerName, final String containerGuid,
+         final Interceptor[] interceptors, final String businessInterfaceType, final String url)
+   {
+      this(containerName, containerGuid, interceptors, businessInterfaceType, null, url);
+   }
+
+   /**
     * Constructor
     * 
     * @param containerName The name of the target container
@@ -64,25 +86,28 @@
     * @param interceptors The interceptors to apply to invocations upon this handler
     */
    public SessionRemoteProxyInvocationHandler(final String containerName, final String containerGuid,
-         final Interceptor[] interceptors, final String businessInterfaceType, final String url)
+         final Interceptor[] interceptors, final String businessInterfaceType, final Object target, final String url)
    {
-      super(containerName, containerGuid, interceptors, businessInterfaceType, null);
+      super(containerName, containerGuid, interceptors, businessInterfaceType, target);
 
       // Set properties
       this.setUrl(url);
+      this.container = ProxyRemotingUtils.createRemoteProxyToContainer(this.getContainerName(),
+            this.getContainerGuid(), url, this.getInterceptors(), target);
    }
 
    // --------------------------------------------------------------------------------||
    // Required Implementations -------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
-   /* (non-Javadoc)
-    * @see org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandlerBase#getContainer()
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase#getContainer(java.lang.reflect.Method, java.lang.Object[])
     */
    @Override
    protected InvokableContext getContainer(final Method method, final Object[] args)
    {
-      return this.createRemoteProxyToContainer(this.getUrl());
+      return container;
    }
 
    // --------------------------------------------------------------------------------||

Modified: projects/ejb3/branches/infinispan-int/proxy-impl/src/test/java/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/test/java/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java	2010-08-30 20:07:13 UTC (rev 107898)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/test/java/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase.java	2010-08-30 21:27:51 UTC (rev 107899)
@@ -87,20 +87,30 @@
    @Test
    public void testDifferentSlsbRemoteProxiesEqual() throws Throwable
    {
-      // Make a Remote Proxy Factory
-      StatelessSessionRemoteProxyFactory factory = this.createSessionRemoteProxyFactory();
-      factory.start();
+      // Bind the Connector
+      getBootstrap().deploy(SlsbProxyEqualityTestCase.class);
+      try
+      {
+         // Make a Remote Proxy Factory
+         StatelessSessionRemoteProxyFactory factory = this.createSessionRemoteProxyFactory();
+         factory.start();
 
-      // Create 2 Proxies
-      Object proxy1 = factory.createProxyDefault();
-      Object proxy2 = factory.createProxyDefault();
+         // Create 2 Proxies
+         Object proxy1 = factory.createProxyDefault();
+         Object proxy2 = factory.createProxyDefault();
 
-      // Ensure they're equal to one another
-      TestCase
-            .assertTrue(
-                  "EJB 3.0 Core Specification 3.4.5.2 Violation: Different remote proxies to same SLSB should be equal by value",
-                  proxy1.equals(proxy2));
-      TestCase.assertTrue("Hash Codes for equal Proxies should be equal", proxy1.hashCode() == proxy2.hashCode());
+         // Ensure they're equal to one another
+         TestCase
+               .assertTrue(
+                     "EJB 3.0 Core Specification 3.4.5.2 Violation: Different remote proxies to same SLSB should be equal by value",
+                     proxy1.equals(proxy2));
+         TestCase.assertTrue("Hash Codes for equal Proxies should be equal", proxy1.hashCode() == proxy2.hashCode());
+      }
+      finally
+      {
+         // Bind the Connector
+         getBootstrap().undeploy(SlsbProxyEqualityTestCase.class);
+      }
    }
 
    // --------------------------------------------------------------------------------||
@@ -175,8 +185,8 @@
 
       // Create the Factory
       StatelessSessionRemoteProxyFactory factory = new StatelessSessionRemoteProxyFactory(
-            StatelessSessionRemoteProxyFactory.class.getName(), container.getName(), container.getName(), container
-                  .getMetaData(), container.getClassLoader(), null, ProxyEqualityTestCaseBase.advisor, null);
+            StatelessSessionRemoteProxyFactory.class.getName(), container.getName(), container.getName(),
+            container.getMetaData(), container.getClassLoader(), null, ProxyEqualityTestCaseBase.advisor, null);
 
       // Start
       factory.start();

Copied: projects/ejb3/branches/infinispan-int/proxy-impl/src/test/resources/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase-jboss-beans.xml (from rev 107885, projects/ejb3/trunk/proxy-impl/src/test/resources/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase-jboss-beans.xml)
===================================================================
--- projects/ejb3/branches/infinispan-int/proxy-impl/src/test/resources/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase-jboss-beans.xml	                        (rev 0)
+++ projects/ejb3/branches/infinispan-int/proxy-impl/src/test/resources/org/jboss/ejb3/test/proxy/impl/spec_3_4_5/unit/SlsbProxyEqualityTestCase-jboss-beans.xml	2010-08-30 21:27:51 UTC (rev 107899)
@@ -0,0 +1,35 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+  xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- 
+    
+    Remoting
+    
+  -->
+
+  <!-- Remoting  Configuration -->
+  <bean name="ServerConfiguration"
+    class="org.jboss.remoting.ServerConfiguration">
+    <property name="invocationHandlers">
+      <map keyClass="java.lang.String" valueClass="java.lang.String">
+        <entry>
+          <key>AOP</key>
+          <value>
+            org.jboss.aspects.remoting.AOPRemotingInvocationHandler
+          </value>
+        </entry>
+      </map>
+    </property>
+  </bean>
+
+  <!-- Remoting Connector -->
+  <bean name="org.jboss.ejb3.RemotingConnector"
+    class="org.jboss.remoting.transport.Connector">
+    <property name="invokerLocator">socket://0.0.0.0:3874</property>
+    <property name="serverConfiguration">
+      <inject bean="ServerConfiguration" />
+    </property>
+  </bean>
+
+</deployment>
\ No newline at end of file



More information about the jboss-cvs-commits mailing list