@EnableAspectJAutoProxy turns on Spring’s aspect capability. Add it to a configuration class before registering an aspect bean and defining advice to intercept method calls. section 6.2.1
Listing 6.5 Enabling the aspects mechanism in a Spring app
@Configuration
@ComponentScan(basePackages = "com.example.services")
@EnableAspectJAutoProxy #A
public class ProjectConfig {
}See the annotation on ProjectConfig, alongside component scanning. section 6.2.1
Logging around a service call
With aspect support enabled, an around advice can log before and after CommentService.publishComment executes. section 6.2.1
