Spring 源码分析
文章平均质量分 63
Golden_Dog
这个作者很懒,什么都没留下…
展开
-
Spring BeanFactory.getBean()流程
Spring BeanFactory.getBean() 开始获取Class对象1. step1: 找到合适的classloader(一般这里是以Thread.currentThread().getContextClassLoader()获得,正如《深入理解JVM虚拟机》所说这其实是一种破坏双亲加载的机制) step2: 加载bean对应的class文件为Class对象实原创 2017-12-22 22:20:22 · 3733 阅读 · 0 评论 -
Spring AOP 流程
proxy实例化1. 根据是否有interface准备proxy:JdkDynamicAopProxy.getProxy()/CglibAopProxy.getProxy()JDK: public Object getProxy(ClassLoader classLoader) { if (logger.isDebugEnabled()) { logger.debug("Cr原创 2017-12-25 19:35:01 · 567 阅读 · 0 评论 -
Spring 事务 小结
Spring事务的PointcutAdvisor: org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor具体的Advice为:org.springframework.transaction.interceptor.TransactionInterceptor1原创 2017-12-26 20:55:38 · 178 阅读 · 0 评论 -
Spring事务中处理哪些异常
1. 默认情况下处理 RuntimeException Error两种,然后回滚 public boolean rollbackOn(Throwable ex) { return (ex instanceof RuntimeException || ex instanceof Error); }2. 如果配置了rollback-for,那么会判断Exception是否符合配置,然后回原创 2018-01-17 21:55:57 · 1351 阅读 · 0 评论 -
Spring 得到FactoryBean
查看源码: // Now we have the bean instance, which may be a normal bean or a FactoryBean. // If it's a FactoryBean, we use it to create a bean instance, unless the // caller actually wants a referen原创 2018-01-18 21:48:31 · 360 阅读 · 0 评论