1

春のプロジェクトでフル機能のアスペクトを有効にして、条件付きポイントカットを使用できるようにするにはどうすればよいですか?

今、私は設定ファイルに持っています:

 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:task="http://www.springframework.org/schema/task" xmlns:aop="http://www.springframework.org/schema/aop"
   xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

....

  <aop:aspectj-autoproxy />

しかし、次のようなポイントカットを作成したい場合:

    @Pointcut(value = "execution(public * *(..)) && if() ")
    public static boolean  anyPrivateMethod() {
     return enabled>0;
    }

次のようなコンパイル例外があります: ポイントカット式 'execution(public * *(..)) && if() ' にはサポートされていないポイントカット プリミティブ 'if' が含まれています。

では、Spring AOP ではなく、aspectj AOP を使用するにはどうすればよいですか?

4

0 に答える 0