非常に基本的なspectJプロジェクトを作成しました。アドバイスを適用できない理由がわかりません。
注釈
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
public @interface Conditional {
String value();
}
そして、aspectJ クラス:
@Aspect
public class AspectE {
@Around("call(@Conditional * *.*(..)) && @annotation(conditional)" )
public Object condition(ProceedingJoinPoint joinPoint, Conditional conditional) throws Throwable {
System.out.println("entry point says hello!");
return joinPoint.proceed();
}
}
主要:
public class Main {
@Conditional("")
public static void main(String[] args) {
System.out.println("main good morning");
}
}
両方のメッセージを受信するには何を変更すればよいか教えてください。