зеркало из
https://github.com/iharh/notes.git
synced 2025-11-01 06:06:08 +02:00
24 строки
563 B
Plaintext
24 строки
563 B
Plaintext
public aspect Tracing {
|
|
|
|
private pointcut mainMethod () :
|
|
execution(public static void main(String[]));
|
|
|
|
before () : mainMethod() {
|
|
System.out.println("> " + thisJoinPoint);
|
|
}
|
|
|
|
after () : mainMethod() {
|
|
System.out.println("< " + thisJoinPoint);
|
|
}
|
|
|
|
private pointcut getMessageMethod () :
|
|
execution(public String getMessage());
|
|
|
|
before () : getMessageMethod() {
|
|
System.out.println(">> " + thisJoinPoint);
|
|
|
|
HelloWorld helloWorld = (HelloWorld)thisJoinPoint.getThis();
|
|
System.out.println(">> otherMessage: " + helloWorld.getOtherMessage());
|
|
}
|
|
}
|