@@ -0,0 +1,12 @@ | |||
@Foo | |||
class A { | |||
public void m() {} | |||
} | |||
aspect X { | |||
//before(): execution(* (@Foo *..*).*(..)) {} | |||
before(): execution(* (@Foo *).*(..)) {} | |||
} | |||
@interface Foo {} |
@@ -0,0 +1,18 @@ | |||
package pkg; | |||
import java.lang.annotation.*; | |||
class A {public void m() {}} | |||
class B extends A {public void m() {}} | |||
@Marker | |||
class C extends B {public void m() {}} | |||
aspect X { | |||
pointcut p(): execution(* (@Marker *).*(..)); | |||
before(): p() {} | |||
} | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface Marker {} |
@@ -0,0 +1,17 @@ | |||
package pkg; | |||
import java.lang.annotation.*; | |||
class A {public void m() {}} | |||
class B extends A {public void m() {}} | |||
class C extends B {public void m() {}} | |||
aspect X { | |||
pointcut p(): execution(* C.*(..)); | |||
before(): p() {} | |||
} | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface Marker {} |
@@ -0,0 +1,6 @@ | |||
package ex; | |||
@Service | |||
class MyService { | |||
public void serve() {} | |||
} |
@@ -0,0 +1,6 @@ | |||
package ex; | |||
aspect RooLikeAspect { | |||
public void MyService.serve_itd() { | |||
} | |||
} |
@@ -0,0 +1,6 @@ | |||
package ex; | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface Service { | |||
} |
@@ -0,0 +1,14 @@ | |||
package ex; | |||
aspect SupplyMethodCollectedToService { | |||
declare @type: @Service * : @MethodCollected; | |||
pointcut collected() :@within(MethodCollected) && execution(* *(..)); | |||
// pointcut collected2() : execution(* (@MethodCollected *).*(..)); | |||
before() : collected() { | |||
// Should advice both serve() and serve_itd() | |||
} | |||
// before() : collected2() { } | |||
} | |||
@interface MethodCollected {} |