Springaop Study Notes-joinpoint

Source: Internet
Author: User

 

Springaop Study Notes
1. joinpoint in Spring AOP only supports joinpoint for method execution
2. pointcut in Spring AOP
Org. springframework. AOP. pointcut is the top-level abstraction of pointcut.

 
Package org. springframework. AOP; public interface pointcut {classfilter getclassfilter (); methodmatcher getmethodmatcher (); pointcut true = truepointcut. instance ;}

Getclassfilter and methodmatcher are used to match the woven operation object and corresponding methods respectively.

 
Package org. springframework. AOP; public interface classfilter {// If clazz is consistent with the phenomena we are concerned about, true is returned, and false Boolean matches (class <?> Clazz); // static parameter if the type does not matter for the pointcut to be captured, we can pass this parameter to pointcut classfilter true = trueclassfilter. instance ;}
Package org. springframework. AOP; public interface methodmatcher {Boolean matches (method, class <?> Targetclass);/*** whether it is sensitive to parameter values * if it is false, it indicates that the parameter value does not need to be determined during matching (the parameter value is not sensitive), which is called staticmethodmatcher, only * matches (method, class <?> Targetclass); executed, the execution results can be cached to improve efficiency. * If it is true, it indicates that the parameter value needs to be determined during matching (the parameter value is sensitive), which is called dynamicmethodmatcher. Then, * matches (method, class <?> Targetclass); if true is returned, execute * Boolean matches (method, class <?> Targetclass, object [] ARGs); further judgment has been made **/Boolean isruntime (); Boolean matches (method, class <?> Targetclass, object [] ARGs); methodmatcher true = truemethodmatcher. instance ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.