[jboss-cvs] JBossAS SVN: r114667 - in branches/JBPAPP_5/testsuite: imports/sections and 12 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 20 06:03:23 EST 2014


Author: zroubali
Date: 2014-01-20 06:03:22 -0500 (Mon, 20 Jan 2014)
New Revision: 114667

Added:
   branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/
   branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/DefaultSecurityUnitTestCase.java
   branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/
   branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/
   branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBean.java
   branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBeanRemote.java
   branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/
   branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/
   branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/MANIFEST.MF
   branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/ejb-jar.xml
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/login-config.xml
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/
   branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml
Modified:
   branches/JBPAPP_5/testsuite/build.xml
   branches/JBPAPP_5/testsuite/imports/sections/ejb3.xml
Log:
JBPAPP-9411 JBQA-8608 Test to ensure that when using an empty ejb-jar.xml file in an application the default EJB3 security does not get ignored

Modified: branches/JBPAPP_5/testsuite/build.xml
===================================================================
--- branches/JBPAPP_5/testsuite/build.xml	2014-01-20 10:56:49 UTC (rev 114666)
+++ branches/JBPAPP_5/testsuite/build.xml	2014-01-20 11:03:22 UTC (rev 114667)
@@ -1800,20 +1800,32 @@
 
    <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="Replacing hornetq-roles and hornetq-users.properties used for tests"/>
    	
- 	  <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"/>
+	<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" 
+				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" 
+				tofile="${jboss.dist}/server/${conf}/conf/props/hornetq-users.properties" overwrite="true"/>
+   	
+   	<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"/> 
     
- 	  <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>
@@ -1835,7 +1847,25 @@
       <antcall target="tests-webservice" />
       <antcall target="tests-ws" />
       <antcall target="tests-aspects"/>
-      <server:stop name="${conf}"/>
+      <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"/>
+   	   	
+   	 	<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" 
+   	 	  	  tofile="${jboss.dist}/server/${conf}/conf/props/hornetq-users.properties" overwrite="true"/>
    </target>
    
    <target name="security-basic-tests"

Modified: branches/JBPAPP_5/testsuite/imports/sections/ejb3.xml
===================================================================
--- branches/JBPAPP_5/testsuite/imports/sections/ejb3.xml	2014-01-20 10:56:49 UTC (rev 114666)
+++ branches/JBPAPP_5/testsuite/imports/sections/ejb3.xml	2014-01-20 11:03:22 UTC (rev 114667)
@@ -279,7 +279,18 @@
             </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,
 			ejb3iiop,
@@ -292,7 +303,8 @@
 			jbpapp6953,
 			jboss51xsd,
 			jbpapp-6855,
-            jbpapp8035">
+            jbpapp8035,
+			jbpapp9411">
 		<mkdir dir="${build.lib}" />
 
 		<!-- A jar with a simple ejb3 session -->

Added: branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/DefaultSecurityUnitTestCase.java
===================================================================
--- branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/DefaultSecurityUnitTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/DefaultSecurityUnitTestCase.java	2014-01-20 11:03:22 UTC (rev 114667)
@@ -0,0 +1,92 @@
+/*
+ * 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 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.CalculatorBeanRemote;
+
+import javax.ejb.EJBAccessException;
+import javax.naming.InitialContext;
+
+
+/**
+ * @author <a href="mailto:ehugonne at redhat.com">Emmanuel Hugonnet</a> (c) 2013 Red Hat, inc.
+ * @author <a href="mailto:zroubali at redhat.com">Zbynek Roubalik</a> (c) 2014 Red Hat, inc.
+ */
+public class DefaultSecurityUnitTestCase extends JBossTestCase {
+
+    public DefaultSecurityUnitTestCase(String name) {
+        super(name);
+    }
+
+    public static Test suite() throws Exception {
+        return getDeploySetup(DefaultSecurityUnitTestCase.class, "jbpapp9411.jar");
+    }
+
+    public void testUnauthentifiedSession() throws Exception {
+        InitialContext ctx = new InitialContext();
+
+        CalculatorBeanRemote calculator = (CalculatorBeanRemote) ctx.lookup("org/jboss/qa/jee/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 testAuthenticationNonExistingUser() throws Exception {
+        SecurityClient securityClient = SecurityClientFactory.getSecurityClient();
+        try {
+            securityClient.setSimple("nonexisting", "user");
+            securityClient.login();
+            try {
+                InitialContext ctx = new InitialContext();
+                CalculatorBeanRemote calculator = (CalculatorBeanRemote) ctx.lookup("org/jboss/qa/jee/CalculatorBean");
+                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()));
+            }
+        } finally {
+            securityClient.logout();
+        }
+    }
+
+    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("org/jboss/qa/jee/CalculatorBean");
+            calculator.add(1, 1);
+        } catch (EJBAccessException ex) {
+            failure("Shoud be authorized.", ex);
+        } finally {
+            securityClient.logout();
+        }
+    }
+}

Added: branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBean.java
===================================================================
--- branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBean.java	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBean.java	2014-01-20 11:03:22 UTC (rev 114667)
@@ -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 org.jboss.logging.Logger;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+
+/**
+ *
+ * @author <a href="mailto:ehugonne at redhat.com">Emmanuel Hugonnet</a> (c) 2013 Red Hat, inc.
+ * @author <a href="mailto:zroubali at redhat.com">Zbynek Roubalik</a> (c) 2014 Red Hat, inc.
+ */
+ at RolesAllowed({"WTF"})
+ at Stateless(name = "CalculatorBean", mappedName = "org/jboss/qa/jee/CalculatorBean")
+public class CalculatorBean implements CalculatorBeanRemote {
+
+    @Resource
+    SessionContext sessionContext;
+
+    public static final Logger log = Logger.getLogger(CalculatorBean.class);
+
+    @Override
+    public int add(int x, int y) {
+        log.info("Bean was accessed by user " + sessionContext.getCallerPrincipal().getName());
+        return x + y;
+    }
+
+}

Added: branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBeanRemote.java
===================================================================
--- branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBeanRemote.java	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/main/org/jboss/test/ejb3/jbpapp9411/calculator/bean/CalculatorBeanRemote.java	2014-01-20 11:03:22 UTC (rev 114667)
@@ -0,0 +1,34 @@
+/*
+ * 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 at redhat.com">Emmanuel Hugonnet</a> (c) 2013 Red Hat, inc.
+ * @author <a href="mailto:zroubali at redhat.com">Zbynek Roubalik</a> (c) 2014 Red Hat, inc.
+ */
+ at Remote
+public interface CalculatorBeanRemote {
+
+    int add(final int x, final int y);
+}

Added: branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/MANIFEST.MF
===================================================================
--- branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/MANIFEST.MF	2014-01-20 11:03:22 UTC (rev 114667)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+

Added: branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/ejb-jar.xml
===================================================================
--- branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/ejb-jar.xml	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/resources/ejb3/jbpapp9411/META-INF/ejb-jar.xml	2014-01-20 11:03:22 UTC (rev 114667)
@@ -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>

Added: branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/login-config.xml
===================================================================
--- branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/login-config.xml	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/login-config.xml	2014-01-20 11:03:22 UTC (rev 114667)
@@ -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 at 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>
+

Added: branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties
===================================================================
--- branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-roles.properties	2014-01-20 11:03:22 UTC (rev 114667)
@@ -0,0 +1,3 @@
+# A sample roles.properties file for use with the UsersRolesLoginModule
+admin=JBossAdmin,HttpInvoker
+wtf=WTF
\ No newline at end of file

Added: branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties
===================================================================
--- branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/conf/props/wtf-users.properties	2014-01-20 11:03:22 UTC (rev 114667)
@@ -0,0 +1,3 @@
+# A sample users.properties file for use with the UsersRolesLoginModule
+admin=admin
+wtf=wtf
\ No newline at end of file

Added: branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml
===================================================================
--- branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml	                        (rev 0)
+++ branches/JBPAPP_5/testsuite/src/resources/test-configs/default_ejb_security_domain/deploy/ejb3-interceptors-aop.xml	2014-01-20 11:03:22 UTC (rev 114667)
@@ -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(org.jboss.test.ejb3.jbpapp9411.calculator.bean.*) 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>



More information about the jboss-cvs-commits mailing list