When using the spring framework to configure AOP, you need to define Pointcut "pointcuts" either through XML configuration files or annotations.
For example, defining pointcut expressions Execution (* com.sample.service.impl). *.*(..))
Execution () is the most commonly used pointcut function, and its syntax is as follows:
The entire expression can be divided into five parts:
1. Execution (): The body of an expression.
2, the first * Number: Indicates the return type, the * number denotes all types.
3. Package Name: Indicates the package name that needs to be intercepted, and the following two periods represent all the child packages of the current package and the current package,Com.sample.service.impl The package, and the descendants of all classes.
4, the second * Number: denotes the class name, the * number denotes all classes.
5, * (..): The last asterisk denotes the method name, the * number denotes all methods, the following parentheses indicate the parameters of the method, and two periods represent any parameters.
Spring AOP Execution Expression description