<?xml version="1.0" encoding="UTF-8"?>
<aop>

   <interceptor name="CountingInterceptor" class="org.jboss.test.aop.instanceofannotated.CountingInterceptor"/>

   <bind pointcut="execution(void $instanceof{@org.jboss.test.aop.instanceofannotated.InterfaceAnnotation}->annotatedMethod())">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution(void $instanceof{@org.jboss.test.aop.instanceofannotated.InterfaceAnnotation}->otherAnnotatedMethod())">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution(int $instanceof{@org.jboss.test.aop.instanceofannotated.ClassAnnotation}->superClassMethod())">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <introduction expr="class($instanceof{@org.jboss.test.aop.instanceofannotated.ClassAnnotation})">
      <interfaces>
         org.jboss.test.aop.instanceofannotated.EmptyInterface
      </interfaces>
   </introduction>

   <bind pointcut="execution($instanceof{org.jboss.test.aop.instanceofannotated.interfaces.*}->new())">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution(void $instanceof{org.jboss.test.aop.instanceofannotated.*}->someMethod())">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution(void $instanceof{*.SomeInterface}->otherMethod())">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution(void $instanceof{org.*.SomeInterface}->anotherMethod())">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <typedef name="td" expr="class(org.jboss.test.aop.instanceofannotated.Type)"/>

   <bind pointcut="call(org.jboss.test.aop.instanceofannotated.POJO->new($typedef{td}, $instanceof{org.jboss.test.aop.instanceofannotated.SuperType}, int))">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution(org.jboss.test.aop.instanceofannotated.POJO->new($typedef{td}, $instanceof{org.jboss.test.aop.instanceofannotated.SuperType}, int))">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution($typedef{td} org.jboss.test.aop.instanceofannotated.POJO->paramsAndTypedefReturn($typedef{td}, $instanceof{org.jboss.test.aop.instanceofannotated.SuperType}, int))">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="call($typedef{td} org.jboss.test.aop.instanceofannotated.POJO->paramsAndTypedefReturn($typedef{td}, $instanceof{org.jboss.test.aop.instanceofannotated.SuperType}, int))">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="execution($instanceof{org.jboss.test.aop.instanceofannotated.SuperType} org.jboss.test.aop.instanceofannotated.POJO->paramsAndInstanceofReturn($typedef{td}, $instanceof{org.jboss.test.aop.instanceofannotated.SuperType}, int))">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="field($instanceof{org.jboss.test.aop.instanceofannotated.SuperType} $instanceof{org.jboss.test.aop.instanceofannotated.POJO}->instanceofField)">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <bind pointcut="field($typedef{td} org.jboss.test.aop.instanceofannotated.POJO->typedefField)">
      <interceptor-ref name="CountingInterceptor"/>
   </bind>

   <typedef name="ip" expr="class(org.jboss.test.aop.instanceofannotated.IntroducedPOJO)"/>

   <annotation-introduction expr="class($typedef{ip})">
      @org.jboss.test.aop.instanceofannotated.Introduced
   </annotation-introduction>

   <annotation-introduction expr="constructor($instanceof{@org.jboss.test.aop.instanceofannotated.Annotation}->new($typedef{td}, $instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation}))">
      @org.jboss.test.aop.instanceofannotated.Introduced
   </annotation-introduction>

   <annotation-introduction expr="constructor($typedef{ip}->new($typedef{td}, $instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation}) throws java.lang.Exception)">
      @org.jboss.test.aop.instanceofannotated.Introduced2
   </annotation-introduction>

   <annotation-introduction expr="constructor($typedef{ip}->new($typedef{td}, $instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation}) throws java.io.IOException)">
      @org.jboss.test.aop.instanceofannotated.Introduced3
   </annotation-introduction>

   <annotation-introduction expr="method($typedef{td} $typedef{ip}->someMethod($typedef{td}, $instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation}))">
      @org.jboss.test.aop.instanceofannotated.Introduced
   </annotation-introduction>

   <annotation-introduction expr="method($instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation} $typedef{ip}->someMethod($typedef{td}, $instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation}) throws java.lang.Exception)">
      @org.jboss.test.aop.instanceofannotated.Introduced2
   </annotation-introduction>

   <annotation-introduction expr="method($instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation} $typedef{ip}->someMethod($typedef{td}, $instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation}) throws java.io.IOException)">
      @org.jboss.test.aop.instanceofannotated.Introduced3
   </annotation-introduction>

   <annotation-introduction expr="field($typedef{td} $typedef{ip}->field)">
      @org.jboss.test.aop.instanceofannotated.Introduced
   </annotation-introduction>

   <annotation-introduction expr="field($instanceof{@org.jboss.test.aop.instanceofannotated.TypeAnnotation} $instanceof{@org.jboss.test.aop.instanceofannotated.Annotation}->field)">
      @org.jboss.test.aop.instanceofannotated.Introduced2
   </annotation-introduction>


</aop>
