@Aspect

In the spring AOP business logic just only focus on the business itself, logging, performance statistics, security control, transaction processing, exception handling , etc., code division from the business logic code, by separating these actions, we hope they can be independent non-directive method to business logic, and thus change the behavior of the time does not affect the business logic code.

The new company's projects in transactions related to the XX system call interface method calls are nearly identical transaction, each transaction in order to avoid intentionally added such calls, put calls on XX system and the callback method is not visible to developers , used a section of the design method. Using this method is characterized in that common, the same logic is relatively simple, generally does not apply the docking interface.

 

@Aspect: the role of the current class is identified as a read section for the container
 
@Pointcut: Pointcut trigger condition is implanted Advice of. The definition of each Pointcut include two parts, one is the expression, the second is the method signature. The method signature must be public and void type. Pointcut method can be seen as a mnemonic cited Advice, because the expression is not intuitive, so we can pass the method signature name for this way of expression. Therefore, the only method Pointcut method signature, without the need to write the actual code in the method body.
@Around: Surround enhancements, the equivalent of MethodInterceptor
@AfterReturning: Rear enhanced, equivalent to AfterReturningAdvice, perform a method exits normally
@Before: identifying a pre-enhancement methods, BeforeAdvice equivalent function, as well as a similar function
@AfterThrowing: Enhanced exception is thrown, the equivalent of ThrowsAdvice
@After: final enhancement, whether it is throwing an exception or normal exit will be executed

 JoinPoint

org.aspectj.lang.JoinPoint Interface represents the point of attachment target class object that defines the main method.

 ProceedingJoinPoint

org.aspectj.lang.ProceedingJoinPoint Inherited JoinPoint interface, which adds two methods (method thereof for performing the connection point).

 

pending upgrade. .

 

 

 

https://blog.csdn.net/weixin_33887443/article/details/88011341

Guess you like

Origin www.cnblogs.com/dingpeng9055/p/12088744.html