<?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"/>

   <!--
         INTERCEPTORS
     -->

   <aspect name="InjectInterceptorsFactory" factory="org.jboss.ejb3.interceptors.aop.InjectInterceptorsFactory" scope="PER_JOINPOINT"/>
   <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"/>

   <!-- 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"/>
         <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.aspects.currentinvocation.CurrentInvocationInterceptor"/>
         <interceptor-ref name="org.jboss.ejb3.BlockContainerShutdownInterceptor"/>
      </bind>

      <stack name="LifecycleCallbackStack">
         <interceptor-ref name="org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor"/>
         <advice name="setup" aspect="InvocationContextInterceptor"/>
      </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>
   </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">
      <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>
      <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>
   </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">
      <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 * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop()) AND !execution(* *->destroy())">
         <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 * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->destroy())">
         <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>