Notifications and Advisors

Advice: It is an aspect provided by Spring. But its function is too simple: we can only weave the cut-in surface into all the target methods of the target class, and cannot complete the weaving of the cut-in surface into the formulated target method (ie, the pointcut)

Advisor (Advisor): is another aspect provided by spring. The tool can perform more complex facet weaving functions. PointcoutAdvisor is a type of advisor. A pointcut that can be specified. The consultant wraps the notification, and weaves the aspects into different entry points at different time points according to the different notification types.

The PointcutAdvisor interface has two more commonly used implementation classes:

>>NameMatchMethodPointcutAdvisor name matching method pointcut advisor

>>RegexpMethodPointcutAdvisor Regular expression matching method pointcut advisor

Notice: Only control the time of AOP entry, and do not have the right to control the AOP entry point

Consultant: Both the right to AOP entry time and the right to control entry point

Because the advisor wraps the notice, the notice is only an attribute of the advisor, so some advisors have the right to ventilate, but some advisors may not have the notice.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325337499&siteId=291194637