one , The creation process of proxy object :


invokeAwareMethods(beanName,bean); return null; },getAccessControlContext()); }
else{ invokeAwareMethods(beanName,bean); } ObjectwrappedBean=bean;
if(mbd==null||!mbd.isSynthetic()){ //
Hold on to ⾏ be-all BeanPostProcessor#postProcessBeforeInitialization Before initialization Processor for ⽅ method
} try{ // this ⾥ I started to hold on ⾏afterPropertiesSet( Realized InitializingBean meet ⼝)⽅ Fa he initMethod
invokeInitMethods(beanName,wrappedBean,mbd); } catch(Throwableex){
} if(mbd==null||!mbd.isSynthetic()){ // whole Bean Initialization complete , Hold on to ⾏ Post Processors ⽅ method
wrappedBean=applyBeanPostProcessorsAfterInitialization(wrappedBean,beanName); }
return wrappedBean; }
You can see that there are methods executed before initialization , Method executed on initialization , Method executed after initialization , We start with the method executed after initialization .


two ,applyBeanPostProcessorsAfterInitialization

applyBeanPostProcessorsAfterInitialization() The flow of the method is as follows :

applyBeanPostProcessorsAfterInitialization Check whether the class has been exposed
( It may have been created ,⽐ as A rely on B Time , establish A time , We'll create it first B. When you really need to create B Time , There's no need to act as an agent ⼀ Objects that have been proxied ), Avoid duplicate creation .
Get all the candidates Advisor, yes Advisors and bean Of ⽅ Double layer ergodic matching based on method , Finally get ⼀ individual List<Advisor>, Namely specificInterceptors
(1) To create a proxy ⼯ Give it to ProxyFactory

(2) To assign and communicate ⽤ Intercept object merging , And all fit together Advisor

(3) upper ⾯ When you're ready, start creating the agent
⽤ProxyFactory establish AopProxy, then ⽤AopProxy establish Proxy,
So that's it ⾥ It's important to see what you get AopProxy What is the target , Then go in and see how to create a dynamic proxy , Two methods are provided :jdk proxy, cglib


summary : Brief process


©2020 ioDraw All rights reserved
0.96OLED display -4 Line SPI explain C++11 of std::function,std::bind,std::placeholdersJavaScript study ( Function declaration and parameters )QTabWidget Style sheet settings The project passed idea Package and publish to tomcat The server postman Interface test get timestamp and MD5 encryption react Background management configuration route and sidebar :python Simple game code -10 Minutes Python Write a snake game , simple You know? Python What does the foundation include ? Learn something ?10 individual Python Introduction to crawler