<aop>

   <aspect class="org.jboss.test.aop.beforeafterthrowingscoped.PerInstanceAspect" scope="PER_INSTANCE"/>
	<aspect class="org.jboss.test.aop.beforeafterthrowingscoped.PerJoinpointAspect" scope="PER_JOINPOINT"/>
	<aspect class="org.jboss.test.aop.beforeafterthrowingscoped.PerClassJoinpointAspect" scope="PER_CLASS_JOINPOINT"/>
	<aspect class="org.jboss.test.aop.beforeafterthrowingscoped.PerClassAspect" scope="PER_CLASS"/>
	<aspect class="org.jboss.test.aop.beforeafterthrowingscoped.PerVmAspect" scope="PER_VM"/>
	
   <stack name="PER_INSTANCE">
      <before aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerInstanceAspect" name="before"/>
		<after aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerInstanceAspect" name="after"/>
		<throwing aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerInstanceAspect" name="throwing"/>		
		<finally aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerInstanceAspect" name="finaly"/>
   </stack>
   
   <bind pointcut="all(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithPerInstanceAspects)">
		<stack-ref name="PER_INSTANCE"/>
	</bind>
	
   <stack name="PER_JOINPOINT">
      <before aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerJoinpointAspect" name="before"/>
		<after aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerJoinpointAspect" name="after"/>
		<throwing aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerJoinpointAspect" name="throwing"/>		
		<finally aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerJoinpointAspect" name="finaly"/>
   </stack>
   
	<bind pointcut="all(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithPerJoinpointAspects)">
		<stack-ref name="PER_JOINPOINT"/>
	</bind>
	
   <stack name="PER_CLASS_JOINPOINT">
      <before aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassJoinpointAspect" name="before"/>
		<after aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassJoinpointAspect" name="after"/>
		<throwing aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassJoinpointAspect" name="throwing"/>		
		<finally aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassJoinpointAspect" name="finaly"/>
   </stack>
         
	<bind pointcut="all(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithPerClassJoinpointAspects)">
		<stack-ref name="PER_CLASS_JOINPOINT"/>
	</bind>
	
   <stack name="PER_CLASS">
      <before aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassAspect" name="before"/>
		<after aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassAspect" name="after"/>
		<throwing aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassAspect" name="throwing"/>		
		<finally aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerClassAspect" name="finaly"/>
   </stack>
   
   <stack name="PER_VM">
      <before aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerVmAspect" name="before"/>
		<after aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerVmAspect" name="after"/>
		<throwing aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerVmAspect" name="throwing"/>		
		<finally aspect="org.jboss.test.aop.beforeafterthrowingscoped.PerVmAspect" name="finaly"/>
   </stack>      
         
	<bind pointcut="all(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithPerClassAndPerVmAspects)">
		<stack-ref name="PER_CLASS"/>
		<stack-ref name="PER_VM"/>
	</bind>
   
   <!-- NULL ASPECT/INTERCEPTOR FACTORY -->

   <interceptor name="vmNullIFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory"/>
   <aspect name="vmNullFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory"/>
   <interceptor name="classNullIFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_CLASS"/>
   <aspect name="classNullFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_CLASS"/>
   <interceptor name="classJoinpointNullIFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_CLASS_JOINPOINT"/>
   <aspect name="classJoinpointNullFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_CLASS_JOINPOINT"/>
   <interceptor name="instanceNullIFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_INSTANCE"/>
   <aspect name="instanceNullFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_INSTANCE"/>
   <interceptor name="joinpointNullIFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_JOINPOINT"/>
   <aspect name="joinpointNullFactory" factory="org.jboss.test.aop.beforeafterthrowingscoped.NullAspectFactory" scope="PER_JOINPOINT"/>
   
   <stack name="nullFactoryStack">
      <interceptor-ref name="vmNullIFactory"/>
      <before aspect="vmNullFactory" name="anyAdvice"/>
      <around aspect="vmNullFactory" name="anyAdvice"/>
      <after aspect="vmNullFactory" name="anyAdvice"/>
      <throwing aspect="vmNullFactory" name="anyAdvice"/>
      <finally aspect="vmNullFactory" name="anyAdvice"/>
      <interceptor-ref name="classNullIFactory"/>
      <before aspect="classNullFactory" name="anyAdvice"/>
      <around aspect="classNullFactory" name="anyAdvice"/>
      <after aspect="classNullFactory" name="anyAdvice"/>
      <throwing aspect="classNullFactory" name="anyAdvice"/>
      <finally aspect="classNullFactory" name="anyAdvice"/>
      <interceptor-ref name="classJoinpointNullIFactory"/>
      <before aspect="classJoinpointNullFactory" name="anyAdvice"/>
      <around aspect="classJoinpointNullFactory" name="anyAdvice"/>
      <after aspect="classJoinpointNullFactory" name="anyAdvice"/>
      <throwing aspect="classJoinpointNullFactory" name="anyAdvice"/>
      <finally aspect="classJoinpointNullFactory" name="anyAdvice"/>
      <interceptor-ref name="instanceNullIFactory"/>
      <before aspect="instanceNullFactory" name="anyAdvice"/>
      <around aspect="instanceNullFactory" name="anyAdvice"/>
      <after aspect="instanceNullFactory" name="anyAdvice"/>
      <throwing aspect="instanceNullFactory" name="anyAdvice"/>
      <finally aspect="instanceNullFactory" name="anyAdvice"/>
      <interceptor-ref name="joinpointNullIFactory"/>
      <before aspect="joinpointNullFactory" name="anyAdvice"/>
      <around aspect="joinpointNullFactory" name="anyAdvice"/>
      <after aspect="joinpointNullFactory" name="anyAdvice"/>
      <throwing aspect="joinpointNullFactory" name="anyAdvice"/>
      <finally aspect="joinpointNullFactory" name="anyAdvice"/>
   </stack>
   
   <bind pointcut="field(int org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->*)">
      <stack-ref name="nullFactoryStack"/>
   </bind>
   
   <bind pointcut="construction(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new())">
      <stack-ref name="nullFactoryStack"/>
   </bind>
   
   <bind pointcut="execution(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new())">
      <stack-ref name="nullFactoryStack"/>
   </bind>
   
   <bind pointcut="execution(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->method(..))">
      <stack-ref name="nullFactoryStack"/>
   </bind>
   
   <bind pointcut="execution(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->staticMethod(..))">
      <stack-ref name="nullFactoryStack"/>
   </bind>
   
   <bind pointcut="call(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->calledMethod*(..))">
      <stack-ref name="nullFactoryStack"/>
   </bind>
   
   <bind pointcut="call(org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->new(int))">
      <stack-ref name="nullFactoryStack"/>
   </bind>
   
   <bind pointcut="execution(* org.jboss.test.aop.beforeafterthrowingscoped.POJOWithNullAspect->mixedMethod(..))">
      <stack-ref name="nullFactoryStack"/>
      <stack-ref name="PER_INSTANCE"/>
   </bind>

   <!-- Aspect used to record the caller instance
      (useful when the caller is a constructor that throws an exception) -->
   <aspect class="org.jboss.test.aop.beforeafterthrowingscoped.CallerAspect" scope="PER_VM"/>
   
   <bind pointcut="call(* org.jboss.test.aop.beforeafterthrowingscoped.*TargetPOJO*->*(boolean)) OR call(org.jboss.test.aop.beforeafterthrowingscoped.*TargetPOJO*->new(boolean))">
      <stack-ref name="PER_INSTANCE"/>
      <stack-ref name="PER_JOINPOINT"/>
      <stack-ref name="PER_CLASS_JOINPOINT"/>
      <stack-ref name="PER_CLASS"/>
      <stack-ref name="PER_VM"/>
      <before aspect="org.jboss.test.aop.beforeafterthrowingscoped.CallerAspect" name="advice"/>
   </bind>
   
</aop>