Aspect-oriented programming allows us to monitor the system. AOP is being studied recently, and @around should use the most. We can get the name of the connection point and the class name in the slice logic. Convenient for us to quickly locate problems in the system.
Example:
This annotation must be required @Component///sping integration, otherwise the Sping container will not resolve the slice and cause the slice to not work
@Aspect
public class Aopconfig {
@Pointcut (value= "Execution (* spring.aop.demo.* (..))")
public void PointCut () {
}
@Around ("PointCut ()")
Public Object Aroundmethod (Proceedingjoinpoint pjp) throws Throwable {
Object OB = null;
System.out.println (Pjp.getsignature (). Getdeclaringtype ());
Gets the signature object through the PJP object that encapsulates the information for the connection point. For example, to get the class object of the connection point in the Getdeclaringtype
GetName gets the name of the connection point, which is the method name.
system.out.println ("---------------------------");
pjp.proceed ();
system.out.println ("---------------------------");
& Nbsp;return ob;