Index: component-matrix/pom.xml
===================================================================
--- component-matrix/pom.xml	(révision 114545)
+++ component-matrix/pom.xml	(copie de travail)
@@ -72,7 +72,7 @@
     <version.org.jboss.common.core>2.2.21.GA</version.org.jboss.common.core>
     <version.org.jboss.common.beans>1.0.1.Final</version.org.jboss.common.beans>
     <version.org.jboss.deployers>2.0.10.GA</version.org.jboss.deployers>
-    <version.org.jboss.ejb3.bom>1.0.4</version.org.jboss.ejb3.bom>
+    <version.org.jboss.ejb3.bom>1.0.5-SNAPSHOT</version.org.jboss.ejb3.bom>
     <version.org.jboss.integration>5.1.0.SP1</version.org.jboss.integration>
     <version.org.jboss.jbossxb>2.0.1.GA</version.org.jboss.jbossxb>
     <version.org.jboss.jopr>1.3.4.SP6</version.org.jboss.jopr>    
Index: testsuite/build.xml
===================================================================
--- testsuite/build.xml	(révision 114545)
+++ testsuite/build.xml	(copie de travail)
@@ -1606,6 +1606,13 @@
       <patternset refid="ewp.excludes"/>
    </patternset>
 
+   <patternset id="jbpapp9411.excludes">
+      <exclude name="org/jboss/test/ejb3/jbpapp9411/**"/>
+   </patternset>
+   <patternset id="jbpapp9411.includes">
+      <include name="org/jboss/test/ejb3/jbpapp9411/*UnitTestCase.class"/>
+   </patternset>
+
    <patternset id="aop-with-classloader.excludes">
       <!-- Needs to be started either with the bootclasspath or -javaagent classloader hooks -->
       <exclude name="org/jboss/test/aop/test/Scoped*.class"/>
@@ -1636,6 +1643,7 @@
       <patternset refid="profileservice.restart.excludes"/>
       <patternset refid="jbossmessaging.excludes"/>
       <patternset refid="springdeployer.excludes"/>
+      <patternset refid="jbpapp9411.excludes" />
    </patternset>   
 	
 	<!-- A placeholder patternset -->
@@ -1798,20 +1806,49 @@
 
    <target name="jboss-all-config-tests"
       description="The units tests which are run against the jboss all config" depends="init">
-   	
 
    	<!-- Default configuration to run the tests against -->
    	<property name="conf" value="all"/>
+
+   	<echo message="Configuring default security domain for EJBs"/>
+         
+    <copy file="${module.output}/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties" 
+    		tofile="${jboss.dist}/server/${conf}/conf/props/wtf-roles.properties" overwrite="true"/>       
+    <copy file="${module.output}/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties" 
+        	tofile="${jboss.dist}/server/${conf}/conf/props/wtf-users.properties" overwrite="true"/>
+    <copy file="${jboss.dist}/server/${conf}/conf/login-config.xml" 
+    		tofile="${jboss.dist}/server/${conf}/conf/login-config.backup" overwrite="true"/>      
+    <copy file="${module.output}/resources/test-configs/default_ejb_security_domain/conf/login-config.xml" 
+        	tofile="${jboss.dist}/server/${conf}/conf/login-config.xml" overwrite="true"/>
+    <copy file="${jboss.dist}/server/${conf}/deploy/ejb3-interceptors-aop.xml" 
+        	tofile="${jboss.dist}/server/ejb3-interceptors-aop.backup" overwrite="true"/>      
+    <copy file="${module.output}/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml" 
+        	tofile="${jboss.dist}/server/${conf}/deploy/ejb3-interceptors-aop.xml" overwrite="true"/> 
+    
+    <server:start name="${conf}"/>
+    	<antcall target="test-jbpapp9411" />
+    <server:stop name="${conf}"/>
+
+    <echo message="Cleaning default security domain for EJBs"/>
+    <delete file="${jboss.dist}/server/${conf}/conf/props/wtf-users.properties"/>
+    <delete file="${jboss.dist}/server/${conf}/conf/props/wtf-roles.properties"/>
+    <copy file="${jboss.dist}/server/ejb3-interceptors-aop.backup" 
+    		tofile="${jboss.dist}/server/${conf}/deploy/ejb3-interceptors-aop.xml" overwrite="true"/> 
+     <copy file="${jboss.dist}/server/${conf}/conf/login-config.backup" 
+     		tofile="${jboss.dist}/server/${conf}/conf/login-config.xml" overwrite="true"/>
+     <delete file="${jboss.dist}/server/ejb3-interceptors-aop.backup"/>
+     <delete file="${jboss.dist}/server/${conf}/conf/login-config.backup"/>
    	       
-   	  <echo message="Replacing hornetq-roles and hornetq-users.properties used for tests"/>
+   	<echo message="Replacing hornetq-roles and hornetq-users.properties used for tests"/>
    	
- 	  <copy file="${module.output}/resources/test-configs/jbossmessaging/conf/props/hornetq-roles.properties" 
+ 	<copy file="${module.output}/resources/test-configs/jbossmessaging/conf/props/hornetq-roles.properties" 
  	  	  tofile="${jboss.dist}/server/${conf}/conf/props/hornetq-roles.properties" overwrite="true"/>
     
- 	  <copy file="${module.output}/resources/test-configs/jbossmessaging/conf/props/hornetq-users.properties" 
+ 	<copy file="${module.output}/resources/test-configs/jbossmessaging/conf/props/hornetq-users.properties" 
  	  	  tofile="${jboss.dist}/server/${conf}/conf/props/hornetq-users.properties" overwrite="true"/>
+   	
     
-   	  <server:start name="${conf}"/>
+   	<server:start name="${conf}"/>
       <antcall target="tests-standard-unit">
          <param name="custom.excludes" value="ec2.excludes"/>
       </antcall>
@@ -1833,7 +1870,7 @@
       <antcall target="tests-webservice" />
       <antcall target="tests-ws" />
       <antcall target="tests-aspects"/>
-      <server:stop name="${conf}"/>
+      <server:stop name="${conf}"/> 
    </target>
    
    <target name="security-basic-tests"
@@ -2840,6 +2877,66 @@
       </junit>
    </target>
 
+   <target name="test-jbpapp9411">
+      <echo><![CDATA[
+   test-jbpapp9411
+   junit.timeout:              ${junit.timeout}
+   jbosstest.iterationcount:   ${jbosstest.iterationcount}
+   jbosstest.threadcount:      ${jbosstest.threadcount}
+   jbosstest.beancount:        ${jbosstest.beancount}
+         ]]></echo>
+   
+   
+      <property name="custom.excludes" value="empty.patternset"/>
+   
+      <mkdir dir="${build.reports}"/>
+      <mkdir dir="${build.testlog}"/>
+      <junit dir="${module.output}"
+         printsummary="${junit.printsummary}"
+         haltonerror="${junit.haltonerror}"
+         showoutput="${junit.showoutput}"
+         haltonfailure="${junit.haltonfailure}"
+         fork="${junit.fork}"
+         timeout="${junit.timeout}"
+         jvm="${junit.jvm}">
+         
+         <jvmarg line="${junit.jvm.options}"/>
+         <!-- Used for JGroups -->
+         <jvmarg value="-Dbind.address=${node0}"/>
+         <sysproperty key="jboss.dist" value="${jboss.dist}"/>
+         <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/>
+         <sysproperty key="build.testlog" value="${build.testlog}"/>
+          <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.virtual.protocol"/>
+         <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
+         <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed"/>
+         <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
+         <sysproperty key="jbosstest.server.host" value="${node0}"/>
+         <sysproperty key="jbosstest.useJBM" value="true"/>
+
+          <!-- Pass along any jbosstest.* system properties -->
+         <syspropertyset>
+            <propertyref prefix="jbosstest."/>
+         </syspropertyset>
+         <classpath>
+            <pathelement location="${build.classes}"/>
+            <pathelement location="${build.resources}"/>
+            <path refid="tests.classpath"/>
+         </classpath>
+
+         <formatter type="xml" usefile="${junit.formatter.usefile}"/>
+
+         <batchtest todir="${build.reports}"
+            haltonerror="${junit.batchtest.haltonerror}"
+            haltonfailure="${junit.batchtest.haltonfailure}"
+            fork="${junit.batchtest.fork}">
+
+            <fileset dir="${build.classes}">               
+               <patternset refid="jbpapp9411.includes"/>
+            </fileset>
+         </batchtest>
+      </junit>
+   </target>
+
    <!--
       | Standard tests that should run successfully against a default JBoss
       | server distribution build.
Index: testsuite/imports/sections/ejb3.xml
===================================================================
--- testsuite/imports/sections/ejb3.xml	(révision 114545)
+++ testsuite/imports/sections/ejb3.xml	(copie de travail)
@@ -279,6 +279,17 @@
             </fileset>
         </jar>
     </target>
+	
+	<target name="jbpapp9411" depends="compile">
+	      <mkdir dir="${build.lib}"/>
+
+	      <jar destfile="${build.lib}/jbpapp9411.jar">
+	         <fileset dir="${build.classes}">
+	            <include name="org/jboss/test/ejb3/jbpapp9411/calculator/bean/**"/>
+	         </fileset>
+	         <zipfileset prefix="META-INF" dir="${source.resources}/ejb3/jbpapp9411/META-INF" includes="**"/>
+	      </jar>
+	   </target>
 
 	<target name="_jars-ejb3" depends="ejb3-servlet,jbas6161,jbas6239,ejbthree1597,jbas5713,
 		    jbas7883,
@@ -292,7 +303,8 @@
 			jbpapp6953,
 			jboss51xsd,
 			jbpapp-6855,
-            jbpapp8035">
+            jbpapp8035,
+			jbpapp9411">
 		<mkdir dir="${build.lib}" />
 
 		<!-- A jar with a simple ejb3 session -->
Index: testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/DefaultSecurityUnitTestCase.java
===================================================================
--- testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/DefaultSecurityUnitTestCase.java	(révision 0)
+++ testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/DefaultSecurityUnitTestCase.java	(copie de travail)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.test.ejb3.jbpapp9411;
+
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.security.client.SecurityClient;
+import org.jboss.security.client.SecurityClientFactory;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.ejb3.jbpapp9411.calculator.bean.CalculatorBean;
+import org.jboss.test.ejb3.jbpapp9411.calculator.bean.CalculatorBeanRemote;
+
+
+/**
+ * @author <a href="mailto:ehugonne@redhat.com">Emmanuel Hugonnet</a> (c) 2013 Red Hat, inc.
+ */
+public class DefaultSecurityUnitTestCase extends JBossTestCase {
+	public static Test suite() throws Exception {
+		Test t1 = getDeploySetup(DefaultSecurityUnitTestCase.class, "jbpapp9411.jar");
+		return t1;
+	}
+
+	public DefaultSecurityUnitTestCase(String name) {
+		super(name);
+	}
+
+	public void testUnauthentifiedSession() throws Exception {
+		InitialContext ctx = new InitialContext();
+
+		CalculatorBeanRemote calculator = (CalculatorBeanRemote) ctx
+				.lookup("com/redhat/jee/Arte/MyLab/CalculatorBean");
+		try {
+			calculator.add(1, 1);
+			fail("Shoudn't be authorized");
+		} catch(javax.ejb.EJBAccessException ex) {
+			assertTrue("Caller unauthorized".equals(ex.getMessage()) || "Invalid User".equals(ex.getMessage()));
+		}
+	}
+
+	public void testAuthentication() throws Exception {
+		SecurityClient securityClient = SecurityClientFactory.getSecurityClient();
+		try {
+			securityClient.setSimple("wtf", "wtf");
+			securityClient.login();
+			InitialContext ctx = new InitialContext();
+			CalculatorBeanRemote calculator = (CalculatorBeanRemote) ctx
+					.lookup("com/redhat/jee/Arte/MyLab/CalculatorBean");
+			System.out.println("1 + 1 = " + calculator.add(1, 1));
+			System.out.println("1 - 1 = " + calculator.subtract(1, 1));
+
+		} finally {
+			securityClient.logout();
+		}
+	}
+}
Index: testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBean.java
===================================================================
--- testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBean.java	(révision 0)
+++ testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBean.java	(copie de travail)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2013 Red Hat, inc., 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 library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301  USA
+ */
+package org.jboss.test.ejb3.jbpapp9411.calculator.bean;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+
+/**
+ *
+ * @author <a href="mailto:ehugonne@redhat.com">Emmanuel Hugonnet</a> (c) 2013 Red Hat, inc.
+ */
+//@SecurityDomain("wtf")
+@RolesAllowed({"WTF"})
+@Stateless(name = "CalculatorBean", mappedName = "com/redhat/jee/Arte/MyLab/CalculatorBean")
+public class CalculatorBean implements CalculatorBeanRemote {
+
+    @Resource
+    SessionContext sessionContext;
+
+    @Override
+    public int add(int x, int y) {
+        System.out.println(">>>>>>>>>>> " + sessionContext.getCallerPrincipal().getName());
+        return x + y;
+    }
+
+    @Override
+    public int subtract(int x, int y) {
+        return x - y;
+    }
+}
Index: testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBeanRemote.java
===================================================================
--- testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBeanRemote.java	(révision 0)
+++ testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBeanRemote.java	(copie de travail)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 Red Hat, inc., 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 library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301  USA
+ */
+package org.jboss.test.ejb3.jbpapp9411.calculator.bean;
+
+import javax.ejb.Remote;
+
+/**
+ *
+ * @author <a href="mailto:ehugonne@redhat.com">Emmanuel Hugonnet</a> (c) 2013 Red Hat, inc.
+ */
+@Remote
+public interface CalculatorBeanRemote {
+
+    int add(final int x, final int y);
+
+    int subtract(final int x, final int y);
+
+}
Index: testsuite/src/resources/ejb3/jbpapp9411/META-INF/MANIFEST.MF
===================================================================
--- testsuite/src/resources/ejb3/jbpapp9411/META-INF/MANIFEST.MF	(révision 0)
+++ testsuite/src/resources/ejb3/jbpapp9411/META-INF/MANIFEST.MF	(copie de travail)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Index: testsuite/src/resources/ejb3/jbpapp9411/META-INF/ejb-jar.xml
===================================================================
--- testsuite/src/resources/ejb3/jbpapp9411/META-INF/ejb-jar.xml	(révision 0)
+++ testsuite/src/resources/ejb3/jbpapp9411/META-INF/ejb-jar.xml	(copie de travail)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee" 
+         version = "3.0" 
+         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">
+</ejb-jar>
Index: testsuite/src/resources/test-configs/default_ejb_security_domain/conf/login-config.xml
===================================================================
--- testsuite/src/resources/test-configs/default_ejb_security_domain/conf/login-config.xml	(révision 0)
+++ testsuite/src/resources/test-configs/default_ejb_security_domain/conf/login-config.xml	(copie de travail)
@@ -0,0 +1,142 @@
+<?xml version='1.0'?>
+
+<!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+  <authentication>
+    <login-module code="login.module1.class.name" flag="control_flag">
+      <module-option name = "option1-name">option1-value</module-option>
+      <module-option name = "option2-name">option2-value</module-option>
+      ...
+    </login-module>
+
+    <login-module code="login.module2.class.name" flag="control_flag">
+      ...
+    </login-module>
+    ...
+  </authentication>
+</application-policy>
+
+$Id: login-config.xml 113840 2012-11-23 18:19:12Z fnasser@redhat.com $
+$Revision: 113840 $
+-->
+
+<policy>
+  <!-- Used by clients within the application server VM such as
+  mbeans and servlets that access EJBs.
+  -->
+  <application-policy name="client-login">
+    <authentication>
+      <login-module code="org.jboss.security.ClientLoginModule"
+        flag="required">
+         <!-- Any existing security context will be restored on logout -->
+         <module-option name="restore-login-identity">true</module-option>
+      </login-module>
+    </authentication>
+  </application-policy>
+
+  <!-- Security domains for testing new jca framework -->
+  <application-policy name="HsqlDbRealm">
+    <authentication>
+      <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule"
+        flag="required">
+        <module-option name="principal">sa</module-option>
+        <module-option name="userName">sa</module-option>
+        <module-option name="password"></module-option>
+        <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
+      </login-module>
+    </authentication>
+  </application-policy>
+
+  <application-policy name="JmsXARealm">
+    <authentication>
+      <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule"
+        flag="required">
+        <module-option name="principal">guest</module-option>
+        <module-option name="userName">guest</module-option>
+        <module-option name="password">guest</module-option>
+        <module-option name="managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
+      </login-module>
+    </authentication>
+  </application-policy>
+
+  <!-- A template configuration for the jmx-console web application. This
+    defaults to the UsersRolesLoginModule the same as other and should be
+    changed to a stronger authentication mechanism as required.
+  -->
+  <application-policy name="jmx-console">
+    <authentication>
+      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+        flag="required">
+        <module-option name="usersProperties">props/jmx-console-users.properties</module-option>
+        <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
+      </login-module>
+    </authentication>
+  </application-policy>
+
+  <!-- A template configuration for the web-console web application. This
+    defaults to the UsersRolesLoginModule the same as other and should be
+    changed to a stronger authentication mechanism as required.
+  -->
+  <application-policy name="web-console">
+    <authentication>
+      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+        flag="required">
+        <module-option name="usersProperties">web-console-users.properties</module-option>
+        <module-option name="rolesProperties">web-console-roles.properties</module-option>
+      </login-module>
+    </authentication>
+  </application-policy>
+
+  <!--
+    A template configuration for the JBossWS security domain.
+    This defaults to the UsersRolesLoginModule the same as other and should be
+    changed to a stronger authentication mechanism as required.
+  -->
+  <application-policy name="JBossWS">
+    <authentication>
+      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+        flag="required">
+        <module-option name="usersProperties">props/jbossws-users.properties</module-option>
+        <module-option name="rolesProperties">props/jbossws-roles.properties</module-option>
+        <module-option name="unauthenticatedIdentity">anonymous</module-option>
+      </login-module>
+    </authentication>
+  </application-policy>
+
+  <!-- The default login configuration used by any security domain that
+  does not have a application-policy entry with a matching name
+  -->
+  <application-policy name="other">
+    <!-- A simple server login module, which can be used when the number
+    of users is relatively small. It uses two properties files:
+    users.properties, which holds users (key) and their password (value).
+    roles.properties, which holds users (key) and a comma-separated list of
+    their roles (value).
+    The unauthenticatedIdentity property defines the name of the principal
+    that will be used when a null username and password are presented as is
+    the case for an unuathenticated web client or MDB. If you want to
+    allow such users to be authenticated add the property, e.g.,
+    unauthenticatedIdentity="nobody"
+    -->
+    <authentication>
+      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+        flag="required"/>
+    </authentication>
+  </application-policy>
+  
+  <application-policy name="wtf">
+    <authentication>
+      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+        flag="required">
+        <module-option name="usersProperties">props/wtf-users.properties</module-option>
+        <module-option name="rolesProperties">props/wtf-roles.properties</module-option>
+      </login-module>
+    </authentication>
+  </application-policy>
+
+</policy>
+
Index: testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties
===================================================================
--- testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties	(révision 0)
+++ testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties	(copie de travail)
@@ -0,0 +1,3 @@
+# A sample roles.properties file for use with the UsersRolesLoginModule
+admin=JBossAdmin,HttpInvoker
+wtf=WTF
\ Pas de fin de ligne à la fin du fichier
Index: testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties
===================================================================
--- testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties	(révision 0)
+++ testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties	(copie de travail)
@@ -0,0 +1,3 @@
+# A sample users.properties file for use with the UsersRolesLoginModule
+admin=admin
+wtf=wtf
\ Pas de fin de ligne à la fin du fichier
Index: testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml
===================================================================
--- testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml	(révision 0)
+++ testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml	(copie de travail)
@@ -0,0 +1,530 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <interceptor class="org.jboss.aspects.remoting.InvokeRemoteInterceptor" 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"/>
+   <interceptor class="org.jboss.aspects.remoting.ClusterChooserInterceptor" scope="PER_VM"/>
+
+   <interceptor class="org.jboss.aspects.tx.TxPropagationInterceptor" scope="PER_VM"/>
+
+   <stack name="ServiceClientInterceptors">
+      <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+      <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.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.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.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"/>
+   </stack>
+
+   <stack name="ClusteredStatefulSessionClientInterceptors">
+      <interceptor-ref name="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor"/>
+      <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"/>
+   </stack>
+
+   <interceptor class="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.ENCPropagationInterceptor" scope="PER_VM"/>
+   <interceptor name="Basic Authorization" factory="org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor name="JACC Authorization" factory="org.jboss.ejb3.security.JaccAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor factory="org.jboss.ejb3.security.AuthenticationInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor factory="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor class="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.stateful.StatefulInstanceInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.service.ServiceSingletonInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.cache.StatefulReplicationInterceptor" scope="PER_VM"/>
+   <interceptor factory="org.jboss.ejb3.stateful.StatefulRemoveFactory" scope="PER_CLASS_JOINPOINT"/>
+   <interceptor factory="org.jboss.ejb3.tx.BMTTxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
+   <interceptor factory="org.jboss.ejb3.tx.CMTTxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
+   <!-- interceptor factory="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory" scope="PER_CLASS_JOINPOINT"/ -->
+   <interceptor factory="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor class="org.jboss.ejb3.AllowedOperationsInterceptor" scope="PER_VM"/>
+   <interceptor factory="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor class="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.ejb3.BlockContainerShutdownInterceptor" scope="PER_VM"/>
+   <interceptor factory="org.jboss.ejb3.connectionmanager.CachedConnectionInterceptorFactory" scope="PER_CLASS"/>
+    <interceptor class="org.jboss.ejb3.interceptor.EJB3TCCLInterceptor" scope="PER_VM"/>
+   <interceptor name="EnlistTimerInterceptor" class="org.jboss.ejb3.core.timer.EnlistTimerInterceptor" scope="PER_VM"/>
+   <!--
+         INTERCEPTORS
+     -->
+
+   <aspect name="InjectInterceptorsFactory" factory="org.jboss.ejb3.interceptors.aop.InjectInterceptorsFactory" scope="PER_JOINPOINT"/>
+   <!--  EJBTHREE-1841 No longer needed in core
+   <aspect name="InterceptorsFactory" factory="org.jboss.ejb3.interceptors.aop.InterceptorsFactory" scope="PER_INSTANCE"/> -->
+   <aspect name="InvocationContextInterceptor" class="org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor" scope="PER_VM"/>
+   <interceptor name="CurrentInvocationContextInterceptor" class="org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor" scope="PER_VM"/>
+
+   <!-- TODO: this is actually the bootstrap container -->
+   <domain name="Intercepted Bean">
+      <pointcut name="beanAroundInvokeCallbackMethods" expr="execution(* @org.jboss.ejb3.interceptors.ManagedObject->@javax.interceptor.AroundInvoke(..))"/>
+      <pointcut name="beanPostConstructCallbackMethods" expr="execution(* @org.jboss.ejb3.interceptors.ManagedObject->@javax.interceptor.PostConstruct(..))"/>
+      <pointcut name="beanPreDestroyCallbackMethods" expr="execution(* @org.jboss.ejb3.interceptors.ManagedObject->@javax.interceptor.PreDestroy(..))"/>
+
+      <pointcut name="beanLifecycleCallbackMethods" expr="beanAroundInvokeCallbackMethods OR beanPostConstructCallbackMethods OR beanPreDestroyCallbackMethods"/>
+
+      <!-- Prepare for dynamic AOP -->
+      <!-- TODO: optimize, we only need managed objects (and interceptors!) to be aspectized -->
+      <!-- prepare expr="all(*) AND has(@org.jboss.ejb3.interceptors.ManagedObject->new(..))"/ -->
+      <!-- TODO: let's see if we can do without
+      <prepare expr="all(*)"/>
+      -->
+
+      <!-- Setup AOP interceptors based on spec interceptors -->
+      <bind pointcut="construction(@org.jboss.ejb3.interceptors.ManagedObject->new(..))">
+         <!-- interceptor-ref name="LoggingInterceptor"/ -->
+         <!-- TODO: we don't need invocation context here -->
+         <!-- TODO: we do until we've seperated the post constructs -->
+         <advice name="setup" aspect="InvocationContextInterceptor"/>
+         <!-- EJBTHREE-1841 No longer needed in core   
+         <advice name="invoke" aspect="InterceptorsFactory"/> -->
+      </bind>
+
+      <!-- Lifecycle Event Callbacks (EJB 3 12.4) -->
+      <!-- TODO: for now handled in EJBContainer.invokePostConstruct until injection is refactored
+      <bind pointcut="construction(@org.jboss.ejb3.interceptors.ManagedObject->new(..))">
+         <advice name="setup" aspect="InvocationContextInterceptor"/>
+         <advice name="postConstruct" aspect="InjectInterceptorsFactory"/>
+      </bind>
+      -->
+
+      <!-- this is the usual way, now we move it into the other domains, because the
+           invocation of EJB interceptors must be the last in the chain
+      <bind pointcut="execution(* @org.jboss.ejb3.interceptors.ManagedObject->*(..)) AND !beanLifecycleCallbackMethods">
+         <advice name="setup" aspect="InvocationContextInterceptor"/>
+         <advice name="fillMethod" aspect="InvocationContextInterceptor"/>
+         <advice name="aroundInvoke" aspect="InjectInterceptorsFactory"/>
+      </bind>
+      -->
+      <stack name="EJBInterceptors">
+         <interceptor-ref name="org.jboss.ejb3.connectionmanager.CachedConnectionInterceptorFactory"/>
+
+         <advice name="setup" aspect="InvocationContextInterceptor"/>
+         <advice name="fillMethod" aspect="InvocationContextInterceptor"/>
+         <advice name="aroundInvoke" aspect="InjectInterceptorsFactory"/>
+      </stack>
+
+      <bind pointcut="execution(public * *->*(..))">
+        <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3TCCLInterceptor"/>
+         <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+         <interceptor-ref name="CurrentInvocationContextInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.BlockContainerShutdownInterceptor"/>
+      </bind>
+
+      <stack name="InjectionCallbackStack">
+         <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+         <interceptor-ref name="CurrentInvocationContextInterceptor"/>
+      </stack>
+      
+      <stack name="LifecycleCallbackStack">
+         <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+         <advice name="setup" aspect="InvocationContextInterceptor"/>
+         <interceptor-ref name="CurrentInvocationContextInterceptor"/>
+      </stack>
+      
+      <stack name="TimeoutMethodStack">
+        <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3TCCLInterceptor"/>
+        <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+        <interceptor-ref name="CurrentInvocationContextInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.BlockContainerShutdownInterceptor"/>
+        <interceptor-ref name="EnlistTimerInterceptor"/>
+      </stack>
+   </domain>
+
+
+
+   <domain name="Stateless Bean" extends="Intercepted Bean" inheritBindings="true">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+         <interceptor-ref name="Basic Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
+         @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+      </annotation>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.SecurityDomain)">
+          @org.jboss.ejb3.annotation.SecurityDomain (value="wtf")
+      </annotation>
+      
+            
+      <stack name="StatelessBeanTimeoutMethodStack">
+
+      	<!--  Include the common timeout method stack
+      		After JBAS-8130, just use this stack-ref and remove the 4 duplicate listed interceptor-refs
+      		below 
+      	<stack-ref name="TimeoutMethodStack"/> -->
+
+        <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3TCCLInterceptor"/>
+        <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+        <interceptor-ref name="CurrentInvocationContextInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.BlockContainerShutdownInterceptor"/>
+
+      	<!--  The additional SLSB specific ones -->
+		<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+        <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+        <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+        <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+        <interceptor-ref name="EnlistTimerInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+      </stack>
+      
+   </domain>
+
+   <domain name="JACC Stateless Bean" extends="Intercepted Bean" inheritBindings="true">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+         <interceptor-ref name="JACC Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
+         @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+      </annotation>
+   </domain>
+
+   <domain name="Base Stateful Bean" extends="Intercepted Bean" inheritBindings="true">
+      <!-- EJBTHREE-1995: establish a security context during init -->
+      <stack name="HomeCallbackStack">
+         <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+         <!-- advice name="setup" aspect="InvocationContextInterceptor"/ -->
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+      </stack>
+
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+         <interceptor-ref name="Basic Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+      </bind>
+      <!-- EJBTHREE-2020: session synchronization callbacks must be called within a context -->
+      <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+      </bind>
+
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+         <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+      </bind>
+
+      <bind pointcut="execution(public * *->*(..))">
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
+         @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+      </annotation>
+   </domain>
+
+   <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+      <!-- NON Clustered cache configuration -->
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Cache) AND !class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.Cache ("SimpleStatefulCache")
+      </annotation>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.PersistenceManager) AND !class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.PersistenceManager ("StatefulSessionFilePersistenceManager")
+      </annotation>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.CacheConfig) AND !class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+      </annotation>
+
+      <!-- Clustered cache configuration -->
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Cache) AND class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.Cache ("StatefulTreeCache")
+      </annotation>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.CacheConfig) AND class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.CacheConfig (name="sfsb-cache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+      </annotation>
+   </domain>
+
+   <domain name="JACC Stateful Bean" extends="Intercepted Bean" inheritBindings="true">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+         <interceptor-ref name="JACC Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+         <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+      </bind>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
+         @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+      </annotation>
+
+      <!-- NON Clustered cache configuration -->
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Cache) AND !class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.Cache ("SimpleStatefulCache")
+      </annotation>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.PersistenceManager) AND !class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.PersistenceManager ("StatefulSessionFilePersistenceManager")
+      </annotation>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.CacheConfig) AND !class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+      </annotation>
+
+      <!-- Clustered cache configuration -->
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Cache) AND class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.Cache ("StatefulTreeCache")
+      </annotation>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.CacheConfig) AND class(@org.jboss.ejb3.annotation.Clustered)">
+         @org.jboss.ejb3.annotation.CacheConfig (name="sfsb-cache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+      </annotation>
+   </domain>
+
+   <domain name="Embedded Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+      <!-- NON Clustered cache configuration -->
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Cache)">
+         @org.jboss.ejb3.annotation.Cache ("NoPassivationCache")
+      </annotation>
+
+   </domain>
+
+   <domain name="Message Driven Bean" extends="Intercepted Bean" inheritBindings="true">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <!-- TODO: Authorization? -->
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
+         @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
+      </annotation>
+      
+      <stack name="MessageDrivenBeanTimeoutMethodStack">
+
+      	<!--  Include the common timeout method stack
+      		After JBAS-8130, just use this stack-ref and remove the 4 duplicate listed interceptor-refs
+      		below 
+      	<stack-ref name="TimeoutMethodStack"/>
+      	-->
+      	<interceptor-ref name="org.jboss.ejb3.interceptor.EJB3TCCLInterceptor"/>
+        <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+        <interceptor-ref name="CurrentInvocationContextInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.BlockContainerShutdownInterceptor"/>
+
+		<!--  The additional MDB specific ones -->
+		<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+        <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+        <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+        <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+        <interceptor-ref name="EnlistTimerInterceptor"/>
+        <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         
+      	         
+      </stack>
+      
+   </domain>
+
+   <domain name="Consumer Bean" extends="Intercepted Bean" inheritBindings="true">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..)) AND (has(* *->@org.jboss.ejb3.annotation.CurrentMessage(..)) OR hasfield(* *->@org.jboss.ejb3.annotation.CurrentMessage))">
+         <interceptor-ref name="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+      <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)">
+         @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
+      </annotation>
+   </domain>
+
+   <domain name="Service Bean" extends="Intercepted Bean" inheritBindings="true">
+      <!-- Define a  ServiceLifecycleCallbackStack so a tx context is set -->
+      <stack name="ServiceLifecycleCallbackStack">
+         <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
+         <advice name="setup" aspect="InvocationContextInterceptor"/>
+         <!-- TODO: EJB 3.1 PFD 4.8.3: if REQUIRED then interpret as REQUIRES_NEW -->
+         <!-- 
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         -->
+      </stack>
+   
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+      </bind>
+      <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..)) AND !execution(* *->stop()) AND !execution(* *->destroy())">
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop()) AND !execution(* *->destroy())">
+         <interceptor-ref name="Basic Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop())">
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+   </domain>
+
+   <domain name="JACC Service Bean" extends="Intercepted Bean" inheritBindings="true">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+      </bind>
+      <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..)) AND !execution(* *->stop()) AND !execution(* *->destroy())">
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop()) AND !execution(* *->destroy())">
+         <interceptor-ref name="Basic Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+   </domain>
+
+</aop>
