SPRING BOOT 注解之OBJECTPROVIDER源码追踪
摘要:最近依旧在学习阅读Spring Boot的源代码,在此过程中涉及到很多在日常项目中比较少见的功能特性,对此深入研究一下,也挺有意思,这也是阅读源码的魅力之一。这里写成文章,分享给大家。 自动配置中的ObjectProvider 在阅读Spring Boot自动配置源码中关于redis的配置时,看到这
阅读全文
posted @
2020-09-23 11:08
duanxz
阅读(799)
推荐(0) 编辑
Springboot Actuator之十二:actuator aop
摘要:前言spring 中aop是一个核心概念,spring boot 是如何实现自动化配置的?现在我们就来分析一下 解析spring boot 中自动化配置是读取/META-INF/spring.factories 中读取org.springframework.boot.autoconfigure.En
阅读全文
posted @
2019-08-09 17:42
duanxz
阅读(728)
推荐(0) 编辑
Springboot Actuator之十一:actuator transaction
摘要:前言spring boot 的自动化配置其实就是在spring 的基础上做的封装,在我们之前对mvc,aop的自动化配置中可以发现–> 只是在spring 的基础上添加了一些特性,可以认为只是一个spring的应用.那么,关于transaction的配置也同样. 解析和aop自动配置一样,在/MET
阅读全文
posted @
2019-08-09 17:39
duanxz
阅读(655)
推荐(0) 编辑
Springboot Actuator之十一:actuator PublicMetrics
摘要:前言接下来的几篇文章我们来分析一下spring-boot-actuator 中在org.springframework.boot.actuate.metrics中的代码,如图: 这里的代码不仅多,而且还比较复杂(类与类之间的关联关系).我们的策略是一点一点的蚕食,本文就先来分析PublicMetri
阅读全文
posted @
2019-08-09 17:37
duanxz
阅读(1843)
推荐(0) 编辑
Springboot Actuator之十:actuator中的audit包
摘要:前言这篇文章我们来分析一下org.springframework.boot.actuate.security,org.springframework.boot.actuate.audit中的代码,这2个包的类是对spring security 的事件进行处理的.类图如下: 二、源码解析 2.1、Au
阅读全文
posted @
2019-08-09 16:09
duanxz
阅读(2270)
推荐(0) 编辑
Springboot Actuator之九:actuator jmx endpoint
摘要:1、配置 2、结果: 自定义Bean,通过JMX暴露 下面的controller为了测试,改变数据, 结果:
阅读全文
posted @
2019-08-06 17:54
duanxz
阅读(1222)
推荐(0) 编辑
Springboot Actuator之八:actuator的执行原理
摘要:本文接着《Springboot Actuator之七:actuator 中原生endpoint源码解析1》,前面主要分析了原生endpoint的作用。 现在着重了解actuator的执行原理。 在前面一篇文章中,我们已经了解endpoint的暴露方式有http(spring MVC)协议,jmx协议
阅读全文
posted @
2019-08-05 18:06
duanxz
阅读(6995)
推荐(1) 编辑
Springboot Actuator之七:actuator 中原生endpoint源码解析1
摘要:看actuator项目的包结构,如下: 本文中的介绍Endpoints。 Endpoints(端点)介绍 Endpoints 是 Actuator 的核心部分,它用来监视应用程序及交互,spring-boot-actuator中已经内置了非常多的Endpoints(health、info、beans
阅读全文
posted @
2019-08-05 11:41
duanxz
阅读(6063)
推荐(0) 编辑
spring boot 源码解析52-actuate中MVCEndPoint解析
摘要:今天有个别项目的jolokia的endpoint不能访问,调试源码发现:endpoint.enabled的开关导致的。 关于Endpoint, 《Springboot Endpoint之二:Endpoint源码剖析》 之前的几篇文章分析了spring boot 中有关endpoint的实现,细心的朋
阅读全文
posted @
2019-08-02 17:55
duanxz
阅读(1067)
推荐(0) 编辑
SpringBoot源码分析之SpringBoot的启动过程
摘要:先看示例 SpringBoot的启动很简单,在许多情况下,你可以委托给静态SpringApplication.run方法,代码如下: @SpringBootApplication public class MyApplication { public static void main(String[
阅读全文
posted @
2019-07-23 11:05
duanxz
阅读(1940)
推荐(0) 编辑
Springboot Endpoint之二:Endpoint源码剖析
摘要:spring boot 中有关endpoint的实现,细心的朋友可以发现,在org.springframework.boot.actuate.endpoint.mvc 包下也有一系列的xxxEndpoint,这又是为什么呢? 原因是: 我们很多情况下,都是访问接口的方式获取应用的监控,之前的分析是其
阅读全文
posted @
2018-12-27 18:54
duanxz
阅读(4974)
推荐(1) 编辑
Spring之3:ListableBeanFactory
摘要:ListableBeanFactory在BeanFactory的位置见《Spring源码阅览——BeanFactory体系结构》 ListableBeanFactory:同样扩展BeanFactory使其支持迭代Ioc容器持有的Bean对象。注意如果ListableBeanFactory同时也是Hi
阅读全文
posted @
2016-04-24 11:47
duanxz
阅读(2194)
推荐(1) 编辑
Spring之22:DefaultListableBeanFactory
摘要:1. DefaultListableBeanFactory的作用: 默认实现了ListableBeanFactory和BeanDefinitionRegistry接口,基于bean definition对象,是一个成熟的bean factroy。 最典型的应用是:在访问bean前,先注册所有的def
阅读全文
posted @
2016-04-24 11:43
duanxz
阅读(2135)
推荐(1) 编辑
Spring之23:AbstractBeanFactory,Bean的加载
摘要:《spring源码之:循环依赖》 AbstractBeanFactory的作用:别名管理,单例创建与注册,工厂方法FactoryBean支持. 由图我们直接的看出,AbstractBeanFactory继承了FatoryBeanRegistrySupport的同时,也实现了ConfigurableB
阅读全文
posted @
2016-04-23 15:57
duanxz
阅读(2090)
推荐(0) 编辑
利用commons-pool2自定义对象池
摘要:一、为什么使用对象池 恰当地使用对象池化技术,可以有效地减少对象生成和初始化时的消耗,提高系统的运行效率。commons-pool2是Apache下一个开源的公共资源池。我们可以根据它来快速的建立一个自己的对象池。组件提供了一整套用于实现对象池化的框架,以及若干种各具特色的对象池实现。官方网址:ht
阅读全文
posted @
2015-12-21 14:33
duanxz
阅读(1802)
推荐(0) 编辑
Spring bean加载之1:BeanFactory和FactoryBean
摘要:BeanFactory BeanFactory:以Factory结尾,表示它是一个工厂类(接口),用于管理Bean的一个工厂。在Spring中,BeanFactory是IOC容器的核心接口,它的职责包括:实例化、定位、配置应用程序中的对象及建立这些对象间的依赖。 Spring为我们提供了许多易用的B
阅读全文
posted @
2014-06-17 09:13
duanxz
阅读(1119)
推荐(0) 编辑
@SpringBootApplication注解分析
摘要:Spring boot简介 Spring Boot是伴随着Spring4.0 产生的,是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式进行配置,从而使开发人员不再需要定义样板化的配置。通过这种方式,Boot致力于在蓬勃发展的快
阅读全文
posted @
2014-06-17 09:13
duanxz
阅读(45156)
推荐(1) 编辑
ApplicationEventPublisherAware--待完善
摘要:ApplicationEventPublisherAware
阅读全文
posted @
2014-05-22 17:32
duanxz
阅读(891)
推荐(0) 编辑
Spring之B:spring初始化顺序
摘要:首先,Spring bean的默认加载顺序是怎么控制的 工程中有2个bean,A和B,其中必须先初始化A再初始化B,但是没有depend-on或者Order等方式去保证,只不过恰好刚好这么运行着没出事,但是突然增加了一个C之后,就先初始化B再初始化A导致问题,但是在主干版本上却没问题。 解决这个问题
阅读全文
posted @
2014-04-16 13:27
duanxz
阅读(6358)
推荐(0) 编辑
Spring之2:HierarchicalBeanFactory接口
摘要:HierarchicalBeanFactory:HierarchicalBeanFactory继承BeanFactory并扩展使其支持层级结构。getParentBeanFactory()方法或者父级BeanFactory,containsLocalBean(String name)方法查看当前Be
阅读全文
posted @
2014-03-30 22:37
duanxz
阅读(853)
推荐(0) 编辑