@EnableMatrixAop
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
@Component
public class ExampleService {
@MatrixAop(name = "exampleAop", labels = {"label1", "label2"})
public void exampleMethod() {
// ...
}
}
@Component
public class ExampleAop {
@Before(value = "execution(* com.example.service.ExampleService.exampleMethod(..))")
public void beforeExampleMethod() {
// ...
}
}