あなたはそれが上のSpringコンテナによって管理され、Spring AOP
でこれを達成することはできません。 Spring AOPはそれ自身のアプリケーションコンテキストに限定されていますが、AspectJ
で可能です。
まず、AspectJ runtime library
をプロジェクトに追加する必要があります。 必要な依存関係:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.10</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.10</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.3.5.RELEASE</version>
</dependency>
次に、プロジェクトのAspectJの自然を有効にします。私はSTSを使用していますので、私のケースでは私はちょうどEnable AspectJ tooling
、それは私のプロジェクトに自動的にAspectJ
ランタイムを追加します。 >春ツール - - プロジェクトを右クリック>春の側面のツーリングを有効

次のプロジェクトにAspectJ
様相を追加AspectJのランタイムライブラリをクラスパスに

であることを確認してください。
public aspect JdbcAspect {
before(): execution(* org.springframework.jdbc.*.*.*(..)) {
System.out.println(" ### Intercepted");
}
}