[jboss-cvs] JBossAS SVN: r72292 - in projects/ejb3/dev/ejbthree1269: cache and 59 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 16 11:51:57 EDT 2008


Author: ALRubinger
Date: 2008-04-16 11:51:56 -0400 (Wed, 16 Apr 2008)
New Revision: 72292

Added:
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/ManagedObjectAdvisorInstanceInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/util/ThreadLocalStack.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunnerWrapper.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSetup.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/InterceptorOrderBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/AbstractInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/Interceptions.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml
Removed:
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/metadata/JBossMessageDrivenBeanGenericWrapper.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorsInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml
Modified:
   projects/ejb3/dev/ejbthree1269/build/pom.xml
   projects/ejb3/dev/ejbthree1269/cache/.classpath
   projects/ejb3/dev/ejbthree1269/cache/.project
   projects/ejb3/dev/ejbthree1269/core/.project
   projects/ejb3/dev/ejbthree1269/core/.settings/org.eclipse.jdt.core.prefs
   projects/ejb3/dev/ejbthree1269/core/build-test.xml
   projects/ejb3/dev/ejbthree1269/core/pom.xml
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/BaseContext.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/DeploymentUnit.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBContainer.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/KernelAbstraction.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/MCKernelAbstraction.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/aop/BeanContainer.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/mdb/MessagingContainer.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/BaseStatefulRemoteProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/BaseStatelessRemoteProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java
   projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/injection/EJBRemoteHandler.java
   projects/ejb3/dev/ejbthree1269/core/src/main/resources/ejb3-interceptors-aop.xml
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/cachepassivation/MockDeploymentUnit.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session21Bean.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/MultiDeployTestCase.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java
   projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/threadlocal/MockBeanContext.java
   projects/ejb3/dev/ejbthree1269/ext-api-impl/.classpath
   projects/ejb3/dev/ejbthree1269/ext-api-impl/.project
   projects/ejb3/dev/ejbthree1269/ext-api/.classpath
   projects/ejb3/dev/ejbthree1269/ext-api/.project
   projects/ejb3/dev/ejbthree1269/injection/.classpath
   projects/ejb3/dev/ejbthree1269/injection/.project
   projects/ejb3/dev/ejbthree1269/installer/.classpath
   projects/ejb3/dev/ejbthree1269/installer/.project
   projects/ejb3/dev/ejbthree1269/interceptors/pom.xml
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InjectInterceptorsFactory.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/LifecycleCallbacks.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/AbstractContainer.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/BeanContext.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/DummyBeanContext.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/ManagedObjectAdvisor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/registry/InterceptorRegistry.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/additive/unit/AdditiveTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunner.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSuite.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/direct/unit/DirectTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1215/unit/ContextGetMethodTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/instances/unit/InterceptorInstancesTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/lifecycle/unit/CallbackMethodDescriptorTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/unit/MetadataTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorA.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorB.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorChainBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/unit/InterceptorChainTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxy/unit/ProxyTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/MyInterface.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerInstanceInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerJoinpointInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedBean.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimpleContext.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimplePoolInterceptor.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/unit/ProxyInstanceAdvisorTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/signature/unit/SignatureTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/supermethod/unit/SuperMethodTestCase.java
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/metadata/META-INF/ejb-jar.xml
   projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/proxyinstanceadvisor/jboss-aop.xml
   projects/ejb3/dev/ejbthree1269/locator/.classpath
   projects/ejb3/dev/ejbthree1269/locator/.project
   projects/ejb3/dev/ejbthree1269/metadata/.classpath
   projects/ejb3/dev/ejbthree1269/metadata/.project
   projects/ejb3/dev/ejbthree1269/pool/.classpath
   projects/ejb3/dev/ejbthree1269/pool/.project
Log:
[EJBTHREE-1269] Bring this branch current to trunk:72291

Modified: projects/ejb3/dev/ejbthree1269/build/pom.xml
===================================================================
--- projects/ejb3/dev/ejbthree1269/build/pom.xml	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/build/pom.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -118,7 +118,7 @@
           <showWarnings>true</showWarnings>
           <optimize>true</optimize>
           <compilerVersion>1.5</compilerVersion>
-          <fork>false</fork>
+          <fork>true</fork>
         </configuration>
       </plugin>
 
@@ -257,7 +257,7 @@
       <dependency>
         <groupId>org.jboss.metadata</groupId>
         <artifactId>jboss-metadata</artifactId>
-        <version>1.0.0.Beta7</version>
+        <version>1.0.0-SNAPSHOT</version>
       </dependency>
       
       <dependency>
@@ -286,6 +286,14 @@
         <artifactId>jboss-aop-aspects</artifactId>
         <version>${version.org.jboss.aop_jboss-aop-aspects}</version>
       </dependency>
+
+      <!-- Aspects Commons -->
+      <dependency>
+        <groupId>org.jboss.aspects</groupId>
+        <artifactId>jboss-aspects-common</artifactId>
+        <version>0.1-SNAPSHOT</version>
+        <scope>test</scope>
+      </dependency>
       
       <dependency>
         <groupId>org.jboss.javaee</groupId>

Modified: projects/ejb3/dev/ejbthree1269/cache/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/cache/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/cache/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,23 +1,17 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
-  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/apache-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-core/2.0.2.GA/jboss-common-core-2.0.2.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.4.GA/jboss-common-core-2.2.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-log4j/2.0.2.GA/jboss-logging-log4j-2.0.2.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.2.GA/jboss-logging-spi-2.0.2.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-serialization/1.0.3.GA/jboss-serialization-1.0.3.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.8/log4j-1.2.8.jar"/>
-  <classpathentry kind="var" path="M2_REPO/trove/trove/1.0.2/trove-1.0.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-slide/webdavlib/2.0/webdavlib-2.0.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jboss-serialization/1.0.3.GA/jboss-serialization-1.0.3.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/trove/trove/1.0.2/trove-1.0.2.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/cache/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/cache/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/cache/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<projectDescription>
-  <name>jboss-ejb3-cache</name>
-  <comment>The Java EJB 3.0 Cache classes</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-cache</name>
+  <comment>The Java EJB 3.0 Cache classes</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/core/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,16 @@
-<projectDescription>
-  <name>jboss-ejb3-core</name>
-  <comment>JBoss EJB 3.0 Core</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-core</name>
+  <comment>JBoss EJB 3.0 Core</comment>
+  <projects>
+    <project>jboss-ejb3-cache</project>
+    <project>jboss-ejb3-interceptors</project>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/.settings/org.eclipse.jdt.core.prefs	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/.settings/org.eclipse.jdt.core.prefs	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,4 +1,4 @@
-#Fri Apr 11 09:55:41 CEST 2008
+#Sun Apr 13 18:16:13 CEST 2008
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.source=1.5

Modified: projects/ejb3/dev/ejbthree1269/core/build-test.xml
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/build-test.xml	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/build-test.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -2262,7 +2262,7 @@
 
       <build-simple-jar name="ejbthree989"/>
    </target>
-
+  
    <target name="ejbthree1020"
       description="Builds a simple jar file."
       >
@@ -2401,6 +2401,10 @@
    <target name="ejbthree1222" >
       <build-simple-jar name="ejbthree1222"/>
    </target>
+  
+   <target name="ejbthree1271">
+      <build-simple-jar name="ejbthree1271"/>
+   </target>
 
    <target name="jbas4489"
       description="Builds a simple jar files."
@@ -4174,7 +4178,7 @@
       ejbthree1062,
       ejbthree1066, ejbthree1071, ejbthree1075, ejbthree1082, ejbthree1090, ejbthree1092, ejbthree1119, ejbthree1122, ejbthree1123, ejbthree1127,
       ejbthree1130, 
-      ejbthree1146, ejbthree1148, ejbthree1154, ejbthree1155, ejbthree1157, ejbthree1222, jaxws, jbas4489,
+      ejbthree1146, ejbthree1148, ejbthree1154, ejbthree1155, ejbthree1157, ejbthree1222, ejbthree1271, jaxws, jbas4489,
 	  epcpropagation,
       aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
       securitydomain, enventry, security5,
@@ -5222,6 +5226,9 @@
          <param name="test" value="ejbthree1222"/>
       </antcall>
       <antcall target="test" inheritRefs="true">
+        <param name="test" value="ejbthree1271"/>
+      </antcall>
+      <antcall target="test" inheritRefs="true">
          <param name="test" value="statelesscreation"/>
       </antcall>
       <antcall target="test" inheritRefs="true">

Modified: projects/ejb3/dev/ejbthree1269/core/pom.xml
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/pom.xml	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/pom.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -10,7 +10,7 @@
   <parent>
     <groupId>org.jboss.ejb3</groupId>
     <artifactId>jboss-ejb3-build</artifactId>
-    <version>0.13.1-SNAPSHOT</version>
+    <version>0.13.3-SNAPSHOT</version>
     <relativePath>../build/pom.xml</relativePath>
   </parent>
 
@@ -276,14 +276,8 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
-    <!--
     <dependency>
       <groupId>org.hibernate</groupId>
-      <artifactId>ejb3-persistence</artifactId>
-    </dependency>
-    -->
-    <dependency>
-      <groupId>org.hibernate</groupId>
       <artifactId>hibernate</artifactId>
       <version>3.2.6.ga</version>
     </dependency>
@@ -336,7 +330,7 @@
     <dependency>
       <groupId>org.jboss.cluster</groupId>
       <artifactId>jboss-ha-client</artifactId>
-      <version>1.0.0.GA</version>
+      <version>1.1.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.jboss.cluster</groupId>
@@ -407,22 +401,6 @@
       <version>${version.org.jboss.jboss-as}</version>
     </dependency>
     <dependency>
-      <groupId>org.jboss.jbossas</groupId>
-      <artifactId>jboss-as-iiop</artifactId>
-      <version>${version.org.jboss.jboss-as}</version>
-    </dependency>
-    <dependency>
-       <groupId>org.jboss.jbossas</groupId>
-       <artifactId>jboss-as-server</artifactId>
-       <version>5.0.0-SNAPSHOT</version> <!-- Only used here -->
-    </dependency>
-    <dependency>
-       <groupId>org.jboss.jbossas</groupId>
-       <artifactId>jboss-as-server</artifactId>
-       <version>5.0.0-SNAPSHOT</version> <!-- Only used here -->
-       <classifier>client</classifier>
-    </dependency>
-    <dependency>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-container</artifactId>
     </dependency>

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/BaseContext.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/BaseContext.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/BaseContext.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,9 +21,9 @@
  */ 
 package org.jboss.ejb3;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.jboss.aop.metadata.SimpleMetaData;
 import org.jboss.ejb3.interceptor.InterceptorInfo;
@@ -44,8 +44,7 @@
    protected RealmMapping rm;
    protected SimpleMetaData metadata;
    
-   protected HashMap<Class<?>, Object> interceptorInstances;
-   private Object interceptors[];
+   protected Map<Class<?>, Object> interceptorInstances = new HashMap<Class<?>, Object>();
    
    /**
     * Use with extreme caution, must not break getInstance post condition.
@@ -98,12 +97,10 @@
       {
          EJBContainer c = (EJBContainer) container;
          List<Class<?>> interceptorClasses = c.getBeanContainer().getInterceptorClasses();
-         List<Object> interceptors = new ArrayList<Object>();
          for(Class<?> interceptorClass : interceptorClasses)
          {
-            interceptors.add(c.createInterceptor(interceptorClass));
+            interceptorInstances.put(interceptorClass, c.createInterceptor(interceptorClass));
          }
-         this.interceptors = interceptors.toArray(new Object[0]);
       }
       catch(IllegalAccessException e)
       {
@@ -132,8 +129,11 @@
       return container;
    }
    
-   public Object[] getInterceptors()
+   public Object getInterceptor(Class<?> interceptorClass) throws IllegalArgumentException
    {
-      return interceptors;
+      Object interceptor = interceptorInstances.get(interceptorClass);
+      if(interceptor == null)
+         throw new IllegalArgumentException("No interceptor found for " + interceptorClass + " in " + this);
+      return interceptor;
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/DeploymentUnit.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/DeploymentUnit.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/DeploymentUnit.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -38,12 +38,54 @@
  */
 public interface DeploymentUnit
 {
+   /**
+    * Add attachment
+    *
+    * @param name the name of the attachment
+    * @param attachment the attachment
+    * @return any previous attachment
+    * @throws IllegalArgumentException for a null name or attachment
+    * @throws UnsupportedOperationException when not supported by the implementation
+    */
+   Object addAttachment(String name, Object attachment);
+   /**
+    * Get attachment
+    * 
+    * @param name the name of the attachment
+    * @return the attachment or null if not present
+    * @throws IllegalArgumentException for a null name
+    */
+   Object getAttachment(String name);
+   /**
+    * Remove attachment
+    * 
+    * @param name the name of the attachment
+    * @return the attachment or null if not present
+    * @throws IllegalArgumentException for a null name
+    * @throws UnsupportedOperationException when not supported by the implementation
+    */
+   Object removeAttachment(String name);
+
    ClassLoader getClassLoader();
 
    ClassLoader getResourceLoader();
 
+   /**
+    * Get the file name of the deployment root (x.ejb).
+    * 
+    * @return the file name of the deployment root
+    */
    String getShortName();
 
+   /**
+    * Get the relative path of this deployment in the complete
+    * deployment structure. The root deployment relative path will
+    * have "". An ejb jar(x.jar) in an ear (z.ear) would have a
+    * relative path of "x.jar".
+    * @return
+    */
+   String getRelativePath();
+
    List<VirtualFile> getResources(VirtualFileFilter filter);
 
    URL getUrl();

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBContainer.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBContainer.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBContainer.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -83,7 +83,6 @@
 import org.jboss.ejb3.security.SecurityDomainManager;
 import org.jboss.ejb3.statistics.InvocationStatistics;
 import org.jboss.ejb3.tx.UserTransactionImpl;
-import org.jboss.iiop.CorbaORBService;
 import org.jboss.injection.DependsHandler;
 import org.jboss.injection.EJBHandler;
 import org.jboss.injection.EncInjector;
@@ -272,7 +271,7 @@
    {
       try
       {
-         Util.rebind(getEnc(), "ORB", new LinkRef("java:/" + CorbaORBService.ORB_NAME));
+         Util.rebind(getEnc(), "ORB", new LinkRef("java:/JBossCorbaORB"));
       }
       catch(NamingException e)
       {

Deleted: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/EJBProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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;
-
-import java.util.Collection;
-
-import javax.ejb.EJBMetaData;
-
-import org.jboss.invocation.Invocation;
-import org.jboss.metadata.InvokerProxyBindingMetaData;
-
-import org.jboss.ejb.GenericEntityObjectFactory;
-
-/**
- * This is an interface for Container plugins. Implementations of this
- * interface are responsible for receiving remote invocations of EJB's
- * and to forward these requests to the Container it is being used with.
- *
- * <p>It is responsible for providing any EJBObject and EJBHome 
- *    implementations (which may be statically or dynamically created). 
- *
- * <p>Before forwarding a call to the container it must call
- *    Thread.setContextClassLoader() with the classloader of the container.
- *    It must also handle any propagated transaction and security contexts
- *    properly. It may acquire the TransactionManager from JNDI.
- *
- * @see Container
- * 
- * @author <a href="mailto:rickard.oberg at telkel.com">Rickard �berg</a>
- * @author <a href="mailto:marc.fleury at telkel.com">Marc Fleury</a>
- * @version $Revision$
- *
- *<p><b>20011219 marc fleury:</b>
-* <ul>
-*  <li>Moved from typed return to Object to allow for optimizations in creation
-*  <li>Per Dain Sundstrom requests removed the Remote Exception.
-*  <li>The Container Invoker is going to be replaced by the ProxyFactory 
-*</ul>
- */
-public interface EJBProxyFactory
-extends GenericEntityObjectFactory, ContainerPlugin
-{
-   /**
-    * Set the invoker meta data so that the ProxyFactory can initialize properly
-    */
-   void setInvokerMetaData(InvokerProxyBindingMetaData imd);
-   /**
-    * Set the invoker jndi binding
-    */
-   void setInvokerBinding(String binding);
-   /**
-    * Protocol specific isIdentical implementation
-    *
-    * @param container the container
-    * @param mi the invocation 
-    * @return true when identical, false otherwise
-    */
-   boolean isIdentical(Container container, Invocation mi);
-   /**
-    * This method is called whenever the metadata for this container is
-    * needed.
-    *
-    * @return    An implementation of the EJBMetaData interface.
-    */
-   EJBMetaData getEJBMetaData();
-
-   /**
-    * This method is called whenever the EJBHome implementation for this
-    * container is needed.
-    *
-    * @return    An implementation of the home interface for this container.
-    */
-   Object getEJBHome();
-
-   /**
-    * This method is called whenever an EJBObject implementation for a
-    * stateless session bean is needed.
-    *
-    * @return    An implementation of the remote interface for this container.
-    */
-   Object getStatelessSessionEJBObject();
-
-   /**
-    * This method is called whenever an EJBObject implementation for a stateful
-    * session bean is needed.
-    *
-    * @param id    The id of the session.
-    * @return      An implementation of the remote interface for this
-    *              container.
-    */
-   Object getStatefulSessionEJBObject(Object id);
-
-   /**
-    * This method is called whenever an EJBObject implementation for an 
-    * entitybean is needed.
-    *
-    * @param id    The primary key of the entity.
-    * @return      An implementation of the remote interface for this
-    *              container.
-    */
-   Object getEntityEJBObject(Object id);
-
-   /**
-    * This method is called whenever a collection of EJBObjects for a
-    * collection of primary keys is needed.
-    *
-    * @param en      Enumeration of primary keys.
-    * @return        A collection of EJBObjects implementing the remote
-    *                interface for this container.
-    */
-   Collection getEntityCollection(Collection en);
-}
-

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/Ejb3Deployment.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -52,9 +52,9 @@
 import org.jboss.ejb3.entity.SecondLevelCacheUtil;
 import org.jboss.ejb3.javaee.JavaEEApplication;
 import org.jboss.ejb3.javaee.JavaEEComponent;
+import org.jboss.ejb3.javaee.JavaEEComponentHelper;
 import org.jboss.ejb3.javaee.JavaEEModule;
 import org.jboss.ejb3.lang.ClassHelper;
-import org.jboss.ejb3.metadata.JBossMessageDrivenBeanGenericWrapper;
 import org.jboss.ejb3.metadata.JBossSessionGenericWrapper;
 import org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData;
 import org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitsMetaData;
@@ -63,14 +63,15 @@
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
 import org.jboss.metadata.ejb.jboss.JBossGenericBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanGenericWrapper;
 import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
 import org.jboss.metadata.ejb.jboss.JBossMetaData;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 import org.jboss.metadata.javaee.spec.MessageDestinationsMetaData;
 import org.jboss.system.ServiceMBeanSupport;
 import org.jboss.virtual.VirtualFile;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
 import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
 
 /**
  * An EjbModule represents a collection of beans that are deployed as a unit.
@@ -311,6 +312,31 @@
       return unit.getShortName();
    }
 
+   /**
+    * Get the deployment ejb container for the given ejb name.
+    * 
+    * @param ejbName the deployment unique ejb name
+    * @return the ejb container if found, null otherwise
+    * @throws IllegalStateException if the ejbName cannot be used to
+    *    for the container name.
+    */
+   public EJBContainer getEjbContainerForEjbName(String ejbName)
+   {
+      String ejbObjectName = JavaEEComponentHelper.createObjectName(this, ejbName);
+      EJBContainer container = null;
+      ObjectName ejbON;
+      try
+      {
+         ejbON = new ObjectName(ejbObjectName);
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException("Failed to ", e);
+      }
+      container = (EJBContainer) ejbContainers.get(ejbON);
+      return container;
+   }
+
    public Container getContainer(ObjectName name)
    {
       return (Container) ejbContainers.get(name);
@@ -402,7 +428,7 @@
       String name = on.getCanonicalName();
       DependencyPolicy dependsPolicy = container.getDependencyPolicy();
       dependsPolicy.addDependency("jboss.ejb:service=EJBTimerService");
-      kernelAbstraction.install(name, dependsPolicy, container);
+      kernelAbstraction.install(name, dependsPolicy, unit, container);
       mbeanServer.registerMBean(container.getMBean(), on);
       log.debug("Bound ejb3 container " + name);
    }
@@ -686,7 +712,7 @@
          {
             DependencyPolicy policy = createDependencyPolicy(entityDeployment);
             entityDeployment.addDependencies(policy);
-            kernelAbstraction.install(entityDeployment.getKernelName(), policy, entityDeployment);
+            kernelAbstraction.install(entityDeployment.getKernelName(), policy, unit, entityDeployment);
          }
       }
    }

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -64,6 +64,18 @@
       return deployments.get(relativeShortName);
    }
 
+   public EJBContainer getEjbContainer(Class businessIntf, String vfsContext)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public EJBContainer getEjbContainer(String ejbLink, Class businessIntf, String vfsContext)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
    public String getName()
    {
       return shortName;

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -25,6 +25,7 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
@@ -55,6 +56,7 @@
    private DeploymentInfo deploymentInfo;
    InterceptorInfoRepository interceptorInfoRepository = new InterceptorInfoRepository(null);
    private VirtualFile vfsRoot;
+   private Map<String, Object> attachments = new HashMap<String, Object>();
 
    public JmxDeploymentUnit(DeploymentInfo deploymentInfo)
    {
@@ -70,11 +72,30 @@
       }
    }
 
+   public Object addAttachment(String name, Object attachment)
+   {
+      return attachments.put(name, attachment);
+   }
+   public Object getAttachment(String name)
+   {
+      return attachments.get(name);
+   }
+   public Object removeAttachment(String name)
+   {
+      return attachments.remove(name);
+   }
+
    public VirtualFile getRootFile()
    {
       return vfsRoot;
    }
    
+   public String getRelativePath()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
    public URL getRelativeURL(String jar)
    {
       URL url = null;

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -68,7 +68,8 @@
    }
 
 
-   public void install(String name, DependencyPolicy dependencies, Object service)
+   public void install(String name, DependencyPolicy dependencies,
+         DeploymentUnit unit, Object service)
    {
       if (!(service instanceof ServiceMBeanSupport) && !(service instanceof DynamicMBean))
       {

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/KernelAbstraction.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/KernelAbstraction.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/KernelAbstraction.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -33,7 +33,7 @@
  */
 public interface KernelAbstraction extends ClientKernelAbstraction
 {
-   public void install(String name, DependencyPolicy dependencies, Object service);
+   public void install(String name, DependencyPolicy dependencies, DeploymentUnit unit, Object service);
 
    public void uninstall(String name);
 

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/MCKernelAbstraction.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/MCKernelAbstraction.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/MCKernelAbstraction.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -112,7 +112,8 @@
       return false;
    }
    
-   public void install(String name, DependencyPolicy dependencies, Object service)
+   public void install(String name, DependencyPolicy dependencies,
+         DeploymentUnit unit, Object service)
    {
       AbstractBeanMetaData bean = new AbstractBeanMetaData(name, service.getClass().getName());
       bean.setConstructor(new AlreadyInstantiated(service));
@@ -162,7 +163,7 @@
       try
       {
          server.registerMBean(service, on);
-         install(on.getCanonicalName(), dependencies, service);
+         install(on.getCanonicalName(), dependencies, null, service);
          
          // EJBTHREE-606: emulate the ServiceController calls
          MBeanInfo info = server.getMBeanInfo(on); // redundant call for speed

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/aop/BeanContainer.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/aop/BeanContainer.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/aop/BeanContainer.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -27,20 +27,17 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.interceptor.Interceptors;
-
 import org.jboss.aop.Advisor;
 import org.jboss.aop.Domain;
 import org.jboss.aop.annotation.AnnotationRepository;
 import org.jboss.ejb3.EJBContainer;
 import org.jboss.ejb3.cluster.metadata.ClusteredMetaDataBridge;
 import org.jboss.ejb3.interceptors.InterceptorFactoryRef;
-import org.jboss.ejb3.interceptors.aop.annotation.DefaultInterceptors;
 import org.jboss.ejb3.interceptors.container.AbstractContainer;
 import org.jboss.ejb3.interceptors.container.ContainerInterceptorFactory;
 import org.jboss.ejb3.interceptors.container.InterceptorFactoryRefImpl;
+import org.jboss.ejb3.interceptors.container.ManagedObjectAdvisor;
 import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
-import org.jboss.ejb3.interceptors.lang.ClassHelper;
 import org.jboss.ejb3.interceptors.metadata.AdditiveBeanInterceptorMetaDataBridge;
 import org.jboss.ejb3.interceptors.metadata.InterceptorComponentMetaDataLoaderFactory;
 import org.jboss.ejb3.interceptors.metadata.InterceptorMetaDataBridge;
@@ -68,45 +65,9 @@
       setBeanContextFactoryClass(BeanContainerBeanContextFactory.class);
    }
    
-   private static void addInterceptorClasses(List<Class<?>> interceptorClasses, Class<?> interceptors[])
-   {
-      if(interceptors != null)
-      {
-         for(Class<?> interceptorClass : interceptors)
-         {
-            if(!interceptorClasses.contains(interceptorClass))
-               interceptorClasses.add(interceptorClass);
-         }
-      }
-   }
-   
-   private static void addInterceptorClasses(List<Class<?>> interceptorClasses, Interceptors interceptorsAnnotation)
-   {
-      if(interceptorsAnnotation != null)
-      {
-         addInterceptorClasses(interceptorClasses, interceptorsAnnotation.value());
-      }
-   }
-   
    public List<Class<?>> getInterceptorClasses()
    {
-      // FIXME: move to ejb3-interceptors
-      List<Class<?>> interceptorClasses = new ArrayList<Class<?>>();
-      
-      DefaultInterceptors defaultInterceptorsAnnotation = getAnnotation(DefaultInterceptors.class);
-      if(defaultInterceptorsAnnotation != null)
-         addInterceptorClasses(interceptorClasses, defaultInterceptorsAnnotation.value());
-      
-      Interceptors interceptorsAnnotation = (Interceptors) getAdvisor().resolveAnnotation(Interceptors.class);
-      addInterceptorClasses(interceptorClasses, interceptorsAnnotation);
-      
-      for(Method beanMethod : ClassHelper.getAllMethods(getBeanClass()))
-      {
-         interceptorsAnnotation = (Interceptors) getAdvisor().resolveAnnotation(beanMethod, Interceptors.class);
-         addInterceptorClasses(interceptorClasses, interceptorsAnnotation);
-      }
-      
-      return interceptorClasses;
+      return getInterceptorRegistry().getInterceptorClasses();
    }
    
    @Override
@@ -239,20 +200,11 @@
       
       initializeAdvisor(name, domain, beanClass, annotations);
    }
-   
+
    @Override
-   protected void initializeAdvisor(String name, Domain domain, Class<? extends Object> beanClass, AnnotationRepository annotations)
+   protected ManagedObjectAdvisor<Object, BeanContainer> createAdvisor(String name, Domain domain, Class<? extends Object> beanClass, AnnotationRepository annotations)
    {
-      assert name != null : "name is null";
-      assert domain != null : "domain is null";
-      assert beanClass != null : "beanClass is null";
-      
-      // Decouple setting the advisor and initializing it, so interceptors
-      // can get it.
-      ExtendedManagedObjectAdvisor advisor = new ExtendedManagedObjectAdvisor(this, name, domain, annotations);
-      setAdvisor(advisor);
-      advisor.getAnnotations().addClassAnnotation(InterceptorFactoryRef.class, new InterceptorFactoryRefImpl(ContainerInterceptorFactory.class));
-      advisor.initialize(beanClass);
+      return new ExtendedManagedObjectAdvisor(this, name, domain, annotations);
    }
    
    /*
@@ -293,34 +245,4 @@
          throw new RuntimeException(e);
       }
    }
-   
-   /**
-    * FIXME: Q&D hack
-    * @param advisor
-    */
-   private void setAdvisor(ExtendedManagedObjectAdvisor advisor)
-   {
-      try
-      {
-         Field field = AbstractContainer.class.getDeclaredField("advisor");
-         field.setAccessible(true);
-         field.set(this, advisor);
-      }
-      catch (IllegalArgumentException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (IllegalAccessException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (NoSuchFieldException e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch (SecurityException e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
 }

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -31,6 +31,7 @@
 import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
@@ -78,6 +79,7 @@
       private Hashtable jndiProperties;
       private InterceptorInfoRepository interceptorInfoRepository;
       private VirtualFile vfsRoot;
+      private Map<String, Object> attachments = new HashMap<String, Object>();
 
       public DeployerUnit(ClassLoader loader, URL url, Map defaultProps, Hashtable jndiProperties)
       {
@@ -108,11 +110,30 @@
          this.interceptorInfoRepository = new InterceptorInfoRepository(loader);
       }
 
+      public Object addAttachment(String name, Object attachment)
+      {
+         return attachments.put(name, attachment);
+      }
+      public Object getAttachment(String name)
+      {
+         return attachments.get(name);
+      }
+      public Object removeAttachment(String name)
+      {
+         return attachments.remove(name);
+      }
+
       public VirtualFile getRootFile()
       {
          return vfsRoot;
       }
       
+      public String getRelativePath()
+      {
+         // There are only root deployments in standalone
+         return "";
+      }
+
       public URL getRelativeURL(String jar)
       {
          URL url = null;

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/mdb/MessagingContainer.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/mdb/MessagingContainer.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/mdb/MessagingContainer.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -177,11 +177,6 @@
    protected void innerStart() throws Exception
    {
       log.debug("Initializing");
-
-      /*  See forum thread: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032454#4032454
-      if (getResourceAdaptorName().equals(JMS_ADAPTOR))
-         jmsCreate();
-         */
    }
 
    public ObjectName getJmxName()
@@ -360,51 +355,6 @@
          return property.getValue();
       return null;
    }
-
-   protected void jmsCreate() throws Exception
-   {
-      //    Get the JMS provider
-      // todo get rid of server module dependency
-      JMSProviderAdapter adapter = getJMSProviderAdapter();
-      log.debug("Provider adapter: " + adapter);
-  
-      // Connect to the JNDI server and get a reference to root context
-      Context context = adapter.getInitialContext();
-      log.debug("context: " + context);
-
-      // if we can't get the root context then exit with an exception
-      if (context == null)
-      {
-         throw new RuntimeException("Failed to get the root context");
-      }
-
-      // Unfortunately the destination is optional, so if we do not have one
-      // here we have to look it up if we have a destinationJNDI, else give it
-      // a default.
-      String destinationType = getDestinationType();
-      if (destinationType == null)
-      {
-         log.warn("No message-driven-destination given; using; guessing type");
-         destinationType = getDestinationType(context, getDestination());
-      }
-
-      if ("javax.jms.Topic".equals(destinationType))
-      {
-         innerCreateTopic(context);
-
-      }
-      else if ("javax.jms.Queue".equals(destinationType))
-      {
-         innerCreateQueue(context);
-
-      }
-      else
-         throw new DeploymentException("Unknown destination-type " + destinationType);
-
-      log.debug("Initialized with config " + toString());
-
-      context.close();
-   }
    
    protected void innerCreateQueue(Context context)
            throws Exception

Deleted: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/metadata/JBossMessageDrivenBeanGenericWrapper.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/metadata/JBossMessageDrivenBeanGenericWrapper.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/metadata/JBossMessageDrivenBeanGenericWrapper.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,687 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007-2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.metadata;
-
-import java.lang.reflect.Method;
-import java.util.Set;
-
-import javax.ejb.TransactionAttributeType;
-import javax.ejb.TransactionManagementType;
-
-import org.jboss.metadata.ejb.jboss.ContainerConfigurationMetaData;
-import org.jboss.metadata.ejb.jboss.IORSecurityConfigMetaData;
-import org.jboss.metadata.ejb.jboss.InvokerBindingMetaData;
-import org.jboss.metadata.ejb.jboss.InvokerBindingsMetaData;
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
-import org.jboss.metadata.ejb.jboss.JBossGenericBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.ejb.jboss.MethodAttributesMetaData;
-import org.jboss.metadata.ejb.jboss.PoolConfigMetaData;
-import org.jboss.metadata.ejb.spec.ContainerTransactionsMetaData;
-import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.spec.ExcludeListMetaData;
-import org.jboss.metadata.ejb.spec.MethodInterfaceType;
-import org.jboss.metadata.ejb.spec.MethodPermissionsMetaData;
-import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
-import org.jboss.metadata.javaee.jboss.AnnotationsMetaData;
-import org.jboss.metadata.javaee.jboss.IgnoreDependencyMetaData;
-import org.jboss.metadata.javaee.jboss.JndiRefsMetaData;
-import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.DescriptionGroupMetaData;
-import org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
-import org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData;
-import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
-import org.jboss.metadata.javaee.spec.EJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.Environment;
-import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
-import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
-import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceContextReferenceMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferenceMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
-import org.jboss.metadata.javaee.spec.PortComponent;
-import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
-import org.jboss.metadata.javaee.support.IdMetaData;
-import org.jboss.metadata.javaee.support.IdMetaDataImpl;
-import org.jboss.metadata.javaee.support.NamedMetaData;
-
-/**
- * Create a wrapper around a JBossGenericBeanMetaData for MDB meta data.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision$
- */
- at Deprecated
-public class JBossMessageDrivenBeanGenericWrapper extends JBossMessageDrivenBeanMetaData
-{
-   private static final long serialVersionUID = 1L;
-   
-   private JBossGenericBeanMetaData delegate;
-   
-   public JBossMessageDrivenBeanGenericWrapper(JBossGenericBeanMetaData delegate)
-   {
-      assert delegate != null : "delegate is null";
-      
-      this.delegate = delegate;
-   }
-
-   // custom delegate methods
-   
-   @Override
-   public String getDestinationJndiName()
-   {
-      return getJndiName();
-   }
-   
-   // generated delegate methods
-   
-   public Set<String> determineAllDepends()
-   {
-      return delegate.determineAllDepends();
-   }
-
-   public String determineConfigurationName()
-   {
-      return delegate.determineConfigurationName();
-   }
-
-   public ContainerConfigurationMetaData determineContainerConfiguration()
-   {
-      return delegate.determineContainerConfiguration();
-   }
-
-   public InvokerBindingMetaData determineInvokerBinding(String invokerName)
-   {
-      return delegate.determineInvokerBinding(invokerName);
-   }
-
-   public InvokerBindingsMetaData determineInvokerBindings()
-   {
-      return delegate.determineInvokerBindings();
-   }
-
-   public String determineLocalJndiName()
-   {
-      return delegate.determineLocalJndiName();
-   }
-
-   public boolean equals(Object obj)
-   {
-      return delegate.equals(obj);
-   }
-
-   public AnnotatedEJBReferencesMetaData getAnnotatedEjbReferences()
-   {
-      return delegate.getAnnotatedEjbReferences();
-   }
-
-   public AnnotationsMetaData getAnnotations()
-   {
-      return delegate.getAnnotations();
-   }
-
-   public String getAopDomainName()
-   {
-      return delegate.getAopDomainName();
-   }
-
-   public String getConfigurationName()
-   {
-      return delegate.getConfigurationName();
-   }
-
-   public String getContainerObjectNameJndiName()
-   {
-      return delegate.getContainerObjectNameJndiName();
-   }
-
-   public ContainerTransactionsMetaData getContainerTransactions()
-   {
-      return delegate.getContainerTransactions();
-   }
-
-   public String getDefaultConfigurationName()
-   {
-      return delegate.getDefaultConfigurationName();
-   }
-
-   public Set<String> getDepends()
-   {
-      return delegate.getDepends();
-   }
-
-   public DescriptionGroupMetaData getDescriptionGroup()
-   {
-      return delegate.getDescriptionGroup();
-   }
-
-   public String getEjbClass()
-   {
-      return delegate.getEjbClass();
-   }
-
-   public JBossMetaData getEjbJarMetaData()
-   {
-      return delegate.getEjbJarMetaData();
-   }
-
-   public EJBLocalReferenceMetaData getEjbLocalReferenceByName(String name)
-   {
-      return delegate.getEjbLocalReferenceByName(name);
-   }
-
-   public EJBLocalReferencesMetaData getEjbLocalReferences()
-   {
-      return delegate.getEjbLocalReferences();
-   }
-
-   public String getEjbName()
-   {
-      return delegate.getEjbName();
-   }
-
-   public EJBReferenceMetaData getEjbReferenceByName(String name)
-   {
-      return delegate.getEjbReferenceByName(name);
-   }
-
-   public EJBReferencesMetaData getEjbReferences()
-   {
-      return delegate.getEjbReferences();
-   }
-
-   public JBossEnterpriseBeansMetaData getEnterpriseBeansMetaData()
-   {
-      return delegate.getEnterpriseBeansMetaData();
-   }
-
-   public EnvironmentEntriesMetaData getEnvironmentEntries()
-   {
-      return delegate.getEnvironmentEntries();
-   }
-
-   public EnvironmentEntryMetaData getEnvironmentEntryByName(String name)
-   {
-      return delegate.getEnvironmentEntryByName(name);
-   }
-
-   public ExcludeListMetaData getExcludeList()
-   {
-      return delegate.getExcludeList();
-   }
-
-   public String getId()
-   {
-      return delegate.getId();
-   }
-
-   public IgnoreDependencyMetaData getIgnoreDependency()
-   {
-      return delegate.getIgnoreDependency();
-   }
-
-   public InvokerBindingsMetaData getInvokerBindings()
-   {
-      return delegate.getInvokerBindings();
-   }
-
-   public IORSecurityConfigMetaData getIorSecurityConfig()
-   {
-      return delegate.getIorSecurityConfig();
-   }
-
-   public JBossMetaData getJBossMetaData()
-   {
-      return delegate.getJBossMetaData();
-   }
-
-   public JBossMetaData getJBossMetaDataWithCheck()
-   {
-      return delegate.getJBossMetaDataWithCheck();
-   }
-
-   public Environment getJndiEnvironmentRefsGroup()
-   {
-      return delegate.getJndiEnvironmentRefsGroup();
-   }
-
-   public String getJndiName()
-   {
-      return delegate.getJndiName();
-   }
-
-   public JndiRefsMetaData getJndiRefs()
-   {
-      return delegate.getJndiRefs();
-   }
-
-   public String getKey()
-   {
-      return delegate.getKey();
-   }
-
-   public String getLocalJndiName()
-   {
-      return delegate.getLocalJndiName();
-   }
-
-   public String getMappedName()
-   {
-      return delegate.getMappedName();
-   }
-
-   public MessageDestinationReferenceMetaData getMessageDestinationReferenceByName(String name)
-   {
-      return delegate.getMessageDestinationReferenceByName(name);
-   }
-
-   public MessageDestinationReferencesMetaData getMessageDestinationReferences()
-   {
-      return delegate.getMessageDestinationReferences();
-   }
-
-   public MethodAttributesMetaData getMethodAttributes()
-   {
-      return delegate.getMethodAttributes();
-   }
-
-   public MethodPermissionsMetaData getMethodPermissions()
-   {
-      return delegate.getMethodPermissions();
-   }
-
-   public Set<String> getMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType)
-   {
-      return delegate.getMethodPermissions(methodName, params, interfaceType);
-   }
-
-   public int getMethodTransactionTimeout(Method method)
-   {
-      return delegate.getMethodTransactionTimeout(method);
-   }
-
-   public int getMethodTransactionTimeout(String methodName)
-   {
-      return delegate.getMethodTransactionTimeout(methodName);
-   }
-
-   public TransactionAttributeType getMethodTransactionType(Method m, MethodInterfaceType iface)
-   {
-      return delegate.getMethodTransactionType(m, iface);
-   }
-
-   public TransactionAttributeType getMethodTransactionType(String methodName, Class<?>[] params,
-         MethodInterfaceType iface)
-   {
-      return delegate.getMethodTransactionType(methodName, params, iface);
-   }
-
-   public String getName()
-   {
-      return delegate.getName();
-   }
-
-   public PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name)
-   {
-      return delegate.getPersistenceContextReferenceByName(name);
-   }
-
-   public PersistenceContextReferencesMetaData getPersistenceContextRefs()
-   {
-      return delegate.getPersistenceContextRefs();
-   }
-
-   public PersistenceUnitReferenceMetaData getPersistenceUnitReferenceByName(String name)
-   {
-      return delegate.getPersistenceUnitReferenceByName(name);
-   }
-
-   public PersistenceUnitReferencesMetaData getPersistenceUnitRefs()
-   {
-      return delegate.getPersistenceUnitRefs();
-   }
-
-   public PoolConfigMetaData getPoolConfig()
-   {
-      return delegate.getPoolConfig();
-   }
-
-   public PortComponent getPortComponent()
-   {
-      return delegate.getPortComponent();
-   }
-
-   public LifecycleCallbacksMetaData getPostConstructs()
-   {
-      return delegate.getPostConstructs();
-   }
-
-   public LifecycleCallbacksMetaData getPreDestroys()
-   {
-      return delegate.getPreDestroys();
-   }
-
-   public ResourceEnvironmentReferenceMetaData getResourceEnvironmentReferenceByName(String name)
-   {
-      return delegate.getResourceEnvironmentReferenceByName(name);
-   }
-
-   public ResourceEnvironmentReferencesMetaData getResourceEnvironmentReferences()
-   {
-      return delegate.getResourceEnvironmentReferences();
-   }
-
-   public ResourceReferenceMetaData getResourceReferenceByName(String name)
-   {
-      return delegate.getResourceReferenceByName(name);
-   }
-
-   public ResourceReferencesMetaData getResourceReferences()
-   {
-      return delegate.getResourceReferences();
-   }
-
-   public String getSecurityDomain()
-   {
-      return delegate.getSecurityDomain();
-   }
-
-   public SecurityIdentityMetaData getSecurityIdentity()
-   {
-      return delegate.getSecurityIdentity();
-   }
-
-   public String getSecurityProxy()
-   {
-      return delegate.getSecurityProxy();
-   }
-
-   public SecurityRoleMetaData getSecurityRole(String roleName)
-   {
-      return delegate.getSecurityRole(roleName);
-   }
-
-   public Set<String> getSecurityRolePrincipals(String roleName)
-   {
-      return delegate.getSecurityRolePrincipals(roleName);
-   }
-
-   public SecurityRoleRefsMetaData getSecurityRoleRefs()
-   {
-      return delegate.getSecurityRoleRefs();
-   }
-
-   public ServiceReferenceMetaData getServiceReferenceByName(String name)
-   {
-      return delegate.getServiceReferenceByName(name);
-   }
-
-   public ServiceReferencesMetaData getServiceReferences()
-   {
-      return delegate.getServiceReferences();
-   }
-
-   public TransactionManagementType getTransactionType()
-   {
-      return delegate.getTransactionType();
-   }
-
-   public int hashCode()
-   {
-      return delegate.hashCode();
-   }
-
-   public boolean hasMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType)
-   {
-      return delegate.hasMethodPermissions(methodName, params, interfaceType);
-   }
-
-   public boolean isBMT()
-   {
-      return delegate.isBMT();
-   }
-
-   public boolean isCMT()
-   {
-      return delegate.isCMT();
-   }
-
-   public boolean isConsumer()
-   {
-      return delegate.isConsumer();
-   }
-
-   public boolean isEntity()
-   {
-      return delegate.isEntity();
-   }
-
-   public boolean isExceptionOnRollback()
-   {
-      return delegate.isExceptionOnRollback();
-   }
-
-   public boolean isMessageDriven()
-   {
-      return delegate.isMessageDriven();
-   }
-
-   public boolean isMethodReadOnly(Method method)
-   {
-      return delegate.isMethodReadOnly(method);
-   }
-
-   public boolean isMethodReadOnly(String methodName)
-   {
-      return delegate.isMethodReadOnly(methodName);
-   }
-
-   public boolean isService()
-   {
-      return delegate.isService();
-   }
-
-   public boolean isSession()
-   {
-      return delegate.isSession();
-   }
-
-   public boolean isTimerPersistence()
-   {
-      return delegate.isTimerPersistence();
-   }
-
-   public void merge(IdMetaData override, IdMetaData original)
-   {
-      delegate.merge(override, original);
-   }
-
-   public void merge(IdMetaDataImpl override, IdMetaDataImpl original)
-   {
-      delegate.merge(override, original);
-   }
-
-   public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overrideFile,
-         String overridenFile, boolean mustOverride)
-   {
-      delegate.merge(override, original, overrideFile, overridenFile, mustOverride);
-   }
-
-   public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original)
-   {
-      delegate.merge(override, original);
-   }
-
-   public void merge(NamedMetaData override, NamedMetaData original)
-   {
-      delegate.merge(override, original);
-   }
-
-   public void setAnnotations(AnnotationsMetaData annotations)
-   {
-      delegate.setAnnotations(annotations);
-   }
-
-   public void setAopDomainName(String aopDomainName)
-   {
-      delegate.setAopDomainName(aopDomainName);
-   }
-
-   public void setConfigurationName(String configurationName)
-   {
-      delegate.setConfigurationName(configurationName);
-   }
-
-   public void setDepends(Set<String> depends)
-   {
-      delegate.setDepends(depends);
-   }
-
-   public void setDescriptionGroup(DescriptionGroupMetaData descriptionGroup)
-   {
-      delegate.setDescriptionGroup(descriptionGroup);
-   }
-
-   public void setEjbClass(String ejbClass)
-   {
-      delegate.setEjbClass(ejbClass);
-   }
-
-   public void setEjbName(String ejbName)
-   {
-      delegate.setEjbName(ejbName);
-   }
-
-   public void setEnterpriseBeansMetaData(JBossEnterpriseBeansMetaData enterpriseBeansMetaData)
-   {
-      delegate.setEnterpriseBeansMetaData(enterpriseBeansMetaData);
-   }
-
-   public void setExceptionOnRollback(boolean exceptionOnRollback)
-   {
-      delegate.setExceptionOnRollback(exceptionOnRollback);
-   }
-
-   public void setId(String id)
-   {
-      delegate.setId(id);
-   }
-
-   public void setIgnoreDependency(IgnoreDependencyMetaData ignoreDependency)
-   {
-      delegate.setIgnoreDependency(ignoreDependency);
-   }
-
-   public void setInvokerBindings(InvokerBindingsMetaData invokers)
-   {
-      delegate.setInvokerBindings(invokers);
-   }
-
-   public void setIorSecurityConfig(IORSecurityConfigMetaData iorSecurityConfig)
-   {
-      delegate.setIorSecurityConfig(iorSecurityConfig);
-   }
-
-   public void setJndiEnvironmentRefsGroup(Environment env)
-   {
-      delegate.setJndiEnvironmentRefsGroup(env);
-   }
-
-   public void setJndiName(String jndiName)
-   {
-      delegate.setJndiName(jndiName);
-   }
-
-   public void setJndiRefs(JndiRefsMetaData jndiRefs)
-   {
-      delegate.setJndiRefs(jndiRefs);
-   }
-
-   public void setLocalJndiName(String localJndiName)
-   {
-      delegate.setLocalJndiName(localJndiName);
-   }
-
-   public void setMappedName(String mappedName)
-   {
-      delegate.setMappedName(mappedName);
-   }
-
-   public void setMethodAttributes(MethodAttributesMetaData methodAttributes)
-   {
-      delegate.setMethodAttributes(methodAttributes);
-   }
-
-   public void setName(String name)
-   {
-      delegate.setName(name);
-   }
-
-   public void setPoolConfig(PoolConfigMetaData poolConfig)
-   {
-      delegate.setPoolConfig(poolConfig);
-   }
-
-   public void setPortComponent(PortComponent portComponent)
-   {
-      delegate.setPortComponent(portComponent);
-   }
-
-   public void setSecurityDomain(String securityDomain)
-   {
-      delegate.setSecurityDomain(securityDomain);
-   }
-
-   public void setSecurityIdentity(SecurityIdentityMetaData securityIdentity)
-   {
-      delegate.setSecurityIdentity(securityIdentity);
-   }
-
-   public void setSecurityProxy(String securityProxy)
-   {
-      delegate.setSecurityProxy(securityProxy);
-   }
-
-   public void setTimerPersistence(boolean timerPersistence)
-   {
-      delegate.setTimerPersistence(timerPersistence);
-   }
-
-   public void setTransactionType(TransactionManagementType transactionType)
-   {
-      delegate.setTransactionType(transactionType);
-   }
-   
-   
-}

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/proxy/EJBMetaDataImpl.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -24,10 +24,10 @@
 import java.io.Serializable;
 import java.rmi.RemoteException;
 
+import javax.ejb.EJBException;
+import javax.ejb.EJBHome;
+import javax.ejb.EJBMetaData;
 import javax.ejb.HomeHandle;
-import javax.ejb.EJBMetaData;
-import javax.ejb.EJBHome;
-import javax.ejb.EJBException;
 
 /**
  * An implementation of the EJBMetaData interface which allows a
@@ -36,6 +36,7 @@
  * @author  Rickard Oberg (rickard.oberg at telkel.com)
  * @author  <a href="mailto:marc.fleury at telkel.com">Marc Fleury</a>
  * @author  <a href="mailto:jason at planet57.com">Jason Dillon</a>
+ * @author  <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision$
  */
 public class EJBMetaDataImpl
@@ -45,9 +46,9 @@
    private static final long serialVersionUID = -3698855455664391097L;
 
    // Attributes ----------------------------------------------------
-   private final Class remote;
-   private final Class home;
-   private final Class pkClass;
+   private final Class<?> remote;
+   private final Class<?> home;
+   private final Class<?> pkClass;
 
    private final boolean session;
    private final boolean statelessSession;
@@ -59,9 +60,9 @@
     * Construct an <tt>EJBMetaDataImpl</tt>.
     * this should only be accessible from the factory.
     */
-   public EJBMetaDataImpl(final Class remote,
-         final Class home,
-         final Class pkClass,
+   public EJBMetaDataImpl(final Class<?> remote,
+         final Class<?> home,
+         final Class<?> pkClass,
          final boolean session,
          final boolean statelessSession,
          final HomeHandle homeHandle)
@@ -107,7 +108,7 @@
    /**
     * Obtain the Class object for the enterprise Bean's home interface.
     */
-   public Class getHomeInterfaceClass()
+   public Class<?> getHomeInterfaceClass()
    {
       return home;
    }
@@ -115,7 +116,7 @@
    /**
     * Obtain the Class object for the enterprise Bean's remote interface.
     */
-   public Class getRemoteInterfaceClass()
+   public Class<?> getRemoteInterfaceClass()
    {
       return remote;
    }
@@ -123,7 +124,7 @@
    /**
     * Obtain the Class object for the enterprise Bean's primary key class.
     */
-   public Class getPrimaryKeyClass()
+   public Class<?> getPrimaryKeyClass()
    {
       if (session == true)
          throw new RuntimeException("A session bean does not have a primary key class");

Copied: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client (from rev 72289, projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/security/client)

Deleted: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,687 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, 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.security.client;
-
-import java.lang.reflect.UndeclaredThrowableException;
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import javax.security.auth.Subject;
-import javax.security.jacc.PolicyContext;
-import javax.security.jacc.PolicyContextException;
-
-import org.jboss.security.RunAsIdentity;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SecurityContext;
-import org.jboss.security.SecurityContextAssociation;
-import org.jboss.security.SecurityContextFactory;
-
-/** A collection of privileged actions for this package
- * @author Scott.Stark at jboss.org
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version $Revison: $
- */
-class SecurityActions
-{   
-   interface PrincipalInfoAction
-   {
-      PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
-      {
-         public void push(final Principal principal, final Object credential,
-            final Subject subject)
-         {
-            AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     SecurityAssociation.pushSubjectContext(subject, principal, credential);
-                     return null;
-                  }
-               }
-            );
-         }
-         public void pop()
-         {
-            AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     SecurityAssociation.popSubjectContext();
-                     return null;
-                  }
-               }
-            );
-         }
-
-         public Principal getPrincipal()
-         {
-            return (Principal)AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     return SecurityAssociation.getPrincipal();
-                  }
-               }
-            );
-         }
-
-         public void setPrincipal(final Principal principal)
-         {
-            AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     SecurityAssociation.setPrincipal(principal);
-                     return null;
-                  }
-               }
-            );
-         }
-
-         public Principal getCallerPrincipal()
-         {
-            return (Principal)AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     return SecurityAssociation.getCallerPrincipal();
-                  }
-               }
-            );
-         }
-
-         public Object getCredential()
-         {
-            return AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     return SecurityAssociation.getCredential();
-                  }
-               }
-            );
-         }
-
-         public void setCredential(final Object credential)
-         {
-            AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     SecurityAssociation.setCredential(credential);
-                     return null;
-                  }
-               }
-            );
-         }
-      };
-
-      PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
-      {
-         public void push(Principal principal, Object credential, Subject subject)
-         {
-            SecurityAssociation.pushSubjectContext(subject, principal, credential);
-         }
-         public void pop()
-         {
-            SecurityAssociation.popSubjectContext();
-         }
-         public Principal getPrincipal()
-         {
-            return SecurityAssociation.getPrincipal();
-         }
-         public void setPrincipal(Principal principal)
-         {
-            SecurityAssociation.setPrincipal(principal);
-         }
-         public Principal getCallerPrincipal()
-         {
-            return SecurityAssociation.getPrincipal();
-         }
-         public Object getCredential()
-         {
-            return SecurityAssociation.getCredential();
-         }
-         public void setCredential(Object credential)
-         {
-            SecurityAssociation.setCredential(credential);
-         }
-      };
-
-      void push(Principal principal, Object credential, Subject subject);
-      void pop();
-      Principal getPrincipal();
-      void setPrincipal(Principal principal);
-      Principal getCallerPrincipal();
-      Object getCredential();
-      void setCredential(Object credential);
-   }
-
-
-   interface RunAsIdentityActions
-   {
-      RunAsIdentityActions PRIVILEGED = new RunAsIdentityActions()
-      {
-         private final PrivilegedAction peekAction = new PrivilegedAction()
-         {
-            public Object run()
-            {
-               return SecurityAssociation.peekRunAsIdentity();
-            }
-         };
-
-         private final PrivilegedAction popAction = new PrivilegedAction()
-         {
-            public Object run()
-            {
-               return SecurityAssociation.popRunAsIdentity();
-            }
-         };
-
-         public RunAsIdentity peek()
-         {
-            return (RunAsIdentity)AccessController.doPrivileged(peekAction);
-         }
-
-         public void push(final RunAsIdentity id)
-         {
-            AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     SecurityAssociation.pushRunAsIdentity(id);
-                     return null;
-                  }
-               }
-            );
-         }
-
-         public RunAsIdentity pop()
-         {
-            return (RunAsIdentity)AccessController.doPrivileged(popAction);
-         }
-      };
-
-      RunAsIdentityActions NON_PRIVILEGED = new RunAsIdentityActions()
-      {
-         public RunAsIdentity peek()
-         {
-            return SecurityAssociation.peekRunAsIdentity();
-         }
-
-         public void push(RunAsIdentity id)
-         {
-            SecurityAssociation.pushRunAsIdentity(id);
-         }
-
-         public RunAsIdentity pop()
-         {
-            return SecurityAssociation.popRunAsIdentity();
-         }
-      };
-
-      RunAsIdentity peek();
-
-      void push(RunAsIdentity id);
-
-      RunAsIdentity pop();
-   }
-
-   interface ContextInfoActions
-   {
-      static final String EX_KEY = "org.jboss.security.exception";
-      ContextInfoActions PRIVILEGED = new ContextInfoActions()
-      {
-         private final PrivilegedAction exAction = new PrivilegedAction()
-         {
-            public Object run()
-            {
-               return SecurityAssociation.getContextInfo(EX_KEY);
-            }
-         };
-         public Exception getContextException()
-         {
-            return (Exception)AccessController.doPrivileged(exAction);
-         }
-      };
-
-      ContextInfoActions NON_PRIVILEGED = new ContextInfoActions()
-      {
-         public Exception getContextException()
-         {
-            return (Exception)SecurityAssociation.getContextInfo(EX_KEY);
-         }
-      };
-
-      Exception getContextException();
-   }
-
-   interface PolicyContextActions
-   {
-      /** The JACC PolicyContext key for the current Subject */
-      static final String SUBJECT_CONTEXT_KEY = "javax.security.auth.Subject.container";
-      PolicyContextActions PRIVILEGED = new PolicyContextActions()
-      {
-         private final PrivilegedExceptionAction exAction = new PrivilegedExceptionAction()
-         {
-            public Object run() throws Exception
-            {
-               return (Subject) PolicyContext.getContext(SUBJECT_CONTEXT_KEY);
-            }
-         };
-         public Subject getContextSubject()
-            throws PolicyContextException
-         {
-            try
-            {
-               return (Subject) AccessController.doPrivileged(exAction);
-            }
-            catch(PrivilegedActionException e)
-            {
-               Exception ex = e.getException();
-               if( ex instanceof PolicyContextException )
-                  throw (PolicyContextException) ex;
-               else
-                  throw new UndeclaredThrowableException(ex);
-            }
-         }
-      };
-
-      PolicyContextActions NON_PRIVILEGED = new PolicyContextActions()
-      {
-         public Subject getContextSubject()
-            throws PolicyContextException
-         {
-            return (Subject) PolicyContext.getContext(SUBJECT_CONTEXT_KEY);
-         }
-      };
-
-      Subject getContextSubject()
-         throws PolicyContextException;
-   }
-   
-   static ClassLoader getContextClassLoader()
-   {
-      return TCLAction.UTIL.getContextClassLoader();
-   }
-
-   static void setContextClassLoader(ClassLoader loader)
-   {
-      TCLAction.UTIL.setContextClassLoader(loader);
-   }
-
-   static Principal getCallerPrincipal()
-   {
-      if (System.getSecurityManager() == null)
-      {
-         return PrincipalInfoAction.NON_PRIVILEGED.getCallerPrincipal();
-      }
-      else
-      {
-         return PrincipalInfoAction.PRIVILEGED.getCallerPrincipal();
-      }
-   }
-
-   static Principal getPrincipal()
-   {
-      if (System.getSecurityManager() == null)
-      {
-         return PrincipalInfoAction.NON_PRIVILEGED.getPrincipal();
-      }
-      else
-      {
-         return PrincipalInfoAction.PRIVILEGED.getPrincipal();
-      }
-   }
-
-   static void setPrincipal(Principal principal)
-   {
-      if (System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.setPrincipal(principal);
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.setPrincipal(principal);
-      }
-   }
-
-   static Object getCredential()
-   {
-      if (System.getSecurityManager() == null)
-      {
-         return PrincipalInfoAction.NON_PRIVILEGED.getCredential();
-      }
-      else
-      {
-         return PrincipalInfoAction.PRIVILEGED.getCredential();
-      }
-   }
-   
-   static void setCredential(Object credential)
-   {
-      if (System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.setCredential(credential);
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.setCredential(credential);
-      }
-   }
-
-   static void pushSubjectContext(Principal principal, Object credential,
-      Subject subject)
-   {
-      if(System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject);
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject);
-      }
-   }
-   static void popSubjectContext()
-   {
-      if(System.getSecurityManager() == null)
-      {
-         PrincipalInfoAction.NON_PRIVILEGED.pop();
-      }
-      else
-      {
-         PrincipalInfoAction.PRIVILEGED.pop();
-      }
-   }
-
-   static RunAsIdentity peekRunAsIdentity()
-   {
-      if(System.getSecurityManager() == null)
-      {
-         return RunAsIdentityActions.NON_PRIVILEGED.peek();
-      }
-      else
-      {
-         return RunAsIdentityActions.PRIVILEGED.peek();
-      }
-   }
-
-   static void pushRunAsIdentity(RunAsIdentity principal)
-   {     
-      if(System.getSecurityManager() == null)
-      {
-         RunAsIdentityActions.NON_PRIVILEGED.push(principal);
-      }
-      else
-      {
-         RunAsIdentityActions.PRIVILEGED.push(principal);
-      }
-   }
-
-   static RunAsIdentity popRunAsIdentity()
-   {
-      if(System.getSecurityManager() == null)
-      {
-         return RunAsIdentityActions.NON_PRIVILEGED.pop();
-      }
-      else
-      {
-         return RunAsIdentityActions.PRIVILEGED.pop();
-      }
-   }
-
-   static Exception getContextException()
-   {
-      if(System.getSecurityManager() == null)
-      {
-         return ContextInfoActions.NON_PRIVILEGED.getContextException();
-      }
-      else
-      {
-         return ContextInfoActions.PRIVILEGED.getContextException();
-      }
-   }
-
-   static Subject getContextSubject()
-      throws PolicyContextException
-   {
-      if(System.getSecurityManager() == null)
-      {
-         return PolicyContextActions.NON_PRIVILEGED.getContextSubject();
-      }
-      else
-      {
-         return PolicyContextActions.PRIVILEGED.getContextSubject();
-      }      
-   }
-
-   
-   
-   
-   
-   
-   interface TCLAction
-   {
-      class UTIL
-      {
-         static TCLAction getTCLAction()
-         {
-            return System.getSecurityManager() == null ? NON_PRIVILEGED : PRIVILEGED;
-         }
-
-         static ClassLoader getContextClassLoader()
-         {
-            return getTCLAction().getContextClassLoader();
-         }
-
-         static ClassLoader getContextClassLoader(Thread thread)
-         {
-            return getTCLAction().getContextClassLoader(thread);
-         }
-
-         static void setContextClassLoader(ClassLoader cl)
-         {
-            getTCLAction().setContextClassLoader(cl);
-         }
-
-         static void setContextClassLoader(Thread thread, ClassLoader cl)
-         {
-            getTCLAction().setContextClassLoader(thread, cl);
-         }
-      }
-
-      TCLAction NON_PRIVILEGED = new TCLAction()
-      {
-         public ClassLoader getContextClassLoader()
-         {
-            return Thread.currentThread().getContextClassLoader();
-         }
-
-         public ClassLoader getContextClassLoader(Thread thread)
-         {
-            return thread.getContextClassLoader();
-         }
-
-         public void setContextClassLoader(ClassLoader cl)
-         {
-            Thread.currentThread().setContextClassLoader(cl);
-         }
-
-         public void setContextClassLoader(Thread thread, ClassLoader cl)
-         {
-            thread.setContextClassLoader(cl);
-         }
-      };
-
-      TCLAction PRIVILEGED = new TCLAction()
-      {
-         private final PrivilegedAction getTCLPrivilegedAction = new PrivilegedAction()
-         {
-            public Object run()
-            {
-               return Thread.currentThread().getContextClassLoader();
-            }
-         };
-
-         public ClassLoader getContextClassLoader()
-         {
-            return (ClassLoader)AccessController.doPrivileged(getTCLPrivilegedAction);
-         }
-
-         public ClassLoader getContextClassLoader(final Thread thread)
-         {
-            return (ClassLoader)AccessController.doPrivileged(new PrivilegedAction()
-            {
-               public Object run()
-               {
-                  return thread.getContextClassLoader();
-               }
-            });
-         }
-
-         public void setContextClassLoader(final ClassLoader cl)
-         {
-            AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     Thread.currentThread().setContextClassLoader(cl);
-                     return null;
-                  }
-               }
-            );
-         }
-
-         public void setContextClassLoader(final Thread thread, final ClassLoader cl)
-         {
-            AccessController.doPrivileged(
-               new PrivilegedAction()
-               {
-                  public Object run()
-                  {
-                     thread.setContextClassLoader(cl);
-                     return null;
-                  }
-               }
-            );
-         }
-      };
-
-      ClassLoader getContextClassLoader();
-
-      ClassLoader getContextClassLoader(Thread thread);
-
-      void setContextClassLoader(ClassLoader cl);
-
-      void setContextClassLoader(Thread thread, ClassLoader cl);
-   }
-   
-   
-   private static class GetSecurityContextAction implements PrivilegedAction
-   {  
-      GetSecurityContextAction()
-      { 
-      }
-      public Object run()
-      { 
-         return SecurityContextAssociation.getSecurityContext(); 
-      }
-   }
-   
-   private static class SetSecurityContextAction implements PrivilegedAction
-   { 
-      private SecurityContext securityContext; 
-      SetSecurityContextAction(SecurityContext sc)
-      {
-         this.securityContext = sc; 
-      }
-      
-      public Object run()
-      {
-         SecurityContextAssociation.setSecurityContext(securityContext);
-         return null;
-      }
-   }
-   
-   private static class ClearSecurityContextAction implements PrivilegedAction
-   {  
-      ClearSecurityContextAction()
-      { 
-      }
-      public Object run()
-      {
-         SecurityContextAssociation.clearSecurityContext();
-         return null;
-      }
-   }
-
-   static void clearSecurityContext()
-   {
-      ClearSecurityContextAction action = new ClearSecurityContextAction();
-      AccessController.doPrivileged(action);
-   }
-   
-   static SecurityContext createSecurityContext() throws PrivilegedActionException
-   {
-      return (SecurityContext) AccessController.doPrivileged(new PrivilegedExceptionAction()
-      {
-
-         public Object run() throws Exception
-         { 
-            return SecurityContextFactory.createSecurityContext("CLIENT");
-         }
-      });
-   }
-   
-   static SecurityContext getSecurityContext()
-   {
-      GetSecurityContextAction action = new GetSecurityContextAction();
-      return (SecurityContext)AccessController.doPrivileged(action);
-   }
-   
-   static void setSecurityContext(SecurityContext sc)
-   {
-      SetSecurityContextAction action = new SetSecurityContextAction(sc);
-      AccessController.doPrivileged(action);
-   }
-   
-   static void establishSecurityContext(String domain, Principal p, Object cred,
-         Subject subject) throws Exception
-   { 
-      SecurityContext sc = SecurityContextFactory.createSecurityContext(p, 
-            cred, subject, domain); 
-      SecurityActions.setSecurityContext(sc);
-   }
-   
-}

Copied: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java (from rev 72289, projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityActions.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,687 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, 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.security.client;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.security.AccessController;
+import java.security.Principal;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import javax.security.auth.Subject;
+import javax.security.jacc.PolicyContext;
+import javax.security.jacc.PolicyContextException;
+
+import org.jboss.security.RunAsIdentity;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SecurityContext;
+import org.jboss.security.SecurityContextAssociation;
+import org.jboss.security.SecurityContextFactory;
+
+/** A collection of privileged actions for this package
+ * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version $Revison: $
+ */
+class SecurityActions
+{   
+   interface PrincipalInfoAction
+   {
+      PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
+      {
+         public void push(final Principal principal, final Object credential,
+            final Subject subject)
+         {
+            AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     SecurityAssociation.pushSubjectContext(subject, principal, credential);
+                     return null;
+                  }
+               }
+            );
+         }
+         public void pop()
+         {
+            AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     SecurityAssociation.popSubjectContext();
+                     return null;
+                  }
+               }
+            );
+         }
+
+         public Principal getPrincipal()
+         {
+            return (Principal)AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     return SecurityAssociation.getPrincipal();
+                  }
+               }
+            );
+         }
+
+         public void setPrincipal(final Principal principal)
+         {
+            AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     SecurityAssociation.setPrincipal(principal);
+                     return null;
+                  }
+               }
+            );
+         }
+
+         public Principal getCallerPrincipal()
+         {
+            return (Principal)AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     return SecurityAssociation.getCallerPrincipal();
+                  }
+               }
+            );
+         }
+
+         public Object getCredential()
+         {
+            return AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     return SecurityAssociation.getCredential();
+                  }
+               }
+            );
+         }
+
+         public void setCredential(final Object credential)
+         {
+            AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     SecurityAssociation.setCredential(credential);
+                     return null;
+                  }
+               }
+            );
+         }
+      };
+
+      PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
+      {
+         public void push(Principal principal, Object credential, Subject subject)
+         {
+            SecurityAssociation.pushSubjectContext(subject, principal, credential);
+         }
+         public void pop()
+         {
+            SecurityAssociation.popSubjectContext();
+         }
+         public Principal getPrincipal()
+         {
+            return SecurityAssociation.getPrincipal();
+         }
+         public void setPrincipal(Principal principal)
+         {
+            SecurityAssociation.setPrincipal(principal);
+         }
+         public Principal getCallerPrincipal()
+         {
+            return SecurityAssociation.getPrincipal();
+         }
+         public Object getCredential()
+         {
+            return SecurityAssociation.getCredential();
+         }
+         public void setCredential(Object credential)
+         {
+            SecurityAssociation.setCredential(credential);
+         }
+      };
+
+      void push(Principal principal, Object credential, Subject subject);
+      void pop();
+      Principal getPrincipal();
+      void setPrincipal(Principal principal);
+      Principal getCallerPrincipal();
+      Object getCredential();
+      void setCredential(Object credential);
+   }
+
+
+   interface RunAsIdentityActions
+   {
+      RunAsIdentityActions PRIVILEGED = new RunAsIdentityActions()
+      {
+         private final PrivilegedAction peekAction = new PrivilegedAction()
+         {
+            public Object run()
+            {
+               return SecurityAssociation.peekRunAsIdentity();
+            }
+         };
+
+         private final PrivilegedAction popAction = new PrivilegedAction()
+         {
+            public Object run()
+            {
+               return SecurityAssociation.popRunAsIdentity();
+            }
+         };
+
+         public RunAsIdentity peek()
+         {
+            return (RunAsIdentity)AccessController.doPrivileged(peekAction);
+         }
+
+         public void push(final RunAsIdentity id)
+         {
+            AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     SecurityAssociation.pushRunAsIdentity(id);
+                     return null;
+                  }
+               }
+            );
+         }
+
+         public RunAsIdentity pop()
+         {
+            return (RunAsIdentity)AccessController.doPrivileged(popAction);
+         }
+      };
+
+      RunAsIdentityActions NON_PRIVILEGED = new RunAsIdentityActions()
+      {
+         public RunAsIdentity peek()
+         {
+            return SecurityAssociation.peekRunAsIdentity();
+         }
+
+         public void push(RunAsIdentity id)
+         {
+            SecurityAssociation.pushRunAsIdentity(id);
+         }
+
+         public RunAsIdentity pop()
+         {
+            return SecurityAssociation.popRunAsIdentity();
+         }
+      };
+
+      RunAsIdentity peek();
+
+      void push(RunAsIdentity id);
+
+      RunAsIdentity pop();
+   }
+
+   interface ContextInfoActions
+   {
+      static final String EX_KEY = "org.jboss.security.exception";
+      ContextInfoActions PRIVILEGED = new ContextInfoActions()
+      {
+         private final PrivilegedAction exAction = new PrivilegedAction()
+         {
+            public Object run()
+            {
+               return SecurityAssociation.getContextInfo(EX_KEY);
+            }
+         };
+         public Exception getContextException()
+         {
+            return (Exception)AccessController.doPrivileged(exAction);
+         }
+      };
+
+      ContextInfoActions NON_PRIVILEGED = new ContextInfoActions()
+      {
+         public Exception getContextException()
+         {
+            return (Exception)SecurityAssociation.getContextInfo(EX_KEY);
+         }
+      };
+
+      Exception getContextException();
+   }
+
+   interface PolicyContextActions
+   {
+      /** The JACC PolicyContext key for the current Subject */
+      static final String SUBJECT_CONTEXT_KEY = "javax.security.auth.Subject.container";
+      PolicyContextActions PRIVILEGED = new PolicyContextActions()
+      {
+         private final PrivilegedExceptionAction exAction = new PrivilegedExceptionAction()
+         {
+            public Object run() throws Exception
+            {
+               return (Subject) PolicyContext.getContext(SUBJECT_CONTEXT_KEY);
+            }
+         };
+         public Subject getContextSubject()
+            throws PolicyContextException
+         {
+            try
+            {
+               return (Subject) AccessController.doPrivileged(exAction);
+            }
+            catch(PrivilegedActionException e)
+            {
+               Exception ex = e.getException();
+               if( ex instanceof PolicyContextException )
+                  throw (PolicyContextException) ex;
+               else
+                  throw new UndeclaredThrowableException(ex);
+            }
+         }
+      };
+
+      PolicyContextActions NON_PRIVILEGED = new PolicyContextActions()
+      {
+         public Subject getContextSubject()
+            throws PolicyContextException
+         {
+            return (Subject) PolicyContext.getContext(SUBJECT_CONTEXT_KEY);
+         }
+      };
+
+      Subject getContextSubject()
+         throws PolicyContextException;
+   }
+   
+   static ClassLoader getContextClassLoader()
+   {
+      return TCLAction.UTIL.getContextClassLoader();
+   }
+
+   static void setContextClassLoader(ClassLoader loader)
+   {
+      TCLAction.UTIL.setContextClassLoader(loader);
+   }
+
+   static Principal getCallerPrincipal()
+   {
+      if (System.getSecurityManager() == null)
+      {
+         return PrincipalInfoAction.NON_PRIVILEGED.getCallerPrincipal();
+      }
+      else
+      {
+         return PrincipalInfoAction.PRIVILEGED.getCallerPrincipal();
+      }
+   }
+
+   static Principal getPrincipal()
+   {
+      if (System.getSecurityManager() == null)
+      {
+         return PrincipalInfoAction.NON_PRIVILEGED.getPrincipal();
+      }
+      else
+      {
+         return PrincipalInfoAction.PRIVILEGED.getPrincipal();
+      }
+   }
+
+   static void setPrincipal(Principal principal)
+   {
+      if (System.getSecurityManager() == null)
+      {
+         PrincipalInfoAction.NON_PRIVILEGED.setPrincipal(principal);
+      }
+      else
+      {
+         PrincipalInfoAction.PRIVILEGED.setPrincipal(principal);
+      }
+   }
+
+   static Object getCredential()
+   {
+      if (System.getSecurityManager() == null)
+      {
+         return PrincipalInfoAction.NON_PRIVILEGED.getCredential();
+      }
+      else
+      {
+         return PrincipalInfoAction.PRIVILEGED.getCredential();
+      }
+   }
+   
+   static void setCredential(Object credential)
+   {
+      if (System.getSecurityManager() == null)
+      {
+         PrincipalInfoAction.NON_PRIVILEGED.setCredential(credential);
+      }
+      else
+      {
+         PrincipalInfoAction.PRIVILEGED.setCredential(credential);
+      }
+   }
+
+   static void pushSubjectContext(Principal principal, Object credential,
+      Subject subject)
+   {
+      if(System.getSecurityManager() == null)
+      {
+         PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject);
+      }
+      else
+      {
+         PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject);
+      }
+   }
+   static void popSubjectContext()
+   {
+      if(System.getSecurityManager() == null)
+      {
+         PrincipalInfoAction.NON_PRIVILEGED.pop();
+      }
+      else
+      {
+         PrincipalInfoAction.PRIVILEGED.pop();
+      }
+   }
+
+   static RunAsIdentity peekRunAsIdentity()
+   {
+      if(System.getSecurityManager() == null)
+      {
+         return RunAsIdentityActions.NON_PRIVILEGED.peek();
+      }
+      else
+      {
+         return RunAsIdentityActions.PRIVILEGED.peek();
+      }
+   }
+
+   static void pushRunAsIdentity(RunAsIdentity principal)
+   {     
+      if(System.getSecurityManager() == null)
+      {
+         RunAsIdentityActions.NON_PRIVILEGED.push(principal);
+      }
+      else
+      {
+         RunAsIdentityActions.PRIVILEGED.push(principal);
+      }
+   }
+
+   static RunAsIdentity popRunAsIdentity()
+   {
+      if(System.getSecurityManager() == null)
+      {
+         return RunAsIdentityActions.NON_PRIVILEGED.pop();
+      }
+      else
+      {
+         return RunAsIdentityActions.PRIVILEGED.pop();
+      }
+   }
+
+   static Exception getContextException()
+   {
+      if(System.getSecurityManager() == null)
+      {
+         return ContextInfoActions.NON_PRIVILEGED.getContextException();
+      }
+      else
+      {
+         return ContextInfoActions.PRIVILEGED.getContextException();
+      }
+   }
+
+   static Subject getContextSubject()
+      throws PolicyContextException
+   {
+      if(System.getSecurityManager() == null)
+      {
+         return PolicyContextActions.NON_PRIVILEGED.getContextSubject();
+      }
+      else
+      {
+         return PolicyContextActions.PRIVILEGED.getContextSubject();
+      }      
+   }
+
+   
+   
+   
+   
+   
+   interface TCLAction
+   {
+      class UTIL
+      {
+         static TCLAction getTCLAction()
+         {
+            return System.getSecurityManager() == null ? NON_PRIVILEGED : PRIVILEGED;
+         }
+
+         static ClassLoader getContextClassLoader()
+         {
+            return getTCLAction().getContextClassLoader();
+         }
+
+         static ClassLoader getContextClassLoader(Thread thread)
+         {
+            return getTCLAction().getContextClassLoader(thread);
+         }
+
+         static void setContextClassLoader(ClassLoader cl)
+         {
+            getTCLAction().setContextClassLoader(cl);
+         }
+
+         static void setContextClassLoader(Thread thread, ClassLoader cl)
+         {
+            getTCLAction().setContextClassLoader(thread, cl);
+         }
+      }
+
+      TCLAction NON_PRIVILEGED = new TCLAction()
+      {
+         public ClassLoader getContextClassLoader()
+         {
+            return Thread.currentThread().getContextClassLoader();
+         }
+
+         public ClassLoader getContextClassLoader(Thread thread)
+         {
+            return thread.getContextClassLoader();
+         }
+
+         public void setContextClassLoader(ClassLoader cl)
+         {
+            Thread.currentThread().setContextClassLoader(cl);
+         }
+
+         public void setContextClassLoader(Thread thread, ClassLoader cl)
+         {
+            thread.setContextClassLoader(cl);
+         }
+      };
+
+      TCLAction PRIVILEGED = new TCLAction()
+      {
+         private final PrivilegedAction getTCLPrivilegedAction = new PrivilegedAction()
+         {
+            public Object run()
+            {
+               return Thread.currentThread().getContextClassLoader();
+            }
+         };
+
+         public ClassLoader getContextClassLoader()
+         {
+            return (ClassLoader)AccessController.doPrivileged(getTCLPrivilegedAction);
+         }
+
+         public ClassLoader getContextClassLoader(final Thread thread)
+         {
+            return (ClassLoader)AccessController.doPrivileged(new PrivilegedAction()
+            {
+               public Object run()
+               {
+                  return thread.getContextClassLoader();
+               }
+            });
+         }
+
+         public void setContextClassLoader(final ClassLoader cl)
+         {
+            AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     Thread.currentThread().setContextClassLoader(cl);
+                     return null;
+                  }
+               }
+            );
+         }
+
+         public void setContextClassLoader(final Thread thread, final ClassLoader cl)
+         {
+            AccessController.doPrivileged(
+               new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     thread.setContextClassLoader(cl);
+                     return null;
+                  }
+               }
+            );
+         }
+      };
+
+      ClassLoader getContextClassLoader();
+
+      ClassLoader getContextClassLoader(Thread thread);
+
+      void setContextClassLoader(ClassLoader cl);
+
+      void setContextClassLoader(Thread thread, ClassLoader cl);
+   }
+   
+   
+   private static class GetSecurityContextAction implements PrivilegedAction
+   {  
+      GetSecurityContextAction()
+      { 
+      }
+      public Object run()
+      { 
+         return SecurityContextAssociation.getSecurityContext(); 
+      }
+   }
+   
+   private static class SetSecurityContextAction implements PrivilegedAction
+   { 
+      private SecurityContext securityContext; 
+      SetSecurityContextAction(SecurityContext sc)
+      {
+         this.securityContext = sc; 
+      }
+      
+      public Object run()
+      {
+         SecurityContextAssociation.setSecurityContext(securityContext);
+         return null;
+      }
+   }
+   
+   private static class ClearSecurityContextAction implements PrivilegedAction
+   {  
+      ClearSecurityContextAction()
+      { 
+      }
+      public Object run()
+      {
+         SecurityContextAssociation.clearSecurityContext();
+         return null;
+      }
+   }
+
+   static void clearSecurityContext()
+   {
+      ClearSecurityContextAction action = new ClearSecurityContextAction();
+      AccessController.doPrivileged(action);
+   }
+   
+   static SecurityContext createSecurityContext() throws PrivilegedActionException
+   {
+      return (SecurityContext) AccessController.doPrivileged(new PrivilegedExceptionAction()
+      {
+
+         public Object run() throws Exception
+         { 
+            return SecurityContextFactory.createSecurityContext("CLIENT");
+         }
+      });
+   }
+   
+   static SecurityContext getSecurityContext()
+   {
+      GetSecurityContextAction action = new GetSecurityContextAction();
+      return (SecurityContext)AccessController.doPrivileged(action);
+   }
+   
+   static void setSecurityContext(SecurityContext sc)
+   {
+      SetSecurityContextAction action = new SetSecurityContextAction(sc);
+      AccessController.doPrivileged(action);
+   }
+   
+   static void establishSecurityContext(String domain, Principal p, Object cred,
+         Subject subject) throws Exception
+   { 
+      SecurityContext sc = SecurityContextFactory.createSecurityContext(p, 
+            cred, subject, domain); 
+      SecurityActions.setSecurityContext(sc);
+   }
+   
+}

Deleted: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,77 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, 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.security.client;
-
-import java.security.Principal;
-import java.io.ObjectStreamException;
-
-import org.jboss.security.SecurityContext;
-
-/** 
- * Security Interceptor in Client Proxy
- *
- * @author <a href="bill at jboss.org">Bill Burke</a>
- * @version $Revision: 64740 $
- */
-public final class SecurityClientInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable
-{
-   private static final long serialVersionUID = -6366165968174741107L;
-
-   public static final SecurityClientInterceptor singleton = new SecurityClientInterceptor();
-   public String getName() { return "SecurityClientInterceptor"; }
-
-   /**
-    * Authenticates the caller using the principal and credentials in the 
-    * Infocation if thre is a security manager and an invcocation method.
-    */
-   public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
-   {
-      // Get Principal and credentials 
-      Principal principal = SecurityActions.getPrincipal();
-      if (principal != null) invocation.getMetaData().addMetaData("security", "principal", principal);
-
-      Object credential = SecurityActions.getCredential();
-      if (credential != null) invocation.getMetaData().addMetaData("security", "credential", credential);
-      
-      //Get the security context
-      SecurityContext sc = SecurityActions.getSecurityContext();
-      if(sc == null)
-      {
-         sc = SecurityActions.createSecurityContext();
-         SecurityActions.setSecurityContext(sc);
-      }
-      invocation.getMetaData().addMetaData("security", "context", sc);
-      try
-      { 
-         return invocation.invokeNext();  
-      }
-      finally
-      {
-         //Place the previous context
-         SecurityActions.setSecurityContext(sc);
-      }
-   }
-
-   Object readResolve() throws ObjectStreamException {
-      return singleton;
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java (from rev 72289, projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/security/client/SecurityClientInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,77 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, 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.security.client;
+
+import java.security.Principal;
+import java.io.ObjectStreamException;
+
+import org.jboss.security.SecurityContext;
+
+/** 
+ * Security Interceptor in Client Proxy
+ *
+ * @author <a href="bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 64740 $
+ */
+public final class SecurityClientInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable
+{
+   private static final long serialVersionUID = -6366165968174741107L;
+
+   public static final SecurityClientInterceptor singleton = new SecurityClientInterceptor();
+   public String getName() { return "SecurityClientInterceptor"; }
+
+   /**
+    * Authenticates the caller using the principal and credentials in the 
+    * Infocation if thre is a security manager and an invcocation method.
+    */
+   public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
+   {
+      // Get Principal and credentials 
+      Principal principal = SecurityActions.getPrincipal();
+      if (principal != null) invocation.getMetaData().addMetaData("security", "principal", principal);
+
+      Object credential = SecurityActions.getCredential();
+      if (credential != null) invocation.getMetaData().addMetaData("security", "credential", credential);
+      
+      //Get the security context
+      SecurityContext sc = SecurityActions.getSecurityContext();
+      if(sc == null)
+      {
+         sc = SecurityActions.createSecurityContext();
+         SecurityActions.setSecurityContext(sc);
+      }
+      invocation.getMetaData().addMetaData("security", "context", sc);
+      try
+      { 
+         return invocation.invokeNext();  
+      }
+      finally
+      {
+         //Place the previous context
+         SecurityActions.setSecurityContext(sc);
+      }
+   }
+
+   Object readResolve() throws ObjectStreamException {
+      return singleton;
+   }
+}

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/session/BaseSessionProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -31,7 +31,6 @@
 import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import javax.ejb.EJBException;
@@ -42,7 +41,6 @@
 import javax.ejb.EJBObject;
 import javax.ejb.Handle;
 import javax.ejb.HomeHandle;
-import javax.ejb.Remote;
 import javax.ejb.RemoteHome;
 import javax.naming.NamingException;
 
@@ -171,6 +169,13 @@
       }
    }
    
+   /**
+    * Whether or not to bind the home and business interfaces together
+    * 
+    * @return
+    */
+   protected abstract boolean bindHomeAndBusinessTogether(); 
+   
    protected Object constructProxyBusiness(InvocationHandler handler)
    {
       // Return
@@ -286,9 +291,9 @@
     * Returns an array of interfaces to be used for the proxy;
     * will return null if none are defined.
     * 
-    * @param business
+    * @param accessType
+    * @param specType
     * @return
-    * @throws IllegalStateException If specified to use EJB21 View and no Remote/Local interfaces defined
     */
    private Class<?>[] getInterfacesForProxy(ProxyAccessType accessType, SpecificationInterfaceType specType)
    {
@@ -307,7 +312,17 @@
          // If business
          if (specType.equals(SpecificationInterfaceType.EJB30_BUSINESS))
          {
-            intfs.addAll(Arrays.asList(ProxyFactoryHelper.getLocalBusinessInterfaces(container)));
+            intfs.addAll(Arrays.asList(ProxyFactoryHelper.getLocalBusinessInterfaces(container)));  
+            
+            // If binding home with local business 
+            if(this.bindHomeAndBusinessTogether())
+            {
+               Class<?> home = this.getHomeType();
+               if (home != null)
+               {
+                  intfs.add(home);
+               }
+            }
          }
          // If EJBLocalObject
          else
@@ -331,7 +346,18 @@
          // If business
          if (specType.equals(SpecificationInterfaceType.EJB30_BUSINESS))
          {
-            intfs.addAll(Arrays.asList(ProxyFactoryHelper.getRemoteBusinessInterfaces(container)));
+            intfs.addAll(Arrays.asList(ProxyFactoryHelper.getRemoteBusinessInterfaces(container)));   
+            
+            // If binding home with remote business
+            if(this.bindHomeAndBusinessTogether())
+            {
+               Class<?> home = this.getHomeType();
+               if (home != null)
+               {
+                  intfs.add(home);
+               }
+            }
+            
          }
          // If EJBObject
          else
@@ -393,6 +419,13 @@
       return homeHandle;
    }
    
+   /**
+    * Returns the interface type for Home
+    * 
+    * @return
+    */
+   protected abstract Class<?> getHomeType();
+   
    protected final String getJndiName()
    {
       return this.jndiName;
@@ -407,9 +440,11 @@
       
       EJBContainer ejbContainer = (EJBContainer)container;
       
-      Remote remoteAnnotation = ejbContainer.getAnnotation(Remote.class);
-      if (remoteAnnotation != null)
-         remote = remoteAnnotation.value()[0];
+      Class<?>[] remotes = ProxyFactoryHelper.getRemoteInterfaces(this.getContainer());
+      if (remotes != null && remotes.length > 0)
+      {
+         remote = remotes[0];
+      }
       RemoteHome homeAnnotation = ejbContainer.getAnnotation(RemoteHome.class);
       if (homeAnnotation != null)
          home = homeAnnotation.value();

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/BaseStatefulRemoteProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/BaseStatefulRemoteProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/BaseStatefulRemoteProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.ejb3.stateful;
 
 import javax.ejb.EJBObject;
@@ -15,6 +36,15 @@
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
 
+/**
+ * BaseStatefulRemoteProxyFactory
+ * 
+ * Common base for factories generating remoting-enabled
+ * proxies (ie. remote and clustering)
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
 public abstract class BaseStatefulRemoteProxyFactory extends BaseStatefulProxyFactory implements RemoteProxyFactory
 {
    // Class Members
@@ -84,8 +114,10 @@
    
    // Functional Methods 
    
-   protected boolean bindHomeAndBusinessTogether(SessionContainer container)
+   @Override
+   protected boolean bindHomeAndBusinessTogether()
    {
+      SessionSpecContainer container = this.getContainer();
       String homeJndiName = ProxyFactoryHelper.getHomeJndiName(container);
       String remoteBusinessJndiName = ProxyFactoryHelper.getRemoteBusinessJndiName(container);
       return homeJndiName.equals(remoteBusinessJndiName);

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulClusterProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -49,6 +49,7 @@
 import org.jboss.ha.framework.server.HATarget;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
+import org.jboss.util.NotImplementedException;
 import org.jboss.util.naming.Util;
 
 
@@ -84,6 +85,18 @@
    }
    
    /**
+    * Returns the interface type for Home
+    * 
+    * @return
+    */
+   @Override
+   protected Class<?> getHomeType()
+   {
+      // Not Supported
+      return null;
+   }
+   
+   /**
     * Defines the access type for this Proxies created by this Factory
     * 
     * @return
@@ -93,6 +106,18 @@
       return ProxyAccessType.REMOTE;
    }
    
+   /**
+    * Whether or not to bind the home and business interfaces together
+    * 
+    * @return
+    */
+   @Override
+   protected boolean bindHomeAndBusinessTogether()
+   {
+      // Not Supported
+      return false;
+   }
+   
    protected void validateEjb21Views()
    { 
       // Obtain Container

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulContainer.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -898,9 +898,11 @@
          Class<?> pkClass = Object.class;
          HomeHandleImpl homeHandle = null;
 
-         Remote remoteAnnotation = this.getAnnotation(Remote.class);
-         if (remoteAnnotation != null)
-            remote = remoteAnnotation.value()[0];
+         Class<?>[] remotes = ProxyFactoryHelper.getRemoteInterfaces(this);
+         if (remotes != null && remotes.length > 0)
+         {
+            remote = remotes[0];
+         }
          RemoteHome homeAnnotation = this.getAnnotation(RemoteHome.class);
          if (homeAnnotation != null)
             home = homeAnnotation.value();

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -97,7 +97,8 @@
       {
          container.popContext();
          StatefulBeanContext.currentBean.pop();
-         ejb.setBeanContext(null);
+         // FIXME: the bean context should really be disaccociated, but then the StatefulRemoveInterceptor will fail
+         //ejb.setBeanContext(null);
          synchronized (target)
          {
             target.setInInvocation(false);

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -64,6 +64,17 @@
    {
       super(container, binding.jndiBinding());
    }
+   
+   /**
+    * Returns the interface type for Home
+    * 
+    * @return
+    */
+   @Override
+   protected Class<?> getHomeType()
+   {
+      return ProxyFactoryHelper.getLocalHomeInterface(this.getContainer());
+   }
 
    /**
     * Defines the access type for this Proxies created by this Factory
@@ -89,9 +100,15 @@
 
    }
    
-   protected boolean bindHomeAndBusinessTogether(SessionContainer container)
+   /**
+    * Whether or not to bind the home and business interfaces together
+    * 
+    * @return
+    */
+   @Override
+   protected boolean bindHomeAndBusinessTogether()
    {
-      return ProxyFactoryHelper.getLocalHomeJndiName(container).equals(jndiName);
+      return ProxyFactoryHelper.getLocalHomeJndiName(this.getContainer()).equals(this.jndiName);
    }
 
    public void start() throws Exception
@@ -113,13 +130,13 @@
 
       SessionContainer statefulContainer = (SessionContainer) getContainer();
       LocalHome localHome = this.getContainer().getAnnotation(LocalHome.class);
-      if (localHome != null && !bindHomeAndBusinessTogether(statefulContainer))
+      if (localHome != null && !bindHomeAndBusinessTogether())
       {
          Class<?>[] interfaces =
          {localHome.value()};
-         Object homeProxy = java.lang.reflect.Proxy.newProxyInstance(getContainer().getBeanClass().getClassLoader(),
-               interfaces, new StatefulLocalHomeProxy(getContainer()));
-         Util.rebind(getContainer().getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(getContainer()),
+         Object homeProxy = java.lang.reflect.Proxy.newProxyInstance(statefulContainer.getBeanClass().getClassLoader(),
+               interfaces, new StatefulLocalHomeProxy(statefulContainer));
+         Util.rebind(statefulContainer.getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(statefulContainer),
                homeProxy);
       }
    }
@@ -128,11 +145,11 @@
    {
       super.stop();
       Util.unbind(getContainer().getInitialContext(), jndiName + PROXY_FACTORY_NAME);
-      SessionContainer statefulContainer = (SessionContainer) getContainer();
+      SessionContainer statefulContainer = this.getContainer();
       LocalHome localHome = this.getContainer().getAnnotation(LocalHome.class);
-      if (localHome != null && !bindHomeAndBusinessTogether(statefulContainer))
+      if (localHome != null && !bindHomeAndBusinessTogether())
       {
-         Util.unbind(getContainer().getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(getContainer()));
+         Util.unbind(statefulContainer.getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(statefulContainer));
       }
    }
 

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -85,12 +85,12 @@
       assert !Dispatcher.singleton.isRegistered(targetId) : targetId + " is already registered";
       Dispatcher.singleton.registerTarget(targetId, this);
 
-      SessionContainer statefulContainer = this.getContainer();
+      SessionSpecContainer statefulContainer = this.getContainer();
       RemoteHome remoteHome = statefulContainer.getAnnotation(RemoteHome.class);
-      if (remoteHome != null && !bindHomeAndBusinessTogether(statefulContainer))
+      if (remoteHome != null && !bindHomeAndBusinessTogether())
       {
          Object homeProxy = createHomeProxy(remoteHome.value());
-         String homeJndiName = ProxyFactoryHelper.getHomeJndiName(this.getContainer());
+         String homeJndiName = ProxyFactoryHelper.getHomeJndiName(statefulContainer);
          log.debug("Binding home proxy at " + homeJndiName);
          Util.rebind(this.getContainer().getInitialContext(), homeJndiName, homeProxy);
       }
@@ -104,7 +104,7 @@
       
       SessionContainer statefulContainer = this.getContainer();
       RemoteHome remoteHome = statefulContainer.getAnnotation(RemoteHome.class);
-      if (remoteHome != null && !bindHomeAndBusinessTogether(statefulContainer))
+      if (remoteHome != null && !bindHomeAndBusinessTogether())
       {
          Util.unbind(this.getContainer().getInitialContext(), ProxyFactoryHelper.getHomeJndiName(getContainer()));
       }
@@ -144,7 +144,18 @@
       proxy.setEjbMetaData(getEjbMetaData());
    }
    
+   /**
+    * Returns the interface type for Home
+    * 
+    * @return
+    */
    @Override
+   protected Class<?> getHomeType()
+   {
+      return ProxyFactoryHelper.getRemoteHomeInterface(this.getContainer());
+   }
+   
+   @Override
    String getStackNameInterceptors()
    {
       return StatefulRemoteProxyFactory.STACK_NAME_STATEFUL_SESSION_CLIENT_INTERCEPTORS;

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/BaseStatelessRemoteProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/BaseStatelessRemoteProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/BaseStatelessRemoteProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -69,7 +69,7 @@
    
    // Functional Methods 
    
-   protected boolean bindHomeAndBusinessTogether(SessionContainer container)
+   protected boolean bindHomeAndEjb21ViewTogether(SessionContainer container)
    {
       String homeJndiName = ProxyFactoryHelper.getHomeJndiName(container);
       String remoteBusinessJndiName = ProxyFactoryHelper.getRemoteBusinessJndiName(container);

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessClusterProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -22,16 +22,11 @@
 package org.jboss.ejb3.stateless;
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
-import javax.ejb.RemoteHome;
-
 import org.jboss.aop.AspectManager;
 import org.jboss.aop.advice.AdviceStack;
 import org.jboss.aspects.remoting.FamilyWrapper;
-import org.jboss.ejb3.JBossProxy;
 import org.jboss.ejb3.ProxyFactoryHelper;
 import org.jboss.ejb3.SpecificationInterfaceType;
 import org.jboss.ejb3.annotation.Clustered;
@@ -40,7 +35,6 @@
 import org.jboss.ejb3.remoting.LoadBalancePolicyNotRegisteredException;
 import org.jboss.ejb3.remoting.RemoteProxyFactory;
 import org.jboss.ejb3.remoting.RemoteProxyFactoryRegistry;
-import org.jboss.ejb3.session.SessionContainer;
 import org.jboss.ejb3.session.SessionSpecContainer;
 import org.jboss.ha.client.loadbalance.LoadBalancePolicy;
 import org.jboss.ha.client.loadbalance.RandomRobin;
@@ -50,6 +44,7 @@
 import org.jboss.ha.framework.server.HATarget;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
+import org.jboss.util.NotImplementedException;
 
 
 /**
@@ -153,6 +148,17 @@
       return proxy;
    }
    
+   /**
+    * Whether or not to bind the home and business interfaces together
+    * 
+    * @return
+    */
+   @Override
+   protected boolean bindHomeAndBusinessTogether(){
+      // Not Supported
+      return false;
+   }
+   
    public synchronized void replicantsChanged (String key, 
          List newReplicants, 
          int newReplicantsViewId,
@@ -173,6 +179,19 @@
          log.error(e);
       }
    }
+   
+   /**
+    * Returns the interface type for Home
+    * 
+    * @param container
+    * @return
+    */
+   @Override
+   protected Class<?> getHomeType()
+   {
+      // Not Supported
+      return null;
+   }
 
    @Override
    String getStackNameInterceptors()

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -49,7 +49,19 @@
       super(container, binding.jndiBinding());
    }
    
+   /**
+    * Returns the interface type for Home
+    * 
+    * @param container
+    * @return
+    */
    @Override
+   protected Class<?> getHomeType()
+   {
+      return ProxyFactoryHelper.getLocalHomeInterface(this.getContainer());
+   }
+   
+   @Override
    protected ProxyAccessType getProxyAccessType()
    {
       return ProxyAccessType.LOCAL;
@@ -67,18 +79,24 @@
             .getLocalInterfaces(container));
    }
    
-   protected boolean bindHomeAndBusinessTogether(EJBContainer container)
+   /**
+    * Whether or not to bind the home and business interfaces together
+    * 
+    * @return
+    */
+   @Override
+   protected boolean bindHomeAndBusinessTogether()
    {
-      return ProxyFactoryHelper.getLocalHomeJndiName(container).equals(jndiName);
+      return ProxyFactoryHelper.getLocalHomeJndiName(this.getContainer()).equals(jndiName);
    }
 
    @Override
    public void start() throws Exception
    {
       super.start();
-      EJBContainer statelessContainer = (EJBContainer) getContainer();
+      SessionSpecContainer statelessContainer = getContainer();
       LocalHome localHome = statelessContainer.getAnnotation(LocalHome.class);
-      if (localHome != null && !bindHomeAndBusinessTogether(statelessContainer))
+      if (localHome != null && !bindHomeAndBusinessTogether())
       {
          Class<?>[] interfaces = {localHome.value()};
          Object homeProxy = java.lang.reflect.Proxy.newProxyInstance(getContainer().getBeanClass().getClassLoader(),
@@ -93,7 +111,7 @@
       super.stop();
       SessionSpecContainer statelessContainer = this.getContainer();
       LocalHome localHome = statelessContainer.getAnnotation(LocalHome.class);
-      if (localHome != null && !bindHomeAndBusinessTogether(statelessContainer))
+      if (localHome != null && !bindHomeAndBusinessTogether())
       {
          Util.unbind(getContainer().getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(getContainer()));
       }

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -52,8 +52,15 @@
       super(container, binding);
    }
    
-   protected boolean bindHomeAndBusinessTogether(SessionSpecContainer container)
+   /**
+    * Whether or not to bind the home and business interfaces together
+    * 
+    * @return
+    */
+   @Override
+   protected boolean bindHomeAndBusinessTogether()
    {
+      SessionSpecContainer container = this.getContainer();
       return ProxyFactoryHelper.getHomeJndiName(container).equals(ProxyFactoryHelper.getRemoteBusinessJndiName(container));
    }
 
@@ -66,7 +73,7 @@
    {
       super.start();
       RemoteHome remoteHome = this.getContainer().getAnnotation(RemoteHome.class);
-      if (remoteHome != null && !bindHomeAndBusinessTogether(this.getContainer()))
+      if (remoteHome != null && !bindHomeAndEjb21ViewTogether(this.getContainer()))
       {
          Object homeProxy = createHomeProxy(remoteHome.value());
          String jndiName = ProxyFactoryHelper.getHomeJndiName(getContainer());
@@ -90,7 +97,7 @@
       super.stop();
       SessionSpecContainer statelessContainer = this.getContainer();
       RemoteHome remoteHome = this.getContainer().getAnnotation(RemoteHome.class);
-      if (remoteHome != null && !bindHomeAndBusinessTogether(statelessContainer))
+      if (remoteHome != null && !bindHomeAndEjb21ViewTogether(statelessContainer))
       {
          Util.unbind(getContainer().getInitialContext(), ProxyFactoryHelper.getHomeJndiName(getContainer()));
       }
@@ -119,6 +126,17 @@
          throw new RuntimeException(e);
       }
    }
+   
+   /**
+    * Returns the interface type for Home
+    * 
+    * @return
+    */
+   @Override
+   protected Class<?> getHomeType()
+   {
+      return ProxyFactoryHelper.getRemoteHomeInterface(this.getContainer());
+   }
 
    @Override
    String getStackNameInterceptors()

Deleted: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.stateless;
-
-import javax.ejb.EJBLocalObject;
-import javax.ejb.EJBObject;
-
-import org.jboss.ejb3.session.SessionBeanContext;
-import org.jboss.ejb3.session.SessionContextDelegateBase;
-
-/**
- * StatelessSessionContextDelegate
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- * @param <T>
- */
-public class StatelessSessionContextDelegate extends SessionContextDelegateBase<StatelessContainer>
-{
-
-   public StatelessSessionContextDelegate(SessionBeanContext<StatelessContainer> beanContext)
-   {
-      super(beanContext);
-   }
-   
-   @Override
-   public EJBLocalObject getEJBLocalObject() throws IllegalStateException
-   {
-      try
-      {
-         EJBLocalObject proxy = (EJBLocalObject) container.createProxyLocalEjb21();
-         return proxy;
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException(e);
-      }
-   }
-   
-   @Override
-   public EJBObject getEJBObject() throws IllegalStateException
-   {
-      try
-      {
-         EJBObject proxy = (EJBObject) container.createProxyRemoteEjb21();
-         return proxy;
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException(e);
-      }
-   }
-
-}

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,20 +21,13 @@
  */
 package org.jboss.ejb3.stateless;
 
-import java.io.Serializable;
-import java.security.Identity;
-import java.security.Principal;
-import java.util.Properties;
-
-import javax.ejb.EJBHome;
-import javax.ejb.EJBLocalHome;
 import javax.ejb.EJBLocalObject;
 import javax.ejb.EJBObject;
 import javax.ejb.SessionContext;
-import javax.ejb.TimerService;
-import javax.transaction.UserTransaction;
-import javax.xml.rpc.handler.MessageContext;
 
+import org.jboss.ejb3.session.SessionBeanContext;
+import org.jboss.ejb3.session.SessionContextDelegateBase;
+
 /**
  * A session context that is serializable.
  * 
@@ -44,108 +37,40 @@
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision: 68144 $
  */
-public class StatelessSessionContextImpl implements Serializable, SessionContext
+public class StatelessSessionContextImpl extends SessionContextDelegateBase<StatelessContainer>
+      implements
+         SessionContext
 {
-   private static final long serialVersionUID = 1L;
-
-   private transient SessionContext delegate;
-
-   public StatelessSessionContextImpl(StatelessBeanContext beanContext)
+   public StatelessSessionContextImpl(SessionBeanContext<StatelessContainer> beanContext)
    {
-      assert beanContext != null : "beanContext is null";
-
-      this.delegate = new StatelessSessionContextDelegate(beanContext);
+      super(beanContext);
    }
 
-   public <T> T getBusinessObject(Class<T> businessInterface) throws IllegalStateException
-   {
-      return getDelegate().getBusinessObject(businessInterface);
-   }
-
-   protected SessionContext getDelegate()
-   {
-      return delegate;
-   }
-
+   @Override
    public EJBLocalObject getEJBLocalObject() throws IllegalStateException
    {
-      return getDelegate().getEJBLocalObject();
+      try
+      {
+         EJBLocalObject proxy = (EJBLocalObject) container.createProxyLocalEjb21();
+         return proxy;
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException(e);
+      }
    }
 
+   @Override
    public EJBObject getEJBObject() throws IllegalStateException
    {
-      return getDelegate().getEJBObject();
+      try
+      {
+         EJBObject proxy = (EJBObject) container.createProxyRemoteEjb21();
+         return proxy;
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException(e);
+      }
    }
-
-   public Class<?> getInvokedBusinessInterface() throws IllegalStateException
-   {
-      return getDelegate().getInvokedBusinessInterface();
-   }
-
-   public MessageContext getMessageContext() throws IllegalStateException
-   {
-      return getDelegate().getMessageContext();
-   }
-
-   @SuppressWarnings("deprecation")
-   public Identity getCallerIdentity()
-   {
-      return getDelegate().getCallerIdentity();
-   }
-
-   public Principal getCallerPrincipal()
-   {
-      return getDelegate().getCallerPrincipal();
-   }
-
-   public EJBHome getEJBHome()
-   {
-      return getDelegate().getEJBHome();
-   }
-
-   public EJBLocalHome getEJBLocalHome()
-   {
-      return getDelegate().getEJBLocalHome();
-   }
-
-   public Properties getEnvironment()
-   {
-      return getDelegate().getEnvironment();
-   }
-
-   public boolean getRollbackOnly() throws IllegalStateException
-   {
-      return getDelegate().getRollbackOnly();
-   }
-
-   public TimerService getTimerService() throws IllegalStateException
-   {
-      return getDelegate().getTimerService();
-   }
-
-   public UserTransaction getUserTransaction() throws IllegalStateException
-   {
-      return getDelegate().getUserTransaction();
-   }
-
-   @SuppressWarnings("deprecation")
-   public boolean isCallerInRole(Identity role)
-   {
-      return getDelegate().isCallerInRole(role);
-   }
-
-   public boolean isCallerInRole(String roleName)
-   {
-      return getDelegate().isCallerInRole(roleName);
-   }
-
-   public Object lookup(String name)
-   {
-      return getDelegate().lookup(name);
-   }
-
-   public void setRollbackOnly() throws IllegalStateException
-   {
-      getDelegate().setRollbackOnly();
-   }
 }

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/injection/EJBRemoteHandler.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/injection/EJBRemoteHandler.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/java/org/jboss/injection/EJBRemoteHandler.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -77,8 +77,11 @@
          return;
 
       String mappedName = ref.getMappedName();
-     
-      if (mappedName != null && mappedName.equals("")) mappedName = null;
+      if (mappedName != null && mappedName.equals(""))
+         mappedName = null;
+      // See if the name has been resolved externally
+      if(mappedName == null && ref.getResolvedJndiName() != null)
+         mappedName = ref.getResolvedJndiName();
 
       String link = ref.getLink();
       if (link != null && link.trim().equals("")) link = null;

Modified: projects/ejb3/dev/ejbthree1269/core/src/main/resources/ejb3-interceptors-aop.xml
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/main/resources/ejb3-interceptors-aop.xml	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/main/resources/ejb3-interceptors-aop.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -5,7 +5,7 @@
 
 <aop>
    <interceptor class="org.jboss.aspects.remoting.InvokeRemoteInterceptor" scope="PER_VM"/>
-   <interceptor class="org.jboss.aspects.security.SecurityClientInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.security.client.SecurityClientInterceptor" scope="PER_VM"/>
    <interceptor class="org.jboss.aspects.tx.ClientTxPropagationInterceptor" scope="PER_VM"/>
    <interceptor class="org.jboss.ejb3.remoting.IsLocalInterceptor" scope="PER_VM"/>
    <interceptor class="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor" scope="PER_VM"/>
@@ -15,42 +15,42 @@
 
    <stack name="ServiceClientInterceptors">
       <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
-      <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+      <interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
    </stack>
 
    <stack name="AsynchronousStatelessSessionClientInterceptors">
       <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
-      <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+      <interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
    </stack>
 
    <stack name="AsynchronousStatefulSessionClientInterceptors">
       <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
-      <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+      <interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
    </stack>
 
    <stack name="StatelessSessionClientInterceptors">
       <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
-      <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+      <interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
    </stack>
 
    <stack name="StatefulSessionClientInterceptors">
       <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
-      <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+      <interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
    </stack>
 
    <stack name="ClusteredStatelessSessionClientInterceptors">
       <interceptor-ref name="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor"/>
-      <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+      <interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
@@ -58,7 +58,7 @@
 
    <stack name="ClusteredStatefulSessionClientInterceptors">
       <interceptor-ref name="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor"/>
-      <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+      <interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
       <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>

Modified: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/cachepassivation/MockDeploymentUnit.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/cachepassivation/MockDeploymentUnit.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/cachepassivation/MockDeploymentUnit.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -40,6 +40,19 @@
 public class MockDeploymentUnit implements DeploymentUnit
 {
 
+   public Object addAttachment(String name, Object attachment)
+   {
+      return null;
+   }
+   public Object getAttachment(String name)
+   {
+      return null;
+   }
+   public Object removeAttachment(String name)
+   {
+      return null;
+   }
+
    /* (non-Javadoc)
     * @see org.jboss.ejb3.DeploymentUnit#getClassLoader()
     */
@@ -163,6 +176,12 @@
       return null;
    }
 
+   public String getRelativePath()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
    /* (non-Javadoc)
     * @see org.jboss.ejb3.DeploymentUnit#getUrl()
     */

Copied: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271 (from rev 72289, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271)

Deleted: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree1271;
-
-import javax.ejb.Remote;
-import javax.ejb.RemoteHome;
-import javax.ejb.Stateful;
-
-import org.jboss.ejb3.annotation.RemoteBinding;
-import org.jboss.ejb3.annotation.RemoteHomeBinding;
-
-/**
- * TestBean
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
- at Stateful
- at Remote({TestRemote.class,TestRemoteBusiness.class})
- at RemoteHome(TestRemoteHome.class)
- at RemoteBinding(jndiBinding=TestRemoteBusiness.JNDI_NAME)
- at RemoteHomeBinding(jndiBinding=TestRemoteHome.JNDI_NAME)
-public class TestBean implements TestRemoteBusiness
-{
-   public String test()
-   {
-      return TestRemoteBusiness.RETURN_VALUE;
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java (from rev 72289, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree1271;
+
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Stateful;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+import org.jboss.ejb3.annotation.RemoteHomeBinding;
+
+/**
+ * TestBean
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at Remote({TestRemote.class,TestRemoteBusiness.class})
+ at RemoteHome(TestRemoteHome.class)
+ at RemoteBinding(jndiBinding=TestRemoteBusiness.JNDI_NAME)
+ at RemoteHomeBinding(jndiBinding=TestRemoteHome.JNDI_NAME)
+public class TestBean implements TestRemoteBusiness
+{
+   public String test()
+   {
+      return TestRemoteBusiness.RETURN_VALUE;
+   }
+}

Deleted: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree1271;
-
-import javax.ejb.EJBObject;
-
-/**
- * TestRemote
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public interface TestRemote extends EJBObject, TestRemoteBusiness
-{
-
-}

Copied: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java (from rev 72289, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemote.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree1271;
+
+import javax.ejb.EJBObject;
+
+/**
+ * TestRemote
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestRemote extends EJBObject, TestRemoteBusiness
+{
+
+}

Deleted: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree1271;
-
-/**
- * TestRemoteBusiness
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public interface TestRemoteBusiness
-{
-   String JNDI_NAME = "ALRRemote";
-   
-   String RETURN_VALUE = "test";
-   
-   String test();
-}

Copied: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java (from rev 72289, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteBusiness.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree1271;
+
+/**
+ * TestRemoteBusiness
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestRemoteBusiness
+{
+   String JNDI_NAME = "ALRRemote";
+   
+   String RETURN_VALUE = "test";
+   
+   String test();
+}

Deleted: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree1271;
-
-import java.rmi.RemoteException;
-
-import javax.ejb.CreateException;
-import javax.ejb.EJBHome;
-
-/**
- * TestRemoteHome
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public interface TestRemoteHome extends EJBHome
-{
-   String JNDI_NAME = TestRemoteBusiness.JNDI_NAME;
-   
-   TestRemote create() throws CreateException, RemoteException;
-}

Copied: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java (from rev 72289, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/TestRemoteHome.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree1271;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * TestRemoteHome
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestRemoteHome extends EJBHome
+{
+   String JNDI_NAME = TestRemoteBusiness.JNDI_NAME;
+   
+   TestRemote create() throws CreateException, RemoteException;
+}

Copied: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit (from rev 72289, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit)

Deleted: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree1271.unit;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.ejbthree1271.TestRemote;
-import org.jboss.ejb3.test.ejbthree1271.TestRemoteHome;
-import org.jboss.logging.Logger;
-import org.jboss.test.JBossTestCase;
-
-/**
- * BindHomeAndBusinessTogetherTestCase
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class BindHomeAndBusinessTogetherTestCase extends JBossTestCase
-{
-   private static final Logger log = Logger.getLogger(BindHomeAndBusinessTogetherTestCase.class);
-
-   public BindHomeAndBusinessTogetherTestCase(String name)
-   {
-      super(name);
-   }
- 
-   public void testBindHomeAndBusinessTogether() throws Exception
-   {
-      TestRemoteHome home = (TestRemoteHome) this.getInitialContext().lookup(TestRemoteHome.JNDI_NAME);
-      TestRemote remote = home.create();
-      String returnValue = remote.test();
-      JBossTestCase.assertEquals(TestRemote.RETURN_VALUE, returnValue);
-   }
- 
-   public static Test suite() throws Exception
-   {
-      return getDeploySetup(BindHomeAndBusinessTogetherTestCase.class, "ejbthree1271.jar");
-   }
-}
\ No newline at end of file

Copied: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java (from rev 72289, projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/ejbthree1271/unit/BindHomeAndBusinessTogetherTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree1271.unit;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1271.TestRemote;
+import org.jboss.ejb3.test.ejbthree1271.TestRemoteHome;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * BindHomeAndBusinessTogetherTestCase
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class BindHomeAndBusinessTogetherTestCase extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(BindHomeAndBusinessTogetherTestCase.class);
+
+   public BindHomeAndBusinessTogetherTestCase(String name)
+   {
+      super(name);
+   }
+ 
+   public void testBindHomeAndBusinessTogether() throws Exception
+   {
+      TestRemoteHome home = (TestRemoteHome) this.getInitialContext().lookup(TestRemoteHome.JNDI_NAME);
+      TestRemote remote = home.create();
+      String returnValue = remote.test();
+      JBossTestCase.assertEquals(TestRemote.RETURN_VALUE, returnValue);
+   }
+ 
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(BindHomeAndBusinessTogetherTestCase.class, "ejbthree1271.jar");
+   }
+}
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session21Bean.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session21Bean.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session21Bean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -44,7 +44,7 @@
    {
       try {
          InitialContext jndiContext = new InitialContext();
-         Session30 session = (Session30)jndiContext.lookup(Container.ENC_CTX_NAME + "/env/Session30");
+         Session30RemoteBusiness session = (Session30RemoteBusiness)jndiContext.lookup(Container.ENC_CTX_NAME + "/env/Session30");
          return session.access();
       } catch (Exception e)
       {

Modified: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/MultiDeployTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/MultiDeployTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/MultiDeployTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -53,7 +53,7 @@
    {
       InitialContext jndiContext = new InitialContext();
       
-      Test3 test3 = (Test3)jndiContext.lookup("Test3Remote");
+      Test3Business test3 = (Test3Business)jndiContext.lookup("Test3Remote");
       assertNotNull(test3);
       test3.testAccess();
       
@@ -66,6 +66,6 @@
    
    public static Test suite() throws Exception
    {
-      return getDeploySetup(MultiDeployTestCase.class, "multideploy.jar, multideploy-ejb3.jar");
+      return getDeploySetup(MultiDeployTestCase.class, "multideploy.ear");
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -333,7 +333,7 @@
       
       EJBMetaData metadata = home.getEJBMetaData();
       assertNotNull(metadata);
-      assertEquals("org.jboss.ejb3.test.reference21_30.Session30",metadata.getRemoteInterfaceClass().getName());
+      assertEquals(Session30.class.getName(),metadata.getRemoteInterfaceClass().getName());
       
       HomeHandle homeHandle = home.getHomeHandle();
       assertNotNull(homeHandle);
@@ -342,7 +342,7 @@
       assertNotNull(ejbHome);
       metadata = ejbHome.getEJBMetaData();
       assertNotNull(metadata);
-      assertEquals("org.jboss.ejb3.test.reference21_30.Session30",metadata.getRemoteInterfaceClass().getName());
+      assertEquals(Session30.class.getName(),metadata.getRemoteInterfaceClass().getName());
       
       Session30 session = (Session30)home.create();
       assertNotNull(session);

Modified: projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/threadlocal/MockBeanContext.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/threadlocal/MockBeanContext.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/core/src/test/java/org/jboss/ejb3/test/threadlocal/MockBeanContext.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -92,6 +92,14 @@
    }
 
    /* (non-Javadoc)
+    * @see org.jboss.ejb3.interceptors.container.BeanContext#getInterceptor(java.lang.Class)
+    */
+   public Object getInterceptor(Class<?> interceptorClass) throws IllegalArgumentException
+   {
+      throw new IllegalArgumentException("NOP");
+   }
+   
+   /* (non-Javadoc)
     * @see org.jboss.ejb3.interceptors.container.BeanContext#getInterceptors()
     */
    public Object[] getInterceptors()

Modified: projects/ejb3/dev/ejbthree1269/ext-api/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/ext-api/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/ext-api/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,12 +1,12 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
-  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
-  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/ext-api/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/ext-api/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/ext-api/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<projectDescription>
-  <name>jboss-ejb3-ext-api</name>
-  <comment>JBoss EJB 3.0 API for Bean Providers</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-ext-api</name>
+  <comment>JBoss EJB 3.0 API for Bean Providers</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/ext-api-impl/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/ext-api-impl/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/ext-api-impl/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
-  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
-  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/ejb3/jboss-ejb3-ext-api/0.3/jboss-ejb3-ext-api-0.3.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/ejb3/jboss-ejb3-ext-api/0.3/jboss-ejb3-ext-api-0.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/ext-api-impl/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/ext-api-impl/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/ext-api-impl/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<projectDescription>
-  <name>jboss-ejb3-ext-api-impl</name>
-  <comment>JBoss EJB 3.0 Implementation Internals conforming to API</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-ext-api-impl</name>
+  <comment>JBoss EJB 3.0 Implementation Internals conforming to API</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/injection/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/injection/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/injection/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,25 +1,26 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
-  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar"/>
-  <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR7/jboss-aop-2.0.0.CR7.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.4.GA/jboss-common-core-2.2.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta9/jboss-container-2.0.0.Beta9.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.2.GA/jboss-logging-spi-2.0.2.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR4/jbossxb-2.0.0.CR4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6/qdox-1.6.jar"/>
-  <classpathentry kind="var" path="M2_REPO/trove/trove/1.0.2/trove-1.0.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar" sourcepath="M2_REPO/ant/ant/1.6.5/ant-1.6.5-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA.jar" sourcepath="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR7/jboss-aop-2.0.0.CR7.jar" sourcepath="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR7/jboss-aop-2.0.0.CR7-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta9/jboss-container-2.0.0.Beta9.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta9/jboss-container-2.0.0.Beta9-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.3.GA/jboss-logging-spi-2.0.3.GA.jar" sourcepath="M2_REPO/jboss/jboss-logging-spi/2.0.3.GA/jboss-logging-spi-2.0.3.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR4/jbossxb-2.0.0.CR4.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.0.CR4/jbossxb-2.0.0.CR4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6/qdox-1.6.jar" sourcepath="M2_REPO/qdox/qdox/1.6/qdox-1.6-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/trove/trove/1.0.2/trove-1.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/injection/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/injection/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/injection/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<projectDescription>
-  <name>jboss-ejb3-injection</name>
-  <comment>JBoss POJO Injection Framework</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-injection</name>
+  <comment>JBoss POJO Injection Framework</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/installer/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/installer/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/installer/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,8 +1,8 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/ant/ant/1.5/ant-1.5.jar"/>
-  <classpathentry kind="var" path="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/ant/ant/1.5/ant-1.5.jar"/>
+  <classpathentry kind="var" path="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2.jar" sourcepath="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2-sources.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/installer/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/installer/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/installer/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<projectDescription>
-  <name>jboss-ejb3-installer</name>
-  <comment>Installer to patch existing JBoss AS 5.0.x Installation w/ EJB3 Plugin</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-installer</name>
+  <comment>Installer to patch existing JBoss AS 5.0.x Installation w/ EJB3 Plugin</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/interceptors/pom.xml
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/pom.xml	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/pom.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.jboss.ejb3</groupId>
     <artifactId>jboss-ejb3-build</artifactId>
-    <version>0.13.1-SNAPSHOT</version>
+    <version>0.13.3-SNAPSHOT</version>
     <relativePath>../build/pom.xml</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
@@ -69,6 +69,11 @@
       <artifactId>jboss-aop</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.jboss.aspects</groupId>
+      <artifactId>jboss-aspects-common</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.jboss.javaee</groupId>
       <artifactId>jboss-ejb-api</artifactId>
     </dependency>

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorInterceptor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorInterceptor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -66,19 +66,8 @@
 
    public Object invoke(Invocation invocation) throws Throwable
    {
-      // TODO: speed up
-      Object interceptors[] = ContainerMethodInvocation.getContainerMethodInvocation(invocation).getBeanContext().getInterceptors();
-      if(interceptors != null)
-      {
-         for(Object interceptor : interceptors)
-         {
-            if(interceptor.getClass().equals(interceptorClass))
-               return invoke(interceptor, invocation);
-         }
-      }
-      //throw new IllegalStateException("Can't find an interceptor instance for " + interceptorClass + " among " + Arrays.toString(instances));
-      // The business method interceptor method interceptor only exists when there is an aroundInvoke
-      return invocation.invokeNext();
+      Object interceptor = ContainerMethodInvocation.getContainerMethodInvocation(invocation).getBeanContext().getInterceptor(interceptorClass);
+      return invoke(interceptor, invocation);
    }
 
    private Object invoke(Object interceptor, final Invocation invocation) throws Throwable

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorsInterceptor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorsInterceptor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/EJB3InterceptorsInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.interceptors.aop;
-
-import java.util.List;
-
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
-
-/**
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public class EJB3InterceptorsInterceptor implements Interceptor
-{
-   public EJB3InterceptorsInterceptor(List<Class<?>> applicableInterceptorClasses)
-   {
-      // TODO Auto-generated constructor stub
-   }
-   
-   public String getName()
-   {
-      return EJB3InterceptorsInterceptor.class.getName();
-   }
-
-   public Object invoke(Invocation invocation) throws Throwable
-   {
-      ContainerMethodInvocation.getContainerMethodInvocation(invocation).getBeanContext().getInterceptors();
-      return null;
-   }
-}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InjectInterceptorsFactory.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InjectInterceptorsFactory.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/InjectInterceptorsFactory.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -86,14 +86,18 @@
             AbstractContainer<?, ?> container = AbstractContainer.getContainer(advisor);
             List<Class<?>> interceptorClasses = container.getInterceptorRegistry().getApplicableInterceptorClasses(method);
             List<Interceptor> interceptors = new ArrayList<Interceptor>();
-            for(Class<?> interceptorClass : interceptorClasses)
+            if (interceptorClasses != null)
             {
-               ExtendedAdvisor interceptorAdvisor = ExtendedAdvisorHelper.getExtendedAdvisor(advisor);
-               for(Method interceptorMethod : ClassHelper.getAllMethods(interceptorClass))
+               for (Class<?> interceptorClass : interceptorClasses)
                {
-                  if(interceptorAdvisor.isAnnotationPresent(interceptorClass, interceptorMethod, AroundInvoke.class))
+                  ExtendedAdvisor interceptorAdvisor = ExtendedAdvisorHelper.getExtendedAdvisor(advisor);
+                  for (Method interceptorMethod : ClassHelper.getAllMethods(interceptorClass))
                   {
-                     interceptors.add(new EJB3InterceptorInterceptor(interceptorClass, interceptorMethod));
+                     if (interceptorAdvisor
+                           .isAnnotationPresent(interceptorClass, interceptorMethod, AroundInvoke.class))
+                     {
+                        interceptors.add(new EJB3InterceptorInterceptor(interceptorClass, interceptorMethod));
+                     }
                   }
                }
             }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/LifecycleCallbacks.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/LifecycleCallbacks.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/LifecycleCallbacks.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -43,13 +43,11 @@
    public static Interceptor[] createLifecycleCallbackInterceptors(Advisor advisor, List<Class<?>> lifecycleInterceptorClasses, BeanContext<?> component, Class<? extends Annotation> lifecycleAnnotationType) throws Exception
    {
       List<Interceptor> interceptors = new ArrayList<Interceptor>();
-      Object ejb3Interceptors[] = component.getInterceptors();
-      for(Object interceptor : ejb3Interceptors)
+      // 12.7 footnote 57: ignore method level interceptors
+      // The lifecycle callbacks on the interceptors must be invoked in order
+      for(Class<?> interceptorClass : lifecycleInterceptorClasses)
       {
-         // 12.7 footnote 57: ignore method level interceptors
-         Class<?> interceptorClass = interceptor.getClass();
-         if(!lifecycleInterceptorClasses.contains(interceptorClass))
-            continue;
+         Object interceptor = component.getInterceptor(interceptorClass);
          ExtendedAdvisor interceptorAdvisor = ExtendedAdvisorHelper.getExtendedAdvisor(advisor, interceptor);
          for(Method interceptorMethod : ClassHelper.getAllMethods(interceptorClass))
          {
@@ -59,6 +57,8 @@
             }
          }
       }
+      
+      // Bean lifecycle callbacks
       Class<?> beanClass = advisor.getClazz();
       for(Method beanMethod : ClassHelper.getAllMethods(beanClass))
       {
@@ -67,6 +67,7 @@
             interceptors.add(new LifecycleCallbackBeanMethodInterceptor(beanMethod));
          }
       }
+      
       interceptors.add(0, PerVmAdvice.generateInterceptor(null, new InvocationContextInterceptor(), "setup"));
       
       return interceptors.toArray(new Interceptor[0]);

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/ManagedObjectAdvisorInstanceInterceptor.java (from rev 72289, projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/ManagedObjectAdvisorInstanceInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/ManagedObjectAdvisorInstanceInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/aop/ManagedObjectAdvisorInstanceInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,98 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.interceptors.aop;
+
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.InstanceAdvisorDelegate;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.ejb3.interceptors.container.ManagedObjectAdvisor;
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ManagedObjectAdvisorInstanceInterceptor implements Interceptor
+{
+   Logger log = Logger.getLogger(ManagedObjectAdvisorInstanceInterceptor.class);
+   
+   private Map<Object, InstanceAdvisorDelegate> instanceAdvisorDelegates;
+   
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      @SuppressWarnings("unchecked")
+      ManagedObjectAdvisor advisor = (ManagedObjectAdvisor)invocation.getAdvisor();
+
+      InstanceAdvisorDelegate delegate = getInstanceAdvisorDelegate(invocation.getTargetObject(), advisor, advisor);
+      try
+      {
+         log.debug("Pushing ia delegate " + delegate + " for " + invocation.getTargetObject());
+         advisor.pushThreadedInstanceAdvisorDelegate(delegate);
+         return invocation.invokeNext();
+      }
+      finally
+      {
+         advisor.popThreadedInstanceAdvisorDelegate();
+      }
+   }
+   
+   private InstanceAdvisorDelegate getInstanceAdvisorDelegate(Object target, Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      if (instanceAdvisorDelegates == null)
+      {
+         instanceAdvisorDelegates = new WeakHashMap<Object, InstanceAdvisorDelegate>();
+      }
+      
+      if (target == null)
+      {
+         throw new RuntimeException("Attempt to get instance advisor without having an instance");
+      }
+      
+      InstanceAdvisorDelegate instanceAdvisorDelegate = instanceAdvisorDelegates.get(target);
+      
+      
+      if(instanceAdvisorDelegate != null)
+         return instanceAdvisorDelegate;
+
+      synchronized (this)
+      {
+         if(instanceAdvisorDelegate == null)
+         {
+            instanceAdvisorDelegate = new InstanceAdvisorDelegate(advisor, instanceAdvisor);
+            instanceAdvisorDelegate.initialize();
+            instanceAdvisorDelegates.put(target, instanceAdvisorDelegate);
+         }
+      }
+      return instanceAdvisorDelegate;
+   }
+}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/AbstractContainer.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/AbstractContainer.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/AbstractContainer.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -147,7 +147,7 @@
       initializeAdvisor(name, domain, beanClass, null);
    }
    
-   protected void initializeAdvisor(String name, Domain domain, Class<? extends T> beanClass, AnnotationRepository annotations)
+   protected final void initializeAdvisor(String name, Domain domain, Class<? extends T> beanClass, AnnotationRepository annotations)
    {
       if(this.advisor != null) throw new IllegalStateException("advisor already set to " + advisor);
       
@@ -157,11 +157,21 @@
       
       // Decouple setting the advisor and initializing it, so interceptors
       // can get it.
-      this.advisor = new ManagedObjectAdvisor<T, C>((C) this, name, domain, annotations);
+      createAndSetAdvisor(name, domain, beanClass, annotations);
       advisor.getAnnotations().addClassAnnotation(InterceptorFactoryRef.class, new InterceptorFactoryRefImpl(ContainerInterceptorFactory.class));
       advisor.initialize(beanClass);
    }
    
+   protected final void createAndSetAdvisor(String name, Domain domain, Class<? extends T> beanClass, AnnotationRepository annotations)
+   {
+      this.advisor = createAdvisor(name, domain, beanClass, annotations);
+   }
+   
+   protected ManagedObjectAdvisor<T, C> createAdvisor(String name, Domain domain, Class<? extends T> beanClass, AnnotationRepository annotations)
+   {
+      return new ManagedObjectAdvisor<T, C>((C) this, name, domain, annotations); 
+   }
+   
    protected final ManagedObjectAdvisor<T, C> getAdvisor()
    {
       if(advisor == null) throw new IllegalStateException("advisor has not been initialized");

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/BeanContext.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/BeanContext.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/BeanContext.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -30,7 +30,17 @@
  */
 public interface BeanContext<T>
 {
+   /**
+    * @return the bean instance
+    */
    T getInstance();
    
-   Object[] getInterceptors();
+   /**
+    * Get the EJB3 interceptor of a certain type.
+    *  
+    * @param interceptorClass   the interceptor type to get
+    * @return   the interceptor
+    * @throws IllegalArgumentException  if no interceptor of that class is associated
+    */
+   Object getInterceptor(Class<?> interceptorClass) throws IllegalArgumentException;
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/DummyBeanContext.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/DummyBeanContext.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/DummyBeanContext.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.interceptors.container;
 
+import java.util.LinkedHashMap;
 import java.util.List;
 
 /**
@@ -30,7 +31,8 @@
 public class DummyBeanContext<T> implements BeanContext<T>
 {
    private T instance;
-   private Object interceptors[];
+   private Object[] interceptors;
+   private LinkedHashMap<Class<?>, Object> interceptorsMap = new LinkedHashMap<Class<?>, Object>();
    
    public DummyBeanContext(T instance, List<Object> interceptors)
    {
@@ -38,6 +40,8 @@
       assert interceptors != null : "interceptors is null";
       this.instance = instance;
       this.interceptors = interceptors.toArray(new Object[0]);
+      for(Object interceptor : interceptors)
+         this.interceptorsMap.put(interceptor.getClass(), interceptor);
    }
    
    public T getInstance()
@@ -45,9 +49,16 @@
       return instance;
    }
 
+   public Object getInterceptor(Class<?> interceptorClass) throws IllegalArgumentException
+   {
+      Object interceptor = interceptorsMap.get(interceptorClass);
+      if(interceptor == null)
+         throw new IllegalArgumentException("No interceptor found for " + interceptorClass + " in " + this);
+      return interceptor;
+   }
+
    public Object[] getInterceptors()
    {
       return interceptors;
    }
-
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/ManagedObjectAdvisor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/ManagedObjectAdvisor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/container/ManagedObjectAdvisor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -43,6 +43,7 @@
 import org.jboss.aop.metadata.SimpleMetaData;
 import org.jboss.ejb3.interceptors.ManagedObject;
 import org.jboss.ejb3.interceptors.aop.ExtendedAdvisor;
+import org.jboss.ejb3.interceptors.util.ThreadLocalStack;
 import org.jboss.ejb3.metadata.annotation.ExtendedAnnotationRepository;
 import org.jboss.logging.Logger;
 
@@ -52,7 +53,7 @@
  * - there is always an instance advisor delegate
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public class ManagedObjectAdvisor<T, C extends AbstractContainer<T, C>> extends ClassAdvisor implements ExtendedAdvisor, InstanceAdvisor
 {
@@ -61,6 +62,10 @@
    private C container;
    private InstanceAdvisorDelegate instanceAdvisorDelegate;
    
+   /** The instance advisor delegate set per invocation should be maintained per thread, not globally */ 
+   private ThreadLocalStack<InstanceAdvisorDelegate> threadedInstanceAdvisorDelegateStack;
+   
+   
    protected ManagedObjectAdvisor(C container, String name, AspectManager manager)
    {
       this(container, name, manager, null);
@@ -181,6 +186,15 @@
     */
    private final InstanceAdvisorDelegate getInstanceAdvisorDelegate()
    {
+      if (threadedInstanceAdvisorDelegateStack != null)
+      {
+         InstanceAdvisorDelegate delegate = threadedInstanceAdvisorDelegateStack.get();
+         if (delegate != null)
+         {
+            return delegate;
+         }
+      }
+      
       if(instanceAdvisorDelegate != null)
          return instanceAdvisorDelegate;
 
@@ -195,7 +209,24 @@
       return instanceAdvisorDelegate;
    }
    
+   public final void pushThreadedInstanceAdvisorDelegate(InstanceAdvisorDelegate delegate)
+   {
+      if (threadedInstanceAdvisorDelegateStack == null)
+      {
+         threadedInstanceAdvisorDelegateStack = new ThreadLocalStack<InstanceAdvisorDelegate>();
+      }
+      threadedInstanceAdvisorDelegateStack.push(delegate);
+   }
    
+   public final InstanceAdvisorDelegate popThreadedInstanceAdvisorDelegate()
+   {
+      if (threadedInstanceAdvisorDelegateStack == null)
+      {
+         return null;
+      }
+      return threadedInstanceAdvisorDelegateStack.pop();
+   }
+   
    public void appendInterceptor(Interceptor interceptor)
    {
       throw new RuntimeException("NYI");

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/registry/InterceptorRegistry.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/registry/InterceptorRegistry.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/registry/InterceptorRegistry.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -94,6 +94,12 @@
    
    private void initialize()
    {
+      // The lifecycle interceptor classes are: 
+      // 1. the interceptors listed in an interceptor-order
+      // or
+      // 2. default interceptor + class interceptors
+      // where set 1 = set 2 + optionally extra interceptors
+      
       DefaultInterceptors defaultInterceptorsAnnotation = (DefaultInterceptors) advisor.resolveAnnotation(DefaultInterceptors.class);
       List<Class<?>> defaultInterceptorClasses = new ArrayList<Class<?>>();
       if(defaultInterceptorsAnnotation != null)
@@ -102,7 +108,8 @@
             defaultInterceptorClasses.add(defaultInterceptorClass);
       }
       log.debug("Found default interceptors " + defaultInterceptorClasses);
-      interceptorClasses.addAll(defaultInterceptorClasses);
+//      interceptorClasses.addAll(defaultInterceptorClasses);
+      List<Class<?>> lifecycleInterceptorClasses = new ArrayList<Class<?>>();
       lifecycleInterceptorClasses.addAll(defaultInterceptorClasses);
       
       Interceptors interceptorsAnnotation = (Interceptors) advisor.resolveAnnotation(Interceptors.class);
@@ -112,14 +119,32 @@
          for(Class<?> classInterceptorClass : interceptorsAnnotation.value())
          {
             classInterceptorClasses.add(classInterceptorClass);
-            if(!interceptorClasses.contains(classInterceptorClass))
-               interceptorClasses.add(classInterceptorClass);
+//            if(!interceptorClasses.contains(classInterceptorClass))
+//               interceptorClasses.add(classInterceptorClass);
             if(!lifecycleInterceptorClasses.contains(classInterceptorClass))
                lifecycleInterceptorClasses.add(classInterceptorClass);
          }
       }
       log.debug("Found class interceptors " + classInterceptorClasses);
       
+      {
+         // Ordering of lifecycle interceptors
+         InterceptorOrder order = (InterceptorOrder) advisor.resolveAnnotation(InterceptorOrder.class);
+         if(order != null)
+         {
+            List<Class<?>> orderedInterceptorClasses = Arrays.asList(order.value());
+            if(!orderedInterceptorClasses.containsAll(lifecycleInterceptorClasses))
+               throw new IllegalStateException("EJB3 12.8.2 footnote 59: all applicable lifecycle interceptors must be listed in the interceptor order");
+            lifecycleInterceptorClasses = orderedInterceptorClasses;
+         }
+      }
+      this.lifecycleInterceptorClasses.addAll(lifecycleInterceptorClasses);
+      for(Class<?> interceptorClass : lifecycleInterceptorClasses)
+      {
+         if(!interceptorClasses.contains(interceptorClass))
+            interceptorClasses.add(interceptorClass);
+      }
+      
       Class<?> beanClass = advisor.getClazz();
       for(Method beanMethod : ClassHelper.getAllMethods(beanClass))
       {
@@ -128,11 +153,7 @@
          if(interceptorsAnnotation != null)
          {
             for(Class<?> interceptorClass : interceptorsAnnotation.value())
-            {
                methodInterceptorClasses.add(interceptorClass);
-               if(!interceptorClasses.contains(interceptorClass))
-                  interceptorClasses.add(interceptorClass);
-            }
          }
          
          // Interceptors applicable for this bean method
@@ -152,9 +173,19 @@
             order = (InterceptorOrder) advisor.resolveAnnotation(InterceptorOrder.class);
          // TODO: validate the order to see if all interceptors are listed
          if(order != null)
-            applicableInterceptorClasses.put(beanMethod, Arrays.asList(order.value()));
-         else
-            applicableInterceptorClasses.put(beanMethod, methodApplicableInterceptorClasses);
+         {
+            List<Class<?>> orderedInterceptorClasses = Arrays.asList(order.value());
+            if(!orderedInterceptorClasses.containsAll(methodApplicableInterceptorClasses))
+               throw new IllegalStateException("EJB3 12.8.2 footnote 59: all applicable method interceptors must be listed in the interceptor order");
+            methodApplicableInterceptorClasses = orderedInterceptorClasses;
+         }
+         applicableInterceptorClasses.put(beanMethod, methodApplicableInterceptorClasses);
+         
+         for(Class<?> interceptorClass : methodApplicableInterceptorClasses)
+         {
+            if(!interceptorClasses.contains(interceptorClass))
+               interceptorClasses.add(interceptorClass);
+         }
       }
    }
    

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/util/ThreadLocalStack.java (from rev 72289, projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/util/ThreadLocalStack.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/util/ThreadLocalStack.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/main/java/org/jboss/ejb3/interceptors/util/ThreadLocalStack.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.interceptors.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 61136 $
+ */
+public class ThreadLocalStack<T>
+{
+   private ThreadLocal<ArrayList<T>> stack = new ThreadLocal<ArrayList<T>>();
+
+   public void push(T obj)
+   {
+      ArrayList<T> list = stack.get();
+      if (list == null)
+      {
+         list = new ArrayList<T>(1);
+         stack.set(list);
+      }
+      list.add(obj);
+   }
+
+   public T pop()
+   {
+      ArrayList<T> list = stack.get();
+      if (list == null)
+      {
+         return null;
+      }
+      T rtn = list.remove(list.size() - 1);
+      if (list.size() == 0)
+      {
+         stack.set(null);
+         list.clear();
+      }
+      return rtn;
+   }
+
+   public T get()
+   {
+      ArrayList<T> list = (ArrayList<T>)stack.get();
+      if (list == null)
+      {
+         return null;
+      }
+      return list.get(list.size() - 1);
+   }
+
+   public List<T> getList()
+   {
+      return stack.get();     
+   }
+}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/additive/unit/AdditiveTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/additive/unit/AdditiveTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/additive/unit/AdditiveTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -27,8 +27,7 @@
 
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.container.BeanContext;
 import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
 import org.jboss.ejb3.interceptors.metadata.AdditiveBeanInterceptorMetaDataBridge;
@@ -112,23 +111,34 @@
       };
    }
 
+   
+   // FIXME: use the right jboss-aop.xml
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test() throws Throwable
    {
-      AspectManager.verbose = true;
+      log.info("======= Additive.test()");
+//      AspectManager.verbose = true;
       
       // To make surefire happy
       Thread.currentThread().setContextClassLoader(MySessionBean.class.getClassLoader());
       
-      // Bootstrap AOP
-      // FIXME: use the right jboss-aop.xml
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-      
       // Bootstrap metadata
       UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
       Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
-      url = Thread.currentThread().getContextClassLoader().getResource("additive/META-INF/ejb-jar.xml");
+      URL url = Thread.currentThread().getContextClassLoader().getResource("additive/META-INF/ejb-jar.xml");
       assertNotNull("no ejb-jar.xml", url);
       EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
       JBoss50MetaData jbossMetaData = new JBoss50MetaData();
@@ -150,5 +160,7 @@
       expected.add(MySessionBean.class);
       
       assertEquals(expected, visits);
+
+      log.info("======= Done");
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunner.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunner.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunner.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -29,6 +29,7 @@
 import org.jboss.ejb3.test.interceptors.basic.BasicBean;
 import org.jboss.ejb3.test.interceptors.basic.BasicInterceptor;
 import org.jboss.ejb3.test.interceptors.basic.BasicMethodInterceptor;
+import org.jboss.logging.Logger;
 
 /**
  * This one must run within a domain class loader.
@@ -40,8 +41,11 @@
  */
 public class BasicTestRunner extends TestCase
 {
+   private static final Logger log = Logger.getLogger(BasicTestRunner.class);
+
    public void test2() throws Exception
    {
+      log.info("======= Basic.test2()");
       assertEquals(0, BasicInterceptor.postConstructs);
       
       BasicBean bean = new BasicBean();
@@ -69,10 +73,12 @@
       
       //((Destructable) bean)._preDestroy();
       bean = null;
+      log.info("======= Done");
    }
    
    public void testInstances() throws Exception
    {
+      log.info("======= Basic.testInstances()");
       BasicBean bean1 = new BasicBean();
       BasicBean bean2 = new BasicBean();
       
@@ -81,5 +87,6 @@
       
       assertEquals(1, bean1.getState());
       assertEquals(2, bean2.getState());
+      log.info("======= Done");
    }
 }

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunnerWrapper.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunnerWrapper.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunnerWrapper.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestRunnerWrapper.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.basic.unit;
+
+import java.lang.reflect.Method;
+
+import junit.framework.TestCase;
+
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BasicTestRunnerWrapper extends TestCase
+{
+   private static final Logger log = Logger.getLogger(BasicTestRunnerWrapper.class);
+
+   private static BasicTestSetup setup;
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      if (setup == null)
+      {
+         //We only want to set the classloader and deploy the aop stuff once
+         setup = new BasicTestSetup();
+         setup.setUp();
+      }
+   }
+
+   public void test2() throws Exception
+   {
+      Method m = setup.getRunner().getClass().getMethod("test2");
+      m.invoke(setup.getRunner());
+   }
+   
+   public void testInstances() throws Exception
+   {
+      Method m = setup.getRunner().getClass().getMethod("testInstances");
+      m.invoke(setup.getRunner());
+   }
+
+}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSetup.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSetup.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSetup.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSetup.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,113 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.basic.unit;
+
+import java.net.URL;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aop.Domain;
+import org.jboss.aop.DomainDefinition;
+import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
+import org.jboss.ejb3.interceptors.aop.DomainClassLoader;
+import org.jboss.ejb3.interceptors.lang.ScopedClassLoader;
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BasicTestSetup
+{
+   private static final Logger log = Logger.getLogger(BasicTestSetup.class);
+
+   Object runner = null;
+
+   public BasicTestSetup() throws Exception
+   {
+      log.info("BasicTestSetup constructor");
+   }
+   
+   public void setUp() throws Exception
+   {
+      log.info("===== Setting up");
+      
+      // Neat trick to find the deployment URL
+      // We can't use '.' as resource, because on some machines the classpath order is different,
+      // so we might get target/classes instead of target/test-classes.
+      String resourceName = "log4j.xml";
+      String spec = getClass().getClassLoader().getResource(resourceName).toString();
+      URL deploymentURL = new URL(spec.substring(0, spec.length() - resourceName.length()));
+      log.info(deploymentURL);
+      ScopedClassLoader deploymentClassLoader = new ScopedClassLoader(new URL[] { deploymentURL });
+
+      // Bootstrap AOP
+      URL url = Thread.currentThread().getContextClassLoader().getResource("basic/jboss-aop.xml");
+      log.info("deploying AOP from " + url);
+      AspectXmlLoader.deployXML(url);
+
+      // Bootstrap the basic container
+      String containerName = "InterceptorContainer";
+      
+      DomainDefinition domainDefinition = AspectManager.instance().getContainer(containerName);
+      if(domainDefinition == null)
+         throw new IllegalArgumentException("Domain definition for container '" + containerName + "' can not be found");
+      
+      final Domain domain = (Domain) domainDefinition.getManager();
+      
+      ClassLoader classLoader = new DomainClassLoader(Thread.currentThread().getContextClassLoader(), deploymentClassLoader, domain);
+      Thread.currentThread().setContextClassLoader(classLoader);
+      
+      // The moment an instrumented class comes up it does AspectManager.instance(classLoader), which
+      // should return the classLoader created above. So we tie in a class loader scoping policy.
+      // Note that this won't work in AS.
+      AOPClassLoaderScopingPolicy classLoaderScopingPolicy = new AOPClassLoaderScopingPolicy() {
+         public Domain getDomain(ClassLoader classLoader, AspectManager parent)
+         {
+            //log.debug("getDomain");
+            if(classLoader instanceof DomainClassLoader)
+               return ((DomainClassLoader) classLoader).getDomain();
+            return null;
+         }
+
+         public Domain getTopLevelDomain(AspectManager parent)
+         {
+            throw new RuntimeException("NYI");
+         }
+
+         public boolean isScoped(ClassLoader classLoader)
+         {
+            throw new RuntimeException("NYI");
+         }
+      };
+      AspectManager.setClassLoaderScopingPolicy(classLoaderScopingPolicy);
+      
+      runner = classLoader.loadClass("org.jboss.ejb3.test.interceptors.basic.unit.BasicTestRunner").newInstance();
+      log.info("===== Done setting up");
+   }
+   
+   public Object getRunner()
+   {
+      return runner;
+   }
+}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSuite.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSuite.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/basic/unit/BasicTestSuite.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,19 +21,9 @@
  */
 package org.jboss.ejb3.test.interceptors.basic.unit;
 
-import java.net.URL;
-
 import junit.framework.Test;
-import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.AspectXmlLoader;
-import org.jboss.aop.Domain;
-import org.jboss.aop.DomainDefinition;
-import org.jboss.aop.classpool.AOPClassLoaderScopingPolicy;
-import org.jboss.ejb3.interceptors.aop.DomainClassLoader;
-import org.jboss.ejb3.interceptors.lang.ScopedClassLoader;
 import org.jboss.logging.Logger;
 
 /**
@@ -45,97 +35,11 @@
 public class BasicTestSuite extends TestSuite
 {
    private static final Logger log = Logger.getLogger(BasicTestSuite.class);
-   
-   private ClassLoader classLoader;
-   
-   public BasicTestSuite() throws Exception
-   {
-      // Neat trick to find the deployment URL
-      // We can't use '.' as resource, because on some machines the classpath order is different,
-      // so we might get target/classes instead of target/test-classes.
-      String resourceName = "log4j.xml";
-      String spec = getClass().getClassLoader().getResource(resourceName).toString();
-      URL deploymentURL = new URL(spec.substring(0, spec.length() - resourceName.length()));
-      log.info(deploymentURL);
-      ScopedClassLoader deploymentClassLoader = new ScopedClassLoader(new URL[] { deploymentURL });
-
-      // Bootstrap AOP
-      URL url = Thread.currentThread().getContextClassLoader().getResource("basic/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-
-      // Bootstrap the basic container
-      String containerName = "InterceptorContainer";
       
-      DomainDefinition domainDefinition = AspectManager.instance().getContainer(containerName);
-      if(domainDefinition == null)
-         throw new IllegalArgumentException("Domain definition for container '" + containerName + "' can not be found");
-      
-      final Domain domain = (Domain) domainDefinition.getManager();
-      
-      this.classLoader = new DomainClassLoader(Thread.currentThread().getContextClassLoader(), deploymentClassLoader, domain);
-      Thread.currentThread().setContextClassLoader(classLoader);
-      
-      // The moment an instrumented class comes up it does AspectManager.instance(classLoader), which
-      // should return the classLoader created above. So we tie in a class loader scoping policy.
-      // Note that this won't work in AS.
-      AOPClassLoaderScopingPolicy classLoaderScopingPolicy = new AOPClassLoaderScopingPolicy() {
-         public Domain getDomain(ClassLoader classLoader, AspectManager parent)
-         {
-            //log.debug("getDomain");
-            if(classLoader instanceof DomainClassLoader)
-               return ((DomainClassLoader) classLoader).getDomain();
-            return null;
-         }
-
-         public Domain getTopLevelDomain(AspectManager parent)
-         {
-            throw new RuntimeException("NYI");
-         }
-
-         public boolean isScoped(ClassLoader classLoader)
-         {
-            throw new RuntimeException("NYI");
-         }
-      };
-      AspectManager.setClassLoaderScopingPolicy(classLoaderScopingPolicy);
-      
-      // We're done
-   }
-   
    public static Test suite() throws Exception
    {
       BasicTestSuite suite = new BasicTestSuite();
-      suite.addTestSuite("org.jboss.ejb3.test.interceptors.basic.unit.BasicTestRunner");
+      suite.addTestSuite(BasicTestRunnerWrapper.class);
       return suite;
    }
-   
-   @Override
-   @SuppressWarnings("unchecked")
-   public void addTestSuite(Class testClass)
-   {
-      // trick or treat
-      try
-      {
-         addTestSuite(testClass.getName());
-      }
-      catch(final ClassNotFoundException e)
-      {
-         Test test = new TestCase("error") {
-            @Override
-            protected void runTest() throws Throwable
-            {
-               fail("Failed to load class" + e.getMessage());
-            }
-         };
-         super.addTest(test);
-      }
-   }
-
-   @SuppressWarnings("unchecked")
-   public void addTestSuite(String testClassName) throws ClassNotFoundException
-   {
-      // trick or treat
-      super.addTestSuite((Class<? extends TestCase>) classLoader.loadClass(testClassName));
-   }
 }

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common)

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.interceptors.common;
-
-import javax.interceptor.InvocationContext;
-
-import org.jboss.logging.Logger;
-
-/**
- * A common interceptor without annotation, does nothing useful.
- * 
- * Can be used by an annotated interceptor, or one from metadata.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision$
- */
-public class CommonInterceptor
-{
-   private static final Logger log = Logger.getLogger(CommonInterceptor.class);
-   
-   public static int preDestroys = 0, postConstructs = 0, aroundInvokes = 0;
-   
-   public void preDestroy(InvocationContext ctx) throws Exception
-   {
-      log.debug("preDestroy " + ctx);
-      preDestroys++;
-      ctx.proceed();
-   }
-   
-   public void postConstruct(InvocationContext ctx) throws Exception
-   {
-      log.debug("postConstruct " + ctx);
-      if(ctx.getTarget() == null)
-         throw new IllegalStateException("target is null");
-      postConstructs++;
-      ctx.proceed();
-   }
-   
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
-   {
-      log.debug("aroundInvoke " + ctx);
-      aroundInvokes++;
-      return ctx.proceed();
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.common;
+
+import javax.interceptor.InvocationContext;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A common interceptor without annotation, does nothing useful.
+ * 
+ * Can be used by an annotated interceptor, or one from metadata.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision$
+ */
+public class CommonInterceptor
+{
+   private static final Logger log = Logger.getLogger(CommonInterceptor.class);
+   
+   public static int preDestroys = 0, postConstructs = 0, aroundInvokes = 0;
+   
+   public void preDestroy(InvocationContext ctx) throws Exception
+   {
+      log.debug("preDestroy " + ctx);
+      preDestroys++;
+      ctx.proceed();
+   }
+   
+   public void postConstruct(InvocationContext ctx) throws Exception
+   {
+      log.debug("postConstruct " + ctx);
+      if(ctx.getTarget() == null)
+         throw new IllegalStateException("target is null");
+      postConstructs++;
+      ctx.proceed();
+   }
+   
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      log.debug("aroundInvoke " + ctx);
+      aroundInvokes++;
+      return ctx.proceed();
+   }
+}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop)

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.interceptors.common.aop;
-
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.logging.Logger;
-
-/**
- * Log as much as we can about the invocation, then proceed.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision$
- */
-public class LoggingInterceptor implements Interceptor
-{
-   private static final Logger log = Logger.getLogger(LoggingInterceptor.class);
-   
-   public String getName()
-   {
-      return "LoggingInterceptor";
-   }
-
-   public Object invoke(Invocation invocation) throws Throwable
-   {
-      log.info("invoke " + invocation);
-      log.info("  advisor " + invocation.getAdvisor().getName());
-      log.info("  target object " + invocation.getTargetObject());
-      //log.info("  " + invocation.getResponseContextInfo());
-      return invocation.invokeNext();
-   }
-
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/aop/LoggingInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.common.aop;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.logging.Logger;
+
+/**
+ * Log as much as we can about the invocation, then proceed.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision$
+ */
+public class LoggingInterceptor implements Interceptor
+{
+   private static final Logger log = Logger.getLogger(LoggingInterceptor.class);
+   
+   public String getName()
+   {
+      return "LoggingInterceptor";
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      log.info("invoke " + invocation);
+      log.info("  advisor " + invocation.getAdvisor().getName());
+      log.info("  target object " + invocation.getTargetObject());
+      //log.info("  " + invocation.getResponseContextInfo());
+      return invocation.invokeNext();
+   }
+
+}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors)

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,54 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptors;
-import javax.interceptor.InvocationContext;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- at Interceptors(ClassInterceptor.class)
-public class AnnotatedBean
-{
-   @Interceptors(MethodInterceptor.class)
-   public int defaultOrderMethod()
-   {
-      return 100;
-   }
-   
-   @Interceptors(MethodInterceptor.class)
-   public int xmlOrderedMethod()
-   {
-      return 200;
-   }
-   
-   @AroundInvoke
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
-   {
-      Interceptions.add(this);
-      return ctx.proceed();
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/AnnotatedBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptors;
+import javax.interceptor.InvocationContext;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Interceptors(ClassInterceptor.class)
+public class AnnotatedBean
+{
+   @Interceptors(MethodInterceptor.class)
+   public int defaultOrderMethod()
+   {
+      return 100;
+   }
+   
+   @Interceptors(MethodInterceptor.class)
+   public int xmlOrderedMethod()
+   {
+      return 200;
+   }
+   
+   @AroundInvoke
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      Interceptions.add(this);
+      return ctx.proceed();
+   }
+}

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,40 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class ClassInterceptor
-{
-   @AroundInvoke
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
-   {
-      Interceptions.add(this);
-      return ctx.proceed();
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/ClassInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassInterceptor
+{
+   @AroundInvoke
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      Interceptions.add(this);
+      return ctx.proceed();
+   }
+}

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,40 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DefaultInterceptor
-{
-   @AroundInvoke
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
-   {
-      Interceptions.add(this);
-      return ctx.proceed();
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/DefaultInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultInterceptor
+{
+   @AroundInvoke
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      Interceptions.add(this);
+      return ctx.proceed();
+   }
+}

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,49 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors;
-
-import java.util.ArrayList;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class Interceptions
-{
-   private static ArrayList<Class<?>> interceptions = new ArrayList<Class<?>>();
-   
-   public static void add(Object icptr)
-   {
-      interceptions.add(icptr.getClass());
-   }
-   
-   public static void clear()
-   {
-      interceptions.clear();
-   }
-   
-   public static ArrayList<Class<?>> getInterceptions()
-   {
-      return interceptions;
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/Interceptions.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors;
+
+import java.util.ArrayList;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Interceptions
+{
+   private static ArrayList<Class<?>> interceptions = new ArrayList<Class<?>>();
+   
+   public static void add(Object icptr)
+   {
+      interceptions.add(icptr.getClass());
+   }
+   
+   public static void clear()
+   {
+      interceptions.clear();
+   }
+   
+   public static ArrayList<Class<?>> getInterceptions()
+   {
+      return interceptions;
+   }
+}

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,40 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class MethodInterceptor
-{
-   @AroundInvoke
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
-   {
-      Interceptions.add(this);
-      return ctx.proceed();
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/MethodInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MethodInterceptor
+{
+   @AroundInvoke
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      Interceptions.add(this);
+      return ctx.proceed();
+   }
+}

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors;
-
-import javax.interceptor.InvocationContext;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class XMLBean
-{
-   public int method()
-   {
-      return 100;
-   }
-
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
-   {
-      Interceptions.add(this);
-      return ctx.proceed();
-   }
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors;
+
+import javax.interceptor.InvocationContext;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class XMLBean
+{
+   public int method()
+   {
+      return 100;
+   }
+
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      Interceptions.add(this);
+      return ctx.proceed();
+   }
+}

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,44 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors;
-
-import javax.interceptor.InvocationContext;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class XMLOrderedBean
-{
-   public int method()
-   {
-      return 100;
-   }
-
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
-   {
-      Interceptions.add(this);
-      return ctx.proceed();
-   }
-
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/XMLOrderedBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors;
+
+import javax.interceptor.InvocationContext;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class XMLOrderedBean
+{
+   public int method()
+   {
+      return 100;
+   }
+
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      Interceptions.add(this);
+      return ctx.proceed();
+   }
+
+}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit)

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,203 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors. 
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
-package org.jboss.ejb3.test.interceptors.defaultinterceptors.unit;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.aop.AspectManager;
-import org.jboss.ejb3.interceptors.container.BeanContext;
-import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
-import org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge;
-import org.jboss.ejb3.interceptors.metadata.InterceptorComponentMetaDataLoaderFactory;
-import org.jboss.ejb3.interceptors.metadata.InterceptorMetaDataBridge;
-import org.jboss.ejb3.metadata.MetaDataBridge;
-import org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData;
-import org.jboss.ejb3.test.interceptors.common.AOPDeployer;
-import org.jboss.ejb3.test.interceptors.defaultinterceptors.AnnotatedBean;
-import org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor;
-import org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor;
-import org.jboss.ejb3.test.interceptors.defaultinterceptors.Interceptions;
-import org.jboss.ejb3.test.interceptors.defaultinterceptors.MethodInterceptor;
-import org.jboss.ejb3.test.interceptors.defaultinterceptors.XMLBean;
-import org.jboss.ejb3.test.interceptors.defaultinterceptors.XMLOrderedBean;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ejb.jboss.JBoss50MetaData;
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.spec.EjbJar30MetaData;
-import org.jboss.metadata.ejb.spec.InterceptorMetaData;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
-import org.jboss.xb.builder.JBossXBBuilder;
-import org.w3c.dom.ls.LSInput;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DefaultInterceptorsTestCase extends TestCase
-{
-   private static final Logger log = Logger.getLogger(DefaultInterceptorsTestCase.class);
-   
-   private class MyContainer<T> extends AbstractDirectContainer<T, MyContainer<T>>
-   {
-      public MyContainer(String name, String domainName, Class<? extends T> beanClass, JBossEnterpriseBeanMetaData beanMetaData)
-      {
-         super();
-         
-         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-         AnnotationRepositoryToMetaData annotations = new AnnotationRepositoryToMetaData(beanClass, beanMetaData, name, classLoader);
-         List<MetaDataBridge<InterceptorMetaData>> interceptorBridges = new ArrayList<MetaDataBridge<InterceptorMetaData>>();
-         interceptorBridges.add(new InterceptorMetaDataBridge());
-         annotations.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
-         annotations.addMetaDataBridge(new BeanInterceptorMetaDataBridge());
-         
-         initializeAdvisor(name, getDomain(domainName), beanClass, annotations);
-      }
-
-      public void testAdvisor()
-      {
-         MyContainer<?> container = getAdvisor().getContainer();
-         assertNotNull("container not set in managed object advisor", container);
-         assertTrue(container == this);
-      }
-   }
-   
-   protected static SchemaBindingResolver schemaResolverForClass(final Class<?> root)
-   {
-      return new SchemaBindingResolver()
-      {
-         public String getBaseURI()
-         {
-            return null;
-         }
-
-         public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
-         {
-            return JBossXBBuilder.build(root);
-         }
-
-         public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
-         {
-            return null;
-         }
-
-         public void setBaseURI(String baseURI)
-         {
-         }
-      };
-   }
-
-   // FIXME: use the right jboss-aop.xml
-   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
-   
-   @Override
-   protected void setUp() throws Exception
-   {
-      log.info(deployer.deploy());
-   }
-
-   @Override
-   protected void tearDown() throws Exception
-   {
-      log.info(deployer.undeploy());
-   }
-   
-   public void test() throws Throwable
-   {
-      AspectManager.verbose = true;
-      
-      // To make surefire happy
-      Thread.currentThread().setContextClassLoader(AnnotatedBean.class.getClassLoader());
-      
-      // Bootstrap metadata
-      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
-      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
-      URL url = Thread.currentThread().getContextClassLoader().getResource("defaultinterceptors/META-INF/ejb-jar.xml");
-      EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
-      JBoss50MetaData jbossMetaData = new JBoss50MetaData();
-      jbossMetaData.merge(null, metaData);
-      
-      JBossEnterpriseBeanMetaData annotatedBeanMetaData = jbossMetaData.getEnterpriseBean("AnnotatedBean");
-      assertNotNull(annotatedBeanMetaData);
-      MyContainer<AnnotatedBean> annotatedBeanContainer = new MyContainer<AnnotatedBean>("AnnotatedBean", "Test", AnnotatedBean.class, annotatedBeanMetaData);
-      annotatedBeanContainer.testAdvisor();
-      BeanContext<AnnotatedBean> annotatedBean = annotatedBeanContainer.construct();
-
-      JBossEnterpriseBeanMetaData xmlBeanMetaData = jbossMetaData.getEnterpriseBean("XMLBean");
-      assertNotNull(xmlBeanMetaData);
-      MyContainer<XMLBean> xmlBeanContainer = new MyContainer<XMLBean>("XMLBean", "Test", XMLBean.class, xmlBeanMetaData);
-      xmlBeanContainer.testAdvisor();
-      BeanContext<XMLBean> xmlBean = xmlBeanContainer.construct();
-
-      JBossEnterpriseBeanMetaData xmlOrderedBeanMetaData = jbossMetaData.getEnterpriseBean("XMLOrderedBean");
-      assertNotNull(xmlOrderedBeanMetaData);
-      MyContainer<XMLOrderedBean> xmlOrderedBeanContainer = new MyContainer<XMLOrderedBean>("XMLOrderedBean", "Test", XMLOrderedBean.class, xmlOrderedBeanMetaData);
-      xmlOrderedBeanContainer.testAdvisor();
-      BeanContext<XMLOrderedBean> xmlOrderedBean = xmlOrderedBeanContainer.construct();
-
-      Interceptions.clear();
-      annotatedBeanContainer.invoke(annotatedBean, "defaultOrderMethod", new Object[0]);
-      ArrayList<Class<?>> interceptions = Interceptions.getInterceptions();
-      assertEquals("Interceptions were " + interceptions, 4, interceptions.size());
-      assertEquals(DefaultInterceptor.class, interceptions.get(0));
-      assertEquals(ClassInterceptor.class, interceptions.get(1));
-      assertEquals(MethodInterceptor.class, interceptions.get(2));
-      assertEquals(AnnotatedBean.class, interceptions.get(3));
-      
-      Interceptions.clear();
-      annotatedBeanContainer.invoke(annotatedBean, "xmlOrderedMethod", new Object[0]);
-      interceptions = Interceptions.getInterceptions();
-      assertEquals("Interceptions were " + interceptions, 4, interceptions.size());      
-      assertEquals(MethodInterceptor.class, interceptions.get(0));
-      assertEquals(ClassInterceptor.class, interceptions.get(1));
-      assertEquals(DefaultInterceptor.class, interceptions.get(2));
-      assertEquals(AnnotatedBean.class, interceptions.get(3));
-      
-      Interceptions.clear();
-      xmlBeanContainer.invoke(xmlBean, "method", new Object[0]);
-      interceptions = Interceptions.getInterceptions();
-      assertEquals("Interceptions were " + interceptions, 3, interceptions.size());
-      assertEquals(DefaultInterceptor.class, interceptions.get(0));
-      assertEquals(ClassInterceptor.class, interceptions.get(1));
-      assertEquals(XMLBean.class, interceptions.get(2));
-      
-      Interceptions.clear();
-      xmlOrderedBeanContainer.invoke(xmlOrderedBean, "method", new Object[0]);
-      interceptions = Interceptions.getInterceptions();
-      assertEquals("Interceptions were " + interceptions, 3, interceptions.size());      
-      assertEquals(ClassInterceptor.class, interceptions.get(0));
-      assertEquals(DefaultInterceptor.class, interceptions.get(1));
-      assertEquals(XMLOrderedBean.class, interceptions.get(2));
-      
-      
-      log.info("======= Done");
-   }
-   
-}

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/defaultinterceptors/unit/DefaultInterceptorsTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,202 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.defaultinterceptors.unit;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aspects.common.AOPDeployer;
+import org.jboss.ejb3.interceptors.container.BeanContext;
+import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
+import org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge;
+import org.jboss.ejb3.interceptors.metadata.InterceptorComponentMetaDataLoaderFactory;
+import org.jboss.ejb3.interceptors.metadata.InterceptorMetaDataBridge;
+import org.jboss.ejb3.metadata.MetaDataBridge;
+import org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData;
+import org.jboss.ejb3.test.interceptors.defaultinterceptors.AnnotatedBean;
+import org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor;
+import org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor;
+import org.jboss.ejb3.test.interceptors.defaultinterceptors.Interceptions;
+import org.jboss.ejb3.test.interceptors.defaultinterceptors.MethodInterceptor;
+import org.jboss.ejb3.test.interceptors.defaultinterceptors.XMLBean;
+import org.jboss.ejb3.test.interceptors.defaultinterceptors.XMLOrderedBean;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ejb.jboss.JBoss50MetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.EjbJar30MetaData;
+import org.jboss.metadata.ejb.spec.InterceptorMetaData;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.w3c.dom.ls.LSInput;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultInterceptorsTestCase extends TestCase
+{
+   private static final Logger log = Logger.getLogger(DefaultInterceptorsTestCase.class);
+   
+   private class MyContainer<T> extends AbstractDirectContainer<T, MyContainer<T>>
+   {
+      public MyContainer(String name, String domainName, Class<? extends T> beanClass, JBossEnterpriseBeanMetaData beanMetaData)
+      {
+         super();
+         
+         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+         AnnotationRepositoryToMetaData annotations = new AnnotationRepositoryToMetaData(beanClass, beanMetaData, name, classLoader);
+         List<MetaDataBridge<InterceptorMetaData>> interceptorBridges = new ArrayList<MetaDataBridge<InterceptorMetaData>>();
+         interceptorBridges.add(new InterceptorMetaDataBridge());
+         annotations.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
+         annotations.addMetaDataBridge(new BeanInterceptorMetaDataBridge());
+         
+         initializeAdvisor(name, getDomain(domainName), beanClass, annotations);
+      }
+
+      public void testAdvisor()
+      {
+         MyContainer<?> container = getAdvisor().getContainer();
+         assertNotNull("container not set in managed object advisor", container);
+         assertTrue(container == this);
+      }
+   }
+   
+   protected static SchemaBindingResolver schemaResolverForClass(final Class<?> root)
+   {
+      return new SchemaBindingResolver()
+      {
+         public String getBaseURI()
+         {
+            return null;
+         }
+
+         public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
+         {
+            return JBossXBBuilder.build(root);
+         }
+
+         public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
+         {
+            return null;
+         }
+
+         public void setBaseURI(String baseURI)
+         {
+         }
+      };
+   }
+
+   // FIXME: use the right jboss-aop.xml
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+   
+   public void test() throws Throwable
+   {
+      AspectManager.verbose = true;
+      
+      // To make surefire happy
+      Thread.currentThread().setContextClassLoader(AnnotatedBean.class.getClassLoader());
+      
+      // Bootstrap metadata
+      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
+      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
+      URL url = Thread.currentThread().getContextClassLoader().getResource("defaultinterceptors/META-INF/ejb-jar.xml");
+      EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
+      JBoss50MetaData jbossMetaData = new JBoss50MetaData();
+      jbossMetaData.merge(null, metaData);
+      
+      JBossEnterpriseBeanMetaData annotatedBeanMetaData = jbossMetaData.getEnterpriseBean("AnnotatedBean");
+      assertNotNull(annotatedBeanMetaData);
+      MyContainer<AnnotatedBean> annotatedBeanContainer = new MyContainer<AnnotatedBean>("AnnotatedBean", "Test", AnnotatedBean.class, annotatedBeanMetaData);
+      annotatedBeanContainer.testAdvisor();
+      BeanContext<AnnotatedBean> annotatedBean = annotatedBeanContainer.construct();
+
+      JBossEnterpriseBeanMetaData xmlBeanMetaData = jbossMetaData.getEnterpriseBean("XMLBean");
+      assertNotNull(xmlBeanMetaData);
+      MyContainer<XMLBean> xmlBeanContainer = new MyContainer<XMLBean>("XMLBean", "Test", XMLBean.class, xmlBeanMetaData);
+      xmlBeanContainer.testAdvisor();
+      BeanContext<XMLBean> xmlBean = xmlBeanContainer.construct();
+
+      JBossEnterpriseBeanMetaData xmlOrderedBeanMetaData = jbossMetaData.getEnterpriseBean("XMLOrderedBean");
+      assertNotNull(xmlOrderedBeanMetaData);
+      MyContainer<XMLOrderedBean> xmlOrderedBeanContainer = new MyContainer<XMLOrderedBean>("XMLOrderedBean", "Test", XMLOrderedBean.class, xmlOrderedBeanMetaData);
+      xmlOrderedBeanContainer.testAdvisor();
+      BeanContext<XMLOrderedBean> xmlOrderedBean = xmlOrderedBeanContainer.construct();
+
+      Interceptions.clear();
+      annotatedBeanContainer.invoke(annotatedBean, "defaultOrderMethod", new Object[0]);
+      ArrayList<Class<?>> interceptions = Interceptions.getInterceptions();
+      assertEquals("Interceptions were " + interceptions, 4, interceptions.size());
+      assertEquals(DefaultInterceptor.class, interceptions.get(0));
+      assertEquals(ClassInterceptor.class, interceptions.get(1));
+      assertEquals(MethodInterceptor.class, interceptions.get(2));
+      assertEquals(AnnotatedBean.class, interceptions.get(3));
+      
+      Interceptions.clear();
+      annotatedBeanContainer.invoke(annotatedBean, "xmlOrderedMethod", new Object[0]);
+      interceptions = Interceptions.getInterceptions();
+      assertEquals("Interceptions were " + interceptions, 4, interceptions.size());      
+      assertEquals(MethodInterceptor.class, interceptions.get(0));
+      assertEquals(ClassInterceptor.class, interceptions.get(1));
+      assertEquals(DefaultInterceptor.class, interceptions.get(2));
+      assertEquals(AnnotatedBean.class, interceptions.get(3));
+      
+      Interceptions.clear();
+      xmlBeanContainer.invoke(xmlBean, "method", new Object[0]);
+      interceptions = Interceptions.getInterceptions();
+      assertEquals("Interceptions were " + interceptions, 3, interceptions.size());
+      assertEquals(DefaultInterceptor.class, interceptions.get(0));
+      assertEquals(ClassInterceptor.class, interceptions.get(1));
+      assertEquals(XMLBean.class, interceptions.get(2));
+      
+      Interceptions.clear();
+      xmlOrderedBeanContainer.invoke(xmlOrderedBean, "method", new Object[0]);
+      interceptions = Interceptions.getInterceptions();
+      assertEquals("Interceptions were " + interceptions, 3, interceptions.size());      
+      assertEquals(ClassInterceptor.class, interceptions.get(0));
+      assertEquals(DefaultInterceptor.class, interceptions.get(1));
+      assertEquals(XMLOrderedBean.class, interceptions.get(2));
+      
+      
+      log.info("======= Done");
+   }
+   
+}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/direct/unit/DirectTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/direct/unit/DirectTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/direct/unit/DirectTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,13 +21,11 @@
  */
 package org.jboss.ejb3.test.interceptors.direct.unit;
 
-import java.net.URL;
 import java.util.Arrays;
 
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.container.BeanContext;
 import org.jboss.ejb3.interceptors.container.ManagedObjectAdvisor;
 import org.jboss.ejb3.interceptors.direct.DirectContainer;
@@ -62,19 +60,31 @@
          assertTrue(((ManagedObjectAdvisor<T, DirectContainer<T>>) getAdvisor()).getContainer() == this);
       }
    }
+
+   // FIXME: use the right jboss-aop.xml
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
    
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test() throws Throwable
    {
-      AspectManager.verbose = true;
+      log.info("======= Direct.test()");
+//      AspectManager.verbose = true;
       
       // To make surefire happy
       Thread.currentThread().setContextClassLoader(DirectBean.class.getClassLoader());
       
-      // Bootstrap AOP
-      // FIXME: use the right jboss-aop.xml
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
+      log.info(deployer.deploy());
       
       assertEquals(0, DirectInterceptor.postConstructs);
       
@@ -106,5 +116,6 @@
       
       //((Destructable) bean)._preDestroy();
       bean = null;
+      log.info("======= Done");
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1215/unit/ContextGetMethodTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1215/unit/ContextGetMethodTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1215/unit/ContextGetMethodTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,12 +21,11 @@
  */
 package org.jboss.ejb3.test.interceptors.ejbthree1215.unit;
 
-import java.net.URL;
 import java.util.Date;
 
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.proxy.ProxyContainer;
 import org.jboss.ejb3.test.interceptors.ejbthree1215.GetMethodInterceptor;
 import org.jboss.ejb3.test.interceptors.ejbthree1215.Hello;
@@ -37,30 +36,30 @@
  * EJBTHREE-1215: InvocationContext.getMethod must return null in lifecycle callback.
  * 
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public class ContextGetMethodTestCase extends TestCase
 {
    private static final Logger log = Logger.getLogger(ContextGetMethodTestCase.class);
 
+   // FIXME: use the right jboss-aop.xml
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test1() throws Throwable
    {
-      //AspectManager.verbose = true;
-      
-//      // TODO: During inventory surefire boots up BasicTestSuite
-//      LinkedHashMap pointcuts = AspectManager.instance().getPointcuts();
-//      if(!pointcuts.isEmpty())
-//      {
-//         //System.err.println("AspectManager still contains: " + pointcuts);
-//         URL url = Thread.currentThread().getContextClassLoader().getResource("basic/jboss-aop.xml");
-//         AspectXmlLoader.undeployXML(url);
-//      }
-      
-      // Bootstrap AOP
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-
+      log.info("======= ContextGetMethod.test1()");
       Thread.currentThread().setContextClassLoader(Hello.class.getClassLoader());
       
       ProxyContainer<HelloBean> container = new ProxyContainer<HelloBean>("ContextGetMethodTestCase", "InterceptorContainer", HelloBean.class);
@@ -73,5 +72,6 @@
       
       assertEquals(1, GetMethodInterceptor.invocations);
       assertEquals("Hi " + name, result);
+      log.info("======= Done");
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/instances/unit/InterceptorInstancesTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/instances/unit/InterceptorInstancesTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/instances/unit/InterceptorInstancesTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,11 +21,9 @@
  */
 package org.jboss.ejb3.test.interceptors.instances.unit;
 
-import java.net.URL;
-
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.proxy.ProxyContainer;
 import org.jboss.ejb3.test.interceptors.instances.SimpleBean;
 import org.jboss.ejb3.test.interceptors.instances.StatefulInterceptor;
@@ -44,15 +42,25 @@
 {
    private static final Logger log = Logger.getLogger(InterceptorInstancesTestCase.class);
    
+   // FIXME: use the right jboss-aop.xml
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test1() throws Throwable
    {
-      //AspectManager.verbose = true;
-      
-      // Bootstrap AOP
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-      
+      log.info("======= InterceptorInstances.test1()");
+
       Thread.currentThread().setContextClassLoader(StatefulInterceptorInterface.class.getClassLoader());
       
       ProxyContainer<SimpleBean> container = new ProxyContainer<SimpleBean>("InterceptorInstancesTestCase", "InterceptorContainer", SimpleBean.class);
@@ -69,5 +77,7 @@
       assertEquals(2, bean2.getState());
       
       assertEquals(2, StatefulInterceptor.postConstructs);
+
+      log.info("======= Done");
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/lifecycle/unit/CallbackMethodDescriptorTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/lifecycle/unit/CallbackMethodDescriptorTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/lifecycle/unit/CallbackMethodDescriptorTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -27,8 +27,7 @@
 
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.container.BeanContext;
 import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
 import org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge;
@@ -102,23 +101,34 @@
       };
    }
 
+   // FIXME: use the right jboss-aop.xml
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test() throws Throwable
    {
-      AspectManager.verbose = true;
+      log.info("======= CallbackMethodDescriptor.test()");
+//      AspectManager.verbose = true;
       
       // To make surefire happy
       Thread.currentThread().setContextClassLoader(MetadataBean.class.getClassLoader());
       
-      // Bootstrap AOP
-      // FIXME: use the right jboss-aop.xml
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-      
+     
       // Bootstrap metadata
       UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
       Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
-      url = Thread.currentThread().getContextClassLoader().getResource("lifecycle/META-INF/ejb-jar.xml");
+      URL url = Thread.currentThread().getContextClassLoader().getResource("lifecycle/META-INF/ejb-jar.xml");
       EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
       JBoss50MetaData jbossMetaData = new JBoss50MetaData();
       jbossMetaData.merge(null, metaData);
@@ -138,5 +148,7 @@
       assertEquals(1, SessionBeanCallbackBean.preDestroys);
       
       bean = null;
+
+      log.info("======= Done");
    }
 }

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/InterceptorOrderBean.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/InterceptorOrderBean.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/InterceptorOrderBean.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/InterceptorOrderBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.metadata;
+
+import org.jboss.ejb3.interceptors.ManagedObject;
+import org.jboss.logging.Logger;
+
+/**
+ * This one has an interceptor bound to it via an interceptor order.
+ * 
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at ManagedObject
+public class InterceptorOrderBean
+{
+   private static final Logger log = Logger.getLogger(InterceptorOrderBean.class);
+   
+   public String sayHi(String name)
+   {
+      log.debug("sayHi");
+      return "Hi " + name;
+   }   
+}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/unit/MetadataTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/unit/MetadataTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/metadata/unit/MetadataTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -29,7 +29,7 @@
 import junit.framework.TestCase;
 
 import org.jboss.aop.AspectManager;
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.container.BeanContext;
 import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
 import org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge;
@@ -39,6 +39,7 @@
 import org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData;
 import org.jboss.ejb3.test.interceptors.common.CommonInterceptor;
 import org.jboss.ejb3.test.interceptors.direct.DirectMethodInterceptor;
+import org.jboss.ejb3.test.interceptors.metadata.InterceptorOrderBean;
 import org.jboss.ejb3.test.interceptors.metadata.MetadataBean;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBoss50MetaData;
@@ -114,23 +115,36 @@
       };
    }
 
+   // FIXME: use the right jboss-aop.xml
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+      CommonInterceptor.aroundInvokes = 0;
+      CommonInterceptor.postConstructs = 0;
+      CommonInterceptor.preDestroys = 0;
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+   
    public void test() throws Throwable
    {
+      log.info("======= MetaData.test()");
       AspectManager.verbose = true;
       
       // To make surefire happy
       Thread.currentThread().setContextClassLoader(MetadataBean.class.getClassLoader());
       
-      // Bootstrap AOP
-      // FIXME: use the right jboss-aop.xml
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-      
       // Bootstrap metadata
       UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
       Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
-      url = Thread.currentThread().getContextClassLoader().getResource("metadata/META-INF/ejb-jar.xml");
+      URL url = Thread.currentThread().getContextClassLoader().getResource("metadata/META-INF/ejb-jar.xml");
       EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
       JBoss50MetaData jbossMetaData = new JBoss50MetaData();
       jbossMetaData.merge(null, metaData);
@@ -169,5 +183,49 @@
       assertEquals(1, CommonInterceptor.preDestroys);
       
       bean = null;
+      log.info("======= Done");
    }
+   
+   public void testInterceptorOrder() throws Throwable
+   {
+      log.info("======= MetaData.testInterceptorOrder()");
+      // To make surefire happy
+      Thread.currentThread().setContextClassLoader(MetadataBean.class.getClassLoader());
+      
+      // Bootstrap metadata
+      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
+      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
+      URL url = Thread.currentThread().getContextClassLoader().getResource("metadata/META-INF/ejb-jar.xml");
+      EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
+      JBoss50MetaData jbossMetaData = new JBoss50MetaData();
+      jbossMetaData.merge(null, metaData);
+      
+      JBossEnterpriseBeanMetaData beanMetaData = jbossMetaData.getEnterpriseBean("InterceptorOrderBean");
+      assertNotNull(beanMetaData);
+      
+      assertEquals(0, CommonInterceptor.postConstructs);
+      
+      MyContainer<InterceptorOrderBean> container = new MyContainer<InterceptorOrderBean>("InterceptorOrderBean", "Test", InterceptorOrderBean.class, beanMetaData);
+      container.testAdvisor();
+      
+      BeanContext<InterceptorOrderBean> bean = container.construct();
+      
+      assertEquals("CommonInterceptor postConstruct must have been called once", 1, CommonInterceptor.postConstructs);
+      
+      System.out.println(bean.getClass() + " " + bean.getClass().getClassLoader());
+      System.out.println("  " + Arrays.toString(bean.getClass().getInterfaces()));
+      String result = container.invoke(bean, "sayHi", "Test");
+      System.out.println(result);
+      
+      assertEquals("sayHi didn't invoke CommonInterceptor.aroundInvoke once", 1, CommonInterceptor.aroundInvokes);
+      
+      assertEquals("CommonInterceptor postConstruct must have been called once", 1, CommonInterceptor.postConstructs);
+      
+      container.destroy(bean);
+      assertEquals(1, CommonInterceptor.preDestroys);
+      
+      bean = null;
+      log.info("======= Done");
+
+   }
 }

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/AbstractInterceptor.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/AbstractInterceptor.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/AbstractInterceptor.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/AbstractInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.order;
+
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public abstract class AbstractInterceptor
+{
+   @AroundInvoke
+   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   {
+      List<String> list = (List<String>) ctx.getParameters()[0];
+      list.add(getInterceptorName());
+      return ctx.proceed();
+   }
+
+   protected abstract String getInterceptorName();
+   
+   @PostConstruct
+   public void postConstruct(InvocationContext ctx) throws Exception
+   {
+      InterceptorChainBean bean = (InterceptorChainBean) ctx.getTarget();
+      bean.addPostConstruct(getInterceptorName());
+      ctx.proceed();
+   }
+}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorA.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorA.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorA.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,22 +21,16 @@
  */
 package org.jboss.ejb3.test.interceptors.order;
 
-import java.util.List;
 
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
 /**
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
  * @version $Revision: $
  */
-public class InterceptorA
+public class InterceptorA extends AbstractInterceptor
 {
-   @AroundInvoke
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   @Override
+   protected String getInterceptorName()
    {
-      List<String> list = (List<String>) ctx.getParameters()[0];
-      list.add("A");
-      return ctx.proceed();
-   }
+      return "A";
+   }   
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorB.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorB.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorB.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,22 +21,16 @@
  */
 package org.jboss.ejb3.test.interceptors.order;
 
-import java.util.List;
 
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
 /**
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
  * @version $Revision: $
  */
-public class InterceptorB
+public class InterceptorB extends AbstractInterceptor
 {
-   @AroundInvoke
-   public Object aroundInvoke(InvocationContext ctx) throws Exception
+   @Override
+   protected String getInterceptorName()
    {
-      List<String> list = (List<String>) ctx.getParameters()[0];
-      list.add("B");
-      return ctx.proceed();
-   }
+      return "B";
+   }   
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorChainBean.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorChainBean.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/InterceptorChainBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,13 +21,18 @@
  */
 package org.jboss.ejb3.test.interceptors.order;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
+import javax.annotation.PostConstruct;
 import javax.interceptor.Interceptors;
 
 import org.jboss.ejb3.interceptors.ManagedObject;
 
 /**
+ * Keep track of the interceptor chain invoked.
+ * 
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
  * @version $Revision: $
  */
@@ -35,9 +40,29 @@
 @Interceptors({InterceptorA.class, InterceptorB.class})
 public class InterceptorChainBean
 {
-   //@Interceptors({InterceptorA.class, InterceptorB.class})
-   public void createInterceptorChain(List<String> chain)
+   private List<String> postConstructs = new ArrayList<String>();
+   
+   protected boolean addPostConstruct(String name)
    {
+      return postConstructs.add(name);
+   }
+   
+   /**
+    * Add the called instance to the chain and return
+    * the post constructs invoked.
+    * 
+    * @param chain
+    * @return a list of post constructed instances
+    */
+   public List<String> createInterceptorChain(List<String> chain)
+   {
       chain.add("BEAN");
+      return Collections.unmodifiableList(postConstructs);
    }
+   
+   @PostConstruct
+   public void postConstruct()
+   {
+      addPostConstruct("BEAN");
+   }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/unit/InterceptorChainTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/unit/InterceptorChainTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/order/unit/InterceptorChainTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -29,7 +29,7 @@
 import junit.framework.TestCase;
 
 import org.jboss.aop.AspectManager;
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.container.BeanContext;
 import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
 import org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge;
@@ -113,6 +113,22 @@
       };
    }
 
+   // FIXME: use the right jboss-aop.xml
+
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test() throws Throwable
    {
       AspectManager.verbose = true;
@@ -120,16 +136,10 @@
       // To make surefire happy
       Thread.currentThread().setContextClassLoader(MetadataBean.class.getClassLoader());
       
-      // Bootstrap AOP
-      // FIXME: use the right jboss-aop.xml
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-      
       // Bootstrap metadata
       UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
       Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
-      url = Thread.currentThread().getContextClassLoader().getResource("order/META-INF/ejb-jar.xml");
+      URL url = Thread.currentThread().getContextClassLoader().getResource("order/META-INF/ejb-jar.xml");
       EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
       JBoss50MetaData jbossMetaData = new JBoss50MetaData();
       jbossMetaData.merge(null, metaData);
@@ -143,10 +153,12 @@
       BeanContext<InterceptorChainBean> bean = container.construct();
       
       List<String> chain = new ArrayList<String>();
-      container.invoke(bean, "createInterceptorChain", chain);
+      List<String> postConstructs = container.invoke(bean, "createInterceptorChain", chain);
       
       assertEquals(Arrays.asList("B", "A", "BEAN"), chain);
       
+      assertEquals(Arrays.asList("B", "A", "BEAN"), postConstructs);
+      
       bean = null;
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxy/unit/ProxyTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxy/unit/ProxyTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxy/unit/ProxyTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,11 +21,9 @@
  */
 package org.jboss.ejb3.test.interceptors.proxy.unit;
 
-import java.net.URL;
-
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.proxy.ProxyContainer;
 import org.jboss.ejb3.test.interceptors.proxy.MyInterface;
 import org.jboss.ejb3.test.interceptors.proxy.ProxiedBean;
@@ -42,15 +40,25 @@
 {
    private static final Logger log = Logger.getLogger(ProxyTestCase.class);
 
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test1() throws Throwable
    {
+      log.info("======= Proxy.test1()");
       //AspectManager.verbose = true;
       
-      // Bootstrap AOP
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-
       Thread.currentThread().setContextClassLoader(MyInterface.class.getClassLoader());
       
       ProxyContainer<ProxiedBean> container = new ProxyContainer<ProxiedBean>("ProxyTestCase", "InterceptorContainer", ProxiedBean.class);
@@ -67,5 +75,6 @@
       
       assertEquals("sayHi didn't invoke ProxiedInterceptor.aroundInvoke once", 1, ProxiedInterceptor.aroundInvokes);
       assertEquals("sayHi didn't invoke ProxiedBean.aroundInvoke once", 1, ProxiedBean.aroundInvokes);
+      log.info("======= Done");
    }
 }

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/Interceptions.java (from rev 72289, projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/Interceptions.java)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/Interceptions.java	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/Interceptions.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,143 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.ejb3.test.interceptors.proxyinstanceadvisor;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Interceptions
+{
+   private static ThreadLocal<PerInstanceInterceptor> perInstanceInterceptor = new ThreadLocal<PerInstanceInterceptor>();
+   
+   private static ThreadLocal<PerJoinpointInterceptor> perJoinpointInterceptor = new ThreadLocal<PerJoinpointInterceptor>();
+   
+   private static ThreadLocal<ProxiedBean> proxiedBean = new ThreadLocal<ProxiedBean>();
+   
+   private static ThreadLocal<Integer> perInstanceCalls = new ThreadLocal<Integer>()
+   {
+      @Override
+      protected Integer initialValue()
+      {
+         return 0;
+      }
+   };
+   
+   private static ThreadLocal<Integer> perJoinpointCalls = new ThreadLocal<Integer>()
+   {
+      @Override
+      protected Integer initialValue()
+      {
+         return 0;
+      }
+   };
+
+   private static ThreadLocal<Integer> proxiedBeanCalls = new ThreadLocal<Integer>()
+   {
+      @Override
+      protected Integer initialValue()
+      {
+         return 0;
+      }
+   };
+
+   public static PerInstanceInterceptor getPerInstanceInterceptor()
+   {
+      return perInstanceInterceptor.get();
+   }
+   
+   public static void setPerInstanceInterceptor(PerInstanceInterceptor perInstanceInterceptor)
+   {
+      Interceptions.perInstanceInterceptor.set(perInstanceInterceptor);
+      addPerInstanceCall();
+   }
+   
+   public static PerJoinpointInterceptor getPerJoinpointInterceptor()
+   {
+      return perJoinpointInterceptor.get();
+   }
+   
+   public static void setPerJoinpointInterceptor(PerJoinpointInterceptor perJoinpointInterceptor)
+   {
+      Interceptions.perJoinpointInterceptor.set(perJoinpointInterceptor);
+      addPerJoinpointCall();
+   }
+   
+   public static ProxiedBean getProxiedBean()
+   {
+      return proxiedBean.get();
+   }
+   
+   public static void setProxiedBean(ProxiedBean proxiedBean)
+   {
+      Interceptions.proxiedBean.set(proxiedBean);
+      addProxiedBeanCall();
+   }
+   
+   public static synchronized int getPerInstanceCalls()
+   {
+      return perInstanceCalls.get();
+   }
+   
+   private static synchronized void addPerInstanceCall()
+   {
+      int calls = getPerInstanceCalls();
+      calls++;
+      Interceptions.perInstanceCalls.set(calls);
+   }
+   
+   public static synchronized int getPerJoinpointCalls()
+   {
+      return perJoinpointCalls.get();
+   }
+   
+   private static void addPerJoinpointCall()
+   {
+      int calls = getPerJoinpointCalls();
+      calls++;
+      Interceptions.perJoinpointCalls.set(calls);
+   }
+   
+   public static synchronized int getProxiedBeanCalls()
+   {
+      return proxiedBeanCalls.get();
+   }
+   
+   private static void addProxiedBeanCall()
+   {
+      int calls = getProxiedBeanCalls();
+      calls++;
+      Interceptions.proxiedBeanCalls.set(calls);
+   }
+   
+   public static void reset()
+   {
+      perInstanceInterceptor.set(null);
+      perJoinpointInterceptor.set(null);
+      proxiedBean.set(null);
+      perInstanceCalls.set(0);
+      perJoinpointCalls.set(0);
+      proxiedBeanCalls.set(0);
+   }
+   
+}

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/MyInterface.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/MyInterface.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/MyInterface.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -32,4 +32,6 @@
    String sayHi(String name);
    
    String sayBye(String name);
+   
+   String sleepyHello(long ms, String name);
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerInstanceInterceptor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerInstanceInterceptor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerInstanceInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -34,8 +34,6 @@
 {
    Logger log = Logger.getLogger(PerInstanceInterceptor.class);
    
-   public static PerInstanceInterceptor instance;
-   
    public String getName()
    {
       return this.getClass().getName();
@@ -43,7 +41,7 @@
 
    public Object invoke(Invocation invocation) throws Throwable
    {
-      instance = this;
+      Interceptions.setPerInstanceInterceptor(this);
       return invocation.invokeNext();
    }
 

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerJoinpointInterceptor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerJoinpointInterceptor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/PerJoinpointInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -34,8 +34,6 @@
 {
    Logger log = Logger.getLogger(PerJoinpointInterceptor.class);
 
-   public static PerJoinpointInterceptor instance;
-   
    public String getName()
    {
       return this.getClass().getName();
@@ -43,7 +41,7 @@
 
    public Object invoke(Invocation invocation) throws Throwable
    {
-      instance = this;
+      Interceptions.setPerJoinpointInterceptor(this);
       return invocation.invokeNext();
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedBean.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedBean.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedBean.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -36,8 +36,6 @@
 {
    private static final Logger log = Logger.getLogger(ProxiedBean.class);
    
-   public static ProxiedBean instance;
-   
 //   public static int constructors = 0, aroundInvokes = 0;
    
    public ProxiedBean()
@@ -60,15 +58,30 @@
    
    public String sayHi(String name)
    {
-      instance = this;
+      Interceptions.setProxiedBean(this);
       log.debug("sayHi");
       return "Hi " + name;
    }
 
    public String sayBye(String name)
    {
-      instance = this;
+      Interceptions.setProxiedBean(this);
       log.debug("sayBye");
       return "Bye " + name;
    }
+
+   public String sleepyHello(long ms, String name)
+   {
+      log.debug("sleepyHello");
+      try
+      {
+         Thread.sleep(ms);
+      }
+      catch (InterruptedException e)
+      {
+         throw new RuntimeException(e);
+      }
+      Interceptions.setProxiedBean(this);
+      return "Hi " + name;
+   }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedInterceptor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedInterceptor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/ProxiedInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,8 +21,6 @@
  */
 package org.jboss.ejb3.test.interceptors.proxyinstanceadvisor;
 
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
 import javax.interceptor.AroundInvoke;
 import javax.interceptor.InvocationContext;
 

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimpleContext.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimpleContext.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimpleContext.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -37,6 +37,11 @@
       return instance;
    }
 
+   public Object getInterceptor(Class<?> interceptorClass) throws IllegalArgumentException
+   {
+      throw new IllegalArgumentException("No interceptors defined");
+   }
+   
    public Object[] getInterceptors()
    {
       return new Object[0];

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimplePoolInterceptor.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimplePoolInterceptor.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/SimplePoolInterceptor.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -39,6 +39,7 @@
    private static ProxiedBean pooledBean;
    
    Logger log = Logger.getLogger(SimplePoolInterceptor.class);
+
    public String getName()
    {
       return this.getClass().getName();
@@ -57,8 +58,12 @@
       SimpleContext ctx = (SimpleContext)mi.getBeanContext(); 
       ProxiedBean bean = createNewInstance ? new ProxiedBean() : pooledBean;
       pooledBean = bean;
+      
+      log.debug("Using instance " + bean);
+      
       ctx.setInstance(bean);
-      mi.setTargetObject(bean);
+      //mi.setTargetObject(bean);
+      mi.setBeanContext(ctx);
       try
       {
          return invocation.invokeNext();
@@ -66,6 +71,7 @@
       finally
       {
          ctx.setInstance(null);
+         mi.setBeanContext(null);
       }
    }
 

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/unit/ProxyInstanceAdvisorTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/unit/ProxyInstanceAdvisorTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/proxyinstanceadvisor/unit/ProxyInstanceAdvisorTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,17 +21,14 @@
  */
 package org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.unit;
 
-import java.net.URL;
-
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectXmlLoader;
-import org.jboss.ejb3.interceptors.proxy.ProxyContainer;
+import org.jboss.aspects.common.AOPDeployer;
+import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.Interceptions;
 import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.MyInterface;
 import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.PerInstanceInterceptor;
 import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.PerJoinpointInterceptor;
 import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.ProxiedBean;
-import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.ProxiedInterceptor;
 import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.ProxyContainerWithPool;
 import org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.SimplePoolInterceptor;
 import org.jboss.logging.Logger;
@@ -46,36 +43,53 @@
 {
    private static final Logger log = Logger.getLogger(ProxyInstanceAdvisorTestCase.class);
 
+   AOPDeployer deployer = new AOPDeployer("proxyinstanceadvisor/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test1() throws Throwable
    {
+      log.info("======= ProxyInstanceAdvisor.test1()");
       //AspectManager.verbose = true;
       
-      // Bootstrap AOP
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxyinstanceadvisor/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-
       Thread.currentThread().setContextClassLoader(MyInterface.class.getClassLoader());
       
-      ProxyContainerWithPool<ProxiedBean> container = new ProxyContainerWithPool<ProxiedBean>("ProxyTestCase", "InterceptorContainer", ProxiedBean.class);
+      ProxyContainerWithPool<ProxiedBean> container = new ProxyContainerWithPool<ProxiedBean>("ProxyInstanceAdvisorTestCase", "InterceptorContainer", ProxiedBean.class);
       
       
       Class<?> interfaces[] = { MyInterface.class };
       MyInterface proxy = container.constructProxy(interfaces);
       
+      
       reset(true);
       String result = proxy.sayHi("Me");
       assertEquals("Hi Me", result);
-      ProxiedBean bean1hi = ProxiedBean.instance;
-      PerInstanceInterceptor pi1hi = PerInstanceInterceptor.instance;
-      PerJoinpointInterceptor pj1hi = PerJoinpointInterceptor.instance;
+      ProxiedBean bean1hi = Interceptions.getProxiedBean();
+      PerInstanceInterceptor pi1hi = Interceptions.getPerInstanceInterceptor();
+      PerJoinpointInterceptor pj1hi = Interceptions.getPerJoinpointInterceptor();
+      assertEquals(1, Interceptions.getProxiedBeanCalls());
+      assertEquals(1, Interceptions.getPerInstanceCalls());
+      assertEquals(1, Interceptions.getPerJoinpointCalls());
       
       reset(false);
       result = proxy.sayBye("Me");
       assertEquals("Bye Me", result);
-      ProxiedBean bean1bye = ProxiedBean.instance;
-      PerInstanceInterceptor pi1bye = PerInstanceInterceptor.instance;
-      PerJoinpointInterceptor pj1bye = PerJoinpointInterceptor.instance;
+      ProxiedBean bean1bye = Interceptions.getProxiedBean();
+      PerInstanceInterceptor pi1bye = Interceptions.getPerInstanceInterceptor();
+      PerJoinpointInterceptor pj1bye = Interceptions.getPerJoinpointInterceptor();
+      assertEquals(1, Interceptions.getProxiedBeanCalls());
+      assertEquals(1, Interceptions.getPerInstanceCalls());
+      assertEquals(1, Interceptions.getPerJoinpointCalls());
       
       assertSame(bean1hi, bean1bye);
       assertSame(pi1hi, pi1bye);
@@ -84,21 +98,162 @@
       reset(true);
       result = proxy.sayHi("Me");
       assertEquals("Hi Me", result);
-      ProxiedBean bean2hi = ProxiedBean.instance;
-      PerInstanceInterceptor pi2hi = PerInstanceInterceptor.instance;
-      PerJoinpointInterceptor pj2hi = PerJoinpointInterceptor.instance;
+      ProxiedBean bean2hi = Interceptions.getProxiedBean();
+      PerInstanceInterceptor pi2hi = Interceptions.getPerInstanceInterceptor();
+      PerJoinpointInterceptor pj2hi = Interceptions.getPerJoinpointInterceptor();
       assertNotSame(bean1hi, bean2hi);
+      assertEquals(1, Interceptions.getProxiedBeanCalls());
+      assertEquals(1, Interceptions.getPerInstanceCalls());
+      assertEquals(1, Interceptions.getPerJoinpointCalls());
       
       //FIXME - These must be enabled to start the test
-//      assertNotSame(pi2hi, pi1hi);
-//      assertNotSame(pj2hi, pj1hi);
+      assertNotSame(pi2hi, pi1hi);
+      assertNotSame(pj2hi, pj1hi);
+
+      log.info("======= Done");
    }
    
-   private void reset(boolean createNewInstance)
+   public void testThreadedDifferentInstance() throws Throwable
    {
-      ProxiedBean.instance = null;
-      PerInstanceInterceptor.instance = null;
-      PerJoinpointInterceptor.instance = null;
+      log.info("======= ProxyInstanceAdvisor.test1()");
+      runThreadedTest(true);
+      log.info("======= Done");
+   }
+   
+   public void testThreadedSameInstance() throws Throwable
+   {
+      log.info("======= ProxyInstanceAdvisor.test1()");
+      runThreadedTest(false);
+      log.info("======= Done");
+   }
+   
+   private void runThreadedTest(boolean differentInstances) throws Throwable
+   {
+      //AspectManager.verbose = true;
+      
+      Thread.currentThread().setContextClassLoader(MyInterface.class.getClassLoader());
+      
+      ProxyContainerWithPool<ProxiedBean> container = new ProxyContainerWithPool<ProxiedBean>("ProxyInstanceAdvisorTestCase", "InterceptorContainer", ProxiedBean.class);
+
+      Class<?> interfaces[] = { MyInterface.class };
+      MyInterface proxy = container.constructProxy(interfaces);
+
+      CallSleepyHelloRunnable sleepyRunner = new CallSleepyHelloRunnable(proxy, 5000);
+      Thread thread = new Thread(sleepyRunner);
+      System.out.println("My thread " + Thread.currentThread().getName() + " new thread " + thread.getName());
+      thread.start();
+      
+      //Give other thread a chance to start
+      Thread.sleep(1000);         
+      
+      reset(differentInstances);
+      
+      String result = proxy.sleepyHello(0, "Me");
+      assertEquals("Hi Me", result);
+      ProxiedBean beanMine = Interceptions.getProxiedBean();
+      PerInstanceInterceptor piMine = Interceptions.getPerInstanceInterceptor();
+      PerJoinpointInterceptor pjMine = Interceptions.getPerJoinpointInterceptor();
+      assertEquals(1, Interceptions.getProxiedBeanCalls());
+      assertEquals(1, Interceptions.getPerInstanceCalls());
+      assertEquals(1, Interceptions.getPerJoinpointCalls());
+
+      while(thread.isAlive())
+      {
+         Thread.sleep(500);
+      }
+      
+      ProxiedBean beanThread = sleepyRunner.getProxiedBean();
+      PerInstanceInterceptor piThread = sleepyRunner.getPerInstanceInterceptor();
+      PerJoinpointInterceptor pjThread = sleepyRunner.getPerJoinpointInterceptor();
+      assertEquals(1, sleepyRunner.getProxiedBeanCalls());
+      assertEquals(1, sleepyRunner.getPerInstanceCalls());
+      assertEquals(1, sleepyRunner.getPerJoinpointCalls());
+      
+      assertNotNull(beanThread);
+      assertNotNull(piThread);
+      assertNotNull(pjThread);
+      
+      if (differentInstances)
+      {
+         assertNotSame(beanMine, beanThread);
+         assertNotSame(piMine, piThread);
+         assertNotSame(pjMine, pjThread);
+      }
+      else
+      {
+         assertSame(beanMine, beanThread);
+         assertSame(piMine, piThread);
+         assertSame(pjMine, pjThread);
+      }
+      log.info("======= Done");
+   }
+   
+   
+   private static void reset(boolean createNewInstance)
+   {
+      Interceptions.reset();
+      System.out.println("Setting createNewInstance " + createNewInstance + " for thread " + Thread.currentThread().getName());
       SimplePoolInterceptor.createNewInstance = createNewInstance;      
    }
+   
+   private static class CallSleepyHelloRunnable implements Runnable
+   {
+      MyInterface proxy;
+      long sleepTime;
+    
+      PerInstanceInterceptor perInstanceInterceptor;
+      PerJoinpointInterceptor perJoinpointInterceptor;
+      ProxiedBean proxiedBean;
+      int proxiedBeanCalls;
+      int perInstanceCalls;
+      int perJoinpointCalls;
+      
+      public CallSleepyHelloRunnable(MyInterface proxy, long sleepTime)
+      {
+         this.proxy = proxy;
+         this.sleepTime = sleepTime;
+      }
+
+      public void run()
+      {
+         reset(true);
+         proxy.sleepyHello(sleepTime, "Kabir");
+         perInstanceInterceptor = Interceptions.getPerInstanceInterceptor();
+         perJoinpointInterceptor = Interceptions.getPerJoinpointInterceptor();
+         proxiedBean = Interceptions.getProxiedBean();
+         proxiedBeanCalls = Interceptions.getProxiedBeanCalls();
+         perInstanceCalls = Interceptions.getPerInstanceCalls();
+         perJoinpointCalls = Interceptions.getPerJoinpointCalls();
+      }
+
+      public PerInstanceInterceptor getPerInstanceInterceptor()
+      {
+         return perInstanceInterceptor;
+      }
+
+      public PerJoinpointInterceptor getPerJoinpointInterceptor()
+      {
+         return perJoinpointInterceptor;
+      }
+
+      public ProxiedBean getProxiedBean()
+      {
+         return proxiedBean;
+      }
+
+      public int getProxiedBeanCalls()
+      {
+         return proxiedBeanCalls;
+      }
+
+      public int getPerInstanceCalls()
+      {
+         return perInstanceCalls;
+      }
+
+      public int getPerJoinpointCalls()
+      {
+         return perJoinpointCalls;
+      }
+   }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/signature/unit/SignatureTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/signature/unit/SignatureTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/signature/unit/SignatureTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -22,14 +22,13 @@
 package org.jboss.ejb3.test.interceptors.signature.unit;
 
 
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.container.BeanContext;
 import org.jboss.ejb3.interceptors.direct.DirectContainer;
 import org.jboss.ejb3.test.interceptors.signature.PackageProtectedInterceptor;
@@ -53,19 +52,28 @@
       return lifeCycleVisits.add(cls.getName() + "." + methodName);
    }
    
+   AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test() throws Throwable
    {
+      log.info("======= Signature.test()");
       //AspectManager.verbose = true;
       
       // To make surefire happy
       Thread.currentThread().setContextClassLoader(SignatureTestBean.class.getClassLoader());
       
-      // Bootstrap AOP
-      // FIXME: use the right jboss-aop.xml
-      URL url = Thread.currentThread().getContextClassLoader().getResource("proxy/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-      
       lifeCycleVisits.clear();
       
       DirectContainer<SignatureTestBean> container = new DirectContainer<SignatureTestBean>("SignatureTestBean", "Test", SignatureTestBean.class);
@@ -81,5 +89,7 @@
       assertEquals(2, numVisits.intValue());
       List<Class<?>> expectedVisits = Arrays.asList(PackageProtectedInterceptor.class, SignatureTestBean.class);
       assertEquals(expectedVisits, visits);
+
+      log.info("======= Done");
    }
 }

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/supermethod/unit/SuperMethodTestCase.java
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/supermethod/unit/SuperMethodTestCase.java	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/supermethod/unit/SuperMethodTestCase.java	2008-04-16 15:51:56 UTC (rev 72292)
@@ -21,13 +21,9 @@
  */
 package org.jboss.ejb3.test.interceptors.supermethod.unit;
 
-import java.net.URL;
-import java.util.LinkedHashMap;
-
 import junit.framework.TestCase;
 
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aspects.common.AOPDeployer;
 import org.jboss.ejb3.interceptors.proxy.ProxyContainer;
 import org.jboss.ejb3.test.interceptors.supermethod.AroundInvokeBean;
 import org.jboss.ejb3.test.interceptors.supermethod.AroundInvokeIF;
@@ -40,30 +36,31 @@
  * the afterBegintTest defined in AroundInvokeBase must contain SessionSynchronizationInterceptor.
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public class SuperMethodTestCase extends TestCase
 {
    private static final Logger log = Logger.getLogger(SuperMethodTestCase.class);
 
+   AOPDeployer deployer = new AOPDeployer("supermethod/jboss-aop.xml");
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.info(deployer.deploy());
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      log.info(deployer.undeploy());
+   }
+
    public void test1() throws Throwable
    {
+      log.info("======= SuperMethod.test1()");
       //AspectManager.verbose = true;
       
-      // TODO: During inventory surefire boots up BasicTestSuite
-      LinkedHashMap pointcuts = AspectManager.instance().getPointcuts();
-      if(!pointcuts.isEmpty())
-      {
-         //System.err.println("AspectManager still contains: " + pointcuts);
-         URL url = Thread.currentThread().getContextClassLoader().getResource("basic/jboss-aop.xml");
-         AspectXmlLoader.undeployXML(url);
-      }
-      
-      // Bootstrap AOP
-      URL url = Thread.currentThread().getContextClassLoader().getResource("supermethod/jboss-aop.xml");
-      log.info("deploying AOP from " + url);
-      AspectXmlLoader.deployXML(url);
-
       Thread.currentThread().setContextClassLoader(AroundInvokeIF.class.getClassLoader());
       
       ProxyContainer<AroundInvokeBean> container = new ProxyContainer<AroundInvokeBean>("SuperMethodTestCase", "InterceptorContainer", AroundInvokeBean.class);
@@ -72,5 +69,7 @@
       AroundInvokeIF proxy = container.constructProxy(interfaces);
       
       proxy.afterBeginTest();
+
+      log.info("======= Done");
    }
 }

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors (from rev 72289, projects/ejb3/trunk/interceptors/src/test/resources/defaultinterceptors)

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF (from rev 72289, projects/ejb3/trunk/interceptors/src/test/resources/defaultinterceptors/META-INF)

Deleted: projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml	2008-04-16 15:22:13 UTC (rev 72289)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar
-        xmlns="http://java.sun.com/xml/ns/javaee"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-                            http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
-        version="3.0">
-    <display-name>InterceptorsTest</display-name>
-    <!-- Must define a bean here, because we have no annotation on it -->
-    <!-- (Can't use @Stateless within ejb3-interceptors) -->
-    <enterprise-beans>
-      <session>
-         <ejb-name>AnnotatedBean</ejb-name>
-      </session>
-      <session>
-         <ejb-name>XMLBean</ejb-name>
-         <around-invoke>
-            <method-name>aroundInvoke</method-name>
-         </around-invoke>
-      </session>
-      <session>
-         <ejb-name>XMLOrderedBean</ejb-name>
-         <around-invoke>
-            <method-name>aroundInvoke</method-name>
-         </around-invoke>
-      </session>
-    </enterprise-beans>
-    <assembly-descriptor>
-      <interceptor-binding>
-         <ejb-name>*</ejb-name>
-         <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor</interceptor-class>
-      </interceptor-binding>
-      <interceptor-binding>
-         <ejb-name>AnnotatedBean</ejb-name>
-         <interceptor-order>
-            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.MethodInterceptor</interceptor-class>
-            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor</interceptor-class>
-            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor</interceptor-class>
-         </interceptor-order>
-         <method>
-            <method-name>xmlOrderedMethod</method-name>
-         </method>
-      </interceptor-binding>
-      <interceptor-binding>
-         <ejb-name>XMLBean</ejb-name>
-         <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor</interceptor-class>
-      </interceptor-binding>
-      <interceptor-binding>
-         <ejb-name>XMLOrderedBean</ejb-name>
-         <interceptor-order>
-            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor</interceptor-class>
-            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor</interceptor-class>
-         </interceptor-order>
-      </interceptor-binding>
-    </assembly-descriptor>
-</ejb-jar>
\ No newline at end of file

Copied: projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml (from rev 72289, projects/ejb3/trunk/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml)
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/defaultinterceptors/META-INF/ejb-jar.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+        version="3.0">
+    <display-name>InterceptorsTest</display-name>
+    <!-- Must define a bean here, because we have no annotation on it -->
+    <!-- (Can't use @Stateless within ejb3-interceptors) -->
+    <enterprise-beans>
+      <session>
+         <ejb-name>AnnotatedBean</ejb-name>
+      </session>
+      <session>
+         <ejb-name>XMLBean</ejb-name>
+         <around-invoke>
+            <method-name>aroundInvoke</method-name>
+         </around-invoke>
+      </session>
+      <session>
+         <ejb-name>XMLOrderedBean</ejb-name>
+         <around-invoke>
+            <method-name>aroundInvoke</method-name>
+         </around-invoke>
+      </session>
+    </enterprise-beans>
+    <assembly-descriptor>
+      <interceptor-binding>
+         <ejb-name>*</ejb-name>
+         <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor</interceptor-class>
+      </interceptor-binding>
+      <interceptor-binding>
+         <ejb-name>AnnotatedBean</ejb-name>
+         <interceptor-order>
+            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.MethodInterceptor</interceptor-class>
+            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor</interceptor-class>
+            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor</interceptor-class>
+         </interceptor-order>
+         <method>
+            <method-name>xmlOrderedMethod</method-name>
+         </method>
+      </interceptor-binding>
+      <interceptor-binding>
+         <ejb-name>XMLBean</ejb-name>
+         <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor</interceptor-class>
+      </interceptor-binding>
+      <interceptor-binding>
+         <ejb-name>XMLOrderedBean</ejb-name>
+         <interceptor-order>
+            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.ClassInterceptor</interceptor-class>
+            <interceptor-class>org.jboss.ejb3.test.interceptors.defaultinterceptors.DefaultInterceptor</interceptor-class>
+         </interceptor-order>
+      </interceptor-binding>
+    </assembly-descriptor>
+</ejb-jar>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/metadata/META-INF/ejb-jar.xml
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/metadata/META-INF/ejb-jar.xml	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/metadata/META-INF/ejb-jar.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -15,6 +15,9 @@
     			<method-name>aroundInvoke</method-name>
     		</around-invoke>
     	</session>
+    	<session>
+    		<ejb-name>InterceptorOrderBean</ejb-name>
+    	</session>
     </enterprise-beans>
     <interceptors>
 		<interceptor>
@@ -43,5 +46,11 @@
     			<method-name>intercept</method-name>
     		</method>
     	</interceptor-binding>
+    	<interceptor-binding>
+    		<ejb-name>InterceptorOrderBean</ejb-name>
+    		<interceptor-order>
+                <interceptor-class>org.jboss.ejb3.test.interceptors.common.CommonInterceptor</interceptor-class>
+            </interceptor-order>
+    	</interceptor-binding>
     </assembly-descriptor>
 </ejb-jar>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/proxyinstanceadvisor/jboss-aop.xml
===================================================================
--- projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/proxyinstanceadvisor/jboss-aop.xml	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/interceptors/src/test/resources/proxyinstanceadvisor/jboss-aop.xml	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,5 +1,7 @@
 <aop>
+
    <interceptor name="SimplePoolInterceptor" class="org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.SimplePoolInterceptor" scope="PER_VM"/>  
+   <interceptor name="ManagedObjectAdvisorInstanceInterceptor" class="org.jboss.ejb3.interceptors.aop.ManagedObjectAdvisorInstanceInterceptor" scope="PER_VM"/>  
    <interceptor name="PerInstanceInterceptor" class="org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.PerInstanceInterceptor" scope="PER_INSTANCE"/>  
    <interceptor name="PerJoinpointInterceptor" class="org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.PerJoinpointInterceptor" scope="PER_JOINPOINT"/>  
 	
@@ -7,6 +9,7 @@
 	<domain name="InterceptorContainer">			
 		<bind pointcut="execution(* @org.jboss.ejb3.interceptors.ManagedObject->*(..))">
 		   <interceptor-ref name="SimplePoolInterceptor"/>
+		   <interceptor-ref name="ManagedObjectAdvisorInstanceInterceptor"/>
 		   <interceptor-ref name="PerInstanceInterceptor"/>
 		   <interceptor-ref name="PerJoinpointInterceptor"/>
 		</bind>

Modified: projects/ejb3/dev/ejbthree1269/locator/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/locator/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/locator/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,16 +1,16 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
-  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
-  <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"/>
-  <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar"/>
-  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.12/log4j-1.2.12.jar"/>
-  <classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar" sourcepath="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar" sourcepath="M2_REPO/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.12/log4j-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/locator/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/locator/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/locator/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<projectDescription>
-  <name>jboss-ejb3-locator</name>
-  <comment>JBoss EJB 3.0 Client-Side Service Locator</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-locator</name>
+  <comment>JBoss EJB 3.0 Client-Side Service Locator</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/metadata/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/metadata/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/metadata/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,37 +1,36 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
-  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.0.5/jaxb-api-2.0.5.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR7/jboss-aop-2.0.0.CR7.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-core/2.0.3.GA/jboss-common-core-2.0.3.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.4.GA/jboss-common-core-2.2.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta9/jboss-container-2.0.0.Beta9.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/ejb3/jboss-ejb3-ext-api/0.3/jboss-ejb3-ext-api-0.3.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/ejb3/jboss-ejb3-ext-api-impl/0.3/jboss-ejb3-ext-api-impl-0.3.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-javaee/5.0.0.Beta3/jboss-javaee-5.0.0.Beta3.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-jaxws/2.0.1.GA/jboss-jaxws-2.0.1.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.2.GA/jboss-logging-spi-2.0.2.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-metadata/1.0.0.Beta6/jboss-metadata-1.0.0.Beta6.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-vfs/2.0.0.Beta4/jboss-vfs-2.0.0.Beta4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jbossws-spi/1.0.0.GA/jbossws-spi-1.0.0.GA.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR5/jbossxb-2.0.0.CR5.jar"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
-  <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6/qdox-1.6.jar"/>
-  <classpathentry kind="var" path="M2_REPO/trove/trove/1.0.2/trove-1.0.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-slide/webdavlib/2.0/webdavlib-2.0.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/tests-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar" sourcepath="M2_REPO/ant/ant/1.6.5/ant-1.6.5-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA.jar" sourcepath="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR7/jboss-aop-2.0.0.CR7.jar" sourcepath="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR7/jboss-aop-2.0.0.CR7-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta9/jboss-container-2.0.0.Beta9.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta9/jboss-container-2.0.0.Beta9-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-ejb-api/3.0.0.Beta3Update1/jboss-ejb-api-3.0.0.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/ejb3/jboss-ejb3-ext-api/0.3/jboss-ejb3-ext-api-0.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/ejb3/jboss-ejb3-ext-api-impl/0.3/jboss-ejb3-ext-api-impl-0.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-javaee/5.0.0.Beta3Update1/jboss-javaee-5.0.0.Beta3Update1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-jaxws/2.0.1.GA/jboss-jaxws-2.0.1.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.3.GA/jboss-logging-spi-2.0.3.GA.jar" sourcepath="M2_REPO/jboss/jboss-logging-spi/2.0.3.GA/jboss-logging-spi-2.0.3.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/metadata/jboss-metadata/1.0.0.Beta7/jboss-metadata-1.0.0.Beta7.jar" sourcepath="M2_REPO/org/jboss/metadata/jboss-metadata/1.0.0.Beta7/jboss-metadata-1.0.0.Beta7-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.0.Beta11/jboss-reflect-2.0.0.Beta11.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1.jar" sourcepath="M2_REPO/org/jboss/javaee/jboss-transaction-api/1.0.1.Beta3Update1/jboss-transaction-api-1.0.1.Beta3Update1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-vfs/2.0.0.Beta10/jboss-vfs-2.0.0.Beta10.jar" sourcepath="M2_REPO/org/jboss/jboss-vfs/2.0.0.Beta10/jboss-vfs-2.0.0.Beta10-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/ws/jbossws-spi/1.0.2.GA/jbossws-spi-1.0.2.GA.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR8/jbossxb-2.0.0.CR8.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.0.CR8/jbossxb-2.0.0.CR8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6/qdox-1.6.jar" sourcepath="M2_REPO/qdox/qdox/1.6/qdox-1.6-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/trove/trove/1.0.2/trove-1.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/metadata/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/metadata/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/metadata/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,14 +1,14 @@
-<projectDescription>
-  <name>jboss-ejb3-metadata</name>
+<projectDescription>
+  <name>jboss-ejb3-metadata</name>
   <comment>The JBoss EJB 3 Meta Data component implements the meta data retrieval
-    bridge between jboss-metadata and annotations.</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
-</projectDescription>
+    bridge between jboss-metadata and annotations.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/pool/.classpath
===================================================================
--- projects/ejb3/dev/ejbthree1269/pool/.classpath	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/pool/.classpath	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,7 +1,7 @@
-<classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
-  <classpathentry kind="output" path="target/classes"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/tests-classes"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
 </classpath>
\ No newline at end of file

Modified: projects/ejb3/dev/ejbthree1269/pool/.project
===================================================================
--- projects/ejb3/dev/ejbthree1269/pool/.project	2008-04-16 15:42:56 UTC (rev 72291)
+++ projects/ejb3/dev/ejbthree1269/pool/.project	2008-04-16 15:51:56 UTC (rev 72292)
@@ -1,13 +1,13 @@
-<projectDescription>
-  <name>jboss-ejb3-pool</name>
-  <comment>JBoss EJB 3.0 Pool classes for SLSBs</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+<projectDescription>
+  <name>jboss-ejb3-pool</name>
+  <comment>JBoss EJB 3.0 Pool classes for SLSBs</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
 </projectDescription>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list