blob: b7eae5e63b2896f449c996fb4f8ef914eecfe8a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package ma2;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
public aspect Aspect2 {
Object around(): execution(@Annotation2 * *(..)) || execution(@Annotation2 *.new(..)) {
/*
@Around("(execution(@ma.aspect2.Annotation2 * *(..)) || execution(@ma.aspect2.Annotation2 *.new(..)))")
public Object inExceptionTranslatorAspect(ProceedingJoinPoint pjp) throws Throwable {
*/
System.out.println(">In Aspect2");
try {
Object returnedObject = proceed();
System.out.println("<In Aspect2");
return returnedObject;
} catch (Throwable thrownThrowable) {
System.out.println("<In Aspect2");
throw new RuntimeException(thrownThrowable);
}
}
}
|