文档章节

spring 的那些 processors

why_Dk37
 why_Dk37
发布于 2016/12/11 16:45
字数 349
阅读 23
收藏 0

spring笔记

spring 的那些 processors

BeanFactoryPostProcessor Allows for custom modification of an application context's bean definitions, adapting the bean property values of the context's underlying bean factory.

Application contexts can auto-detect BeanFactoryPostProcessor beans in their bean definitions and apply them before any other beans get created.

Useful for custom config files targeted at system administrators that override bean properties configured in the application context.

eg. PropertyPlaceholderConfigurer PropertySourcesPlaceholderConfigurer This class is designed as a general replacement for {@code PropertyPlaceholderConfigurer} in Spring 3.1 applications. It is used by default to support the {@code property-placeholder} element in working against the spring-context-3.1 XSD, whereas spring-context versions <= 3.0 default to {@code PropertyPlaceholderConfigurer} to ensure backward compatibility. See spring-context XSD documentation for complete details.

As of Spring 3.1, PropertySourcesPlaceholderConfigurer should be used preferentially over this implementation;

BeanPostProcessor Factory hook that allows for custom modification of new bean instances, e.g. checking for marker interfaces or wrapping them with proxies.

ApplicationContexts can autodetect BeanPostProcessor beans in their bean definitions and apply them to any beans subsequently created. Plain bean factories allow for programmatic registration of post-processors, applying to all beans created through this factory.

<p>Typically, post-processors that populate beans via marker interfaces or the like will implement {[@link](https://my.oschina.net/u/393) #postProcessBeforeInitialization}, while post-processors that wrap beans with proxies will normally implement {[@link](https://my.oschina.net/u/393) #postProcessAfterInitialization}.

DestructionAwareBeanPostProcessor Subinterface of {@link BeanPostProcessor} that adds a before-destruction callback.

he typical usage will be to invoke custom destruction callbacks on specific bean types, matching corresponding initialization callbacks.

InstantiationAwareBeanPostProcessor Subinterface of {@link BeanPostProcessor} that adds a before-instantiation callback, and a callback after instantiation but before explicit properties are set or autowiring occurs.

Typically used to suppress default instantiation for specific target beans, for example to create proxies with special TargetSources (pooling targets, lazily initializing targets, etc), or to implement additional injection strategies such as field injection.

BeanDefinitionRegistryPostProcessor

public interface BeanDefinitionRegistryPostProcessor extends BeanFactoryPostProcessor

Extension to the standard {@link BeanFactoryPostProcessor} SPI, allowing for the registration of further bean definitions <i>before</i> regular BeanFactoryPostProcessor detection kicks in. In particular, BeanDefinitionRegistryPostProcessor may register further bean definitions which in turn define BeanFactoryPostProcessor instances.

© 著作权归作者所有

共有 人打赏支持
why_Dk37
粉丝 1
博文 22
码字总数 17584
作品 0
海淀
程序员
Spring AMQP 2.1.0 发布,AMQP 消息解决方案

Spring AMQP 2.1.0 已发布,Spring AMQP 是基于 Spring 框架的 AMQP 消息解决方案。 更新内容: c71252f (HEAD -> master) Upgrade to SF-5.1.1 2480b17 AMQP-836: SMLC queuesChanged() vi......

淡漠悠然
昨天
0
0
spring 的那些 processors

spring笔记 spring 的那些 processors BeanFactoryPostProcessorAllows for custom modification of an application context's bean definitions,adapting the bean property values of the ......

why_Dk37
2016/10/15
4
0
聊聊spring cloud gateway的NettyConfiguration

序 本文主要研究下spring cloud gateway的NettyConfiguration NettyConfiguration spring cloud gateway使用的是reactor的httpclient,其通过nettyClientOptions这个bean来进行构造options,......

go4it
06/03
0
0
Dubbo源码-Dubbo是如何随心所欲自定义XML标签的

叨叨 今天考虑了很久要不要写这篇文章。 距离《Dubbo源码》系列的开篇到现在已经快两个月时间了。当时是想着工作上的RPC框架使用存在一些让人头疼的问题,就来看看Dubbo给出了一套什么样的解...

Jackie_Zheng
05/20
0
0
spring-boot 免xml配置直接使用spring

spring-boot在maven的dependency里配置URL为:http://repo.spring.org/milestone之后,maven会自行下载spring-boot的依赖 要使用spring-boot,首先要使用spring-annotation 对于所有的bean要...

shadowalker1990
2014/02/25
0
0

没有更多内容

加载失败,请刷新页面

加载更多

【大福利】极客时间专栏返现二维码大汇总

我已经购买了如下专栏,大家通过我的二维码你可以获得一定额度的返现! 然后,再给大家来个福利,只要你通过我的二维码购买,并且关注了【飞鱼说编程】公众号,可以加我微信或者私聊我,我再...

飞鱼说编程
今天
1
0
Spring5对比Spring3.2源码之容器的基本实现

最近看了《Spring源码深度解析》,该书是基于Spring3.2版本的,其中关于第二章容器的基本实现部分,目前spring5的实现方式已有较大改变。 Spring3.2的实现: public void testSimpleLoad(){...

Ilike_Java
今天
1
0
【王阳明心学语录】-001

1.“破山中贼易,破心中贼难。” 2.“夫万事万物之理不外于吾心。” 3.“心即理也。”“心外无理,心外无物,心外无事。” 4.“人心之得其正者即道心;道心之失其正者即人心。” 5.“无...

卯金刀GG
今天
2
0
OSChina 周三乱弹 —— 我们无法成为野兽

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 @ _刚刚好: 霸王洗发水这波很骚 手机党少年们想听歌,请使劲儿戳(这里) hahahahahahh @嘻酱:居然忘了喝水。 让你喝可乐的话, 你准忘不了...

小小编辑
今天
9
0
vm GC 日志 配置及查看

-XX:+PrintGCDetails 打印 gc 日志 -XX:+PrintTenuringDistribution 监控晋升分布 -XX:+PrintGCTimeStamps 包含时间戳 -XX:+printGCDateStamps 包含时间 -Xloggc:<filename> 可以将数据保存为......

Canaan_
昨天
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部