1. 程式人生 > 其它 >Spring---AspectJ與Spring

Spring---AspectJ與Spring

 

/**
     *  【代理物件建立】
     *
     *      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#initializeBean
     *
     *      ->
     *
     *      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#applyBeanPostProcessorsAfterInitialization
     *
     *      ->
     *
     *      org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#postProcessAfterInitialization{
     *
     *          public Object postProcessAfterInitialization(@Nullable Object bean, String beanName) {
     *              ...
     *              return wrapIfNecessary(bean, beanName, cacheKey);
     *              ...
     *          }
     *
     *          protected Object wrapIfNecessary(Object bean, String beanName, Object cacheKey) {
     *              ...
     *              Object proxy = createProxy(bean.getClass(), beanName, specificInterceptors, new SingletonTargetSource(bean));
     *              ...
     *          }
     *
     *          protected Object createProxy(Class<?> beanClass, @Nullable String beanName, @Nullable Object[] specificInterceptors, TargetSource targetSource) {
     *              ...
     *              ProxyFactory proxyFactory = new ProxyFactory();
     *              ...
     *              return proxyFactory.getProxy(getProxyClassLoader());
     *          }
     *      }
     *
     *
     *      BeanPostProcessor :org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor
     *
     *     
     *
     */