Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 实现与方法上的注释的接口的方法的方面表达式_Java_Spring_Aop_Spring Aop - Fatal编程技术网

Java 实现与方法上的注释的接口的方法的方面表达式

Java 实现与方法上的注释的接口的方法的方面表达式,java,spring,aop,spring-aop,Java,Spring,Aop,Spring Aop,我有 还有一些类实现了这个接口 我想编写一个方面(使用SpringAOP),它将围绕该接口所有实现的some()方法运行 一般来说,我希望能够使用@DoProfile标记任何抽象或接口方法,并使用aspect包装其实现 简单的@Around(“@annotation(DoProfile)”)不起作用。只有当我将@DoProfile放在具体实现上时,它才起作用。但是我想把@DoProfile放到接口/抽象方法中 如何做到这一点?看看这个,这不起作用,因为@DoProfile可能被用于任何方法。我只

我有

还有一些类实现了这个接口

我想编写一个方面(使用SpringAOP),它将围绕该接口所有实现的
some()
方法运行

一般来说,我希望能够使用
@DoProfile
标记任何抽象或接口方法,并使用aspect包装其实现

简单的
@Around(“@annotation(DoProfile)”)
不起作用。只有当我将
@DoProfile
放在具体实现上时,它才起作用。但是我想把
@DoProfile
放到接口/抽象方法中


如何做到这一点?

看看这个,这不起作用,因为
@DoProfile
可能被用于任何方法。我只是四处看看,发现了这个可能的副本
public interface MyInterface {
    @DoProfile
    void some();
}