文档章节

spring 的那些 processors

why_Dk37
 why_Dk37
发布于 2016/12/11 16:45
字数 349
阅读 25
收藏 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......

淡漠悠然
10/16
625
0
Spring Tool Suite 和 GGTS 3.6.1 发布

Spring Tool Suite(STS) 和 Groovy/Grails Tool Suite(GGTS) 3.6.1 发布,更新内容如下: 值得关注的新特性: 更新到 tc Server 3.0.0 提升了构建 Spring 项目的性能 AspectJ/AJDT 支持 ...

oschina
2014/08/29
4.2K
13
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 XD 1.1 M1/1.0.2 发布

Spring XD 1.1 M1/1.0.2 发布,这两个版本现已提供下载: 1.0.2.RELEASE: zip, 1.1.0.M1 RELEASE: zip Spring XD 1.0.2 除了一些 bug 修复,Spring XD 1.0.2 现在支持 Apache Hadoop 2.5.1,......

oschina
2014/11/20
1K
2
Spring Cloud Data Flow for Mesos 1.0 RC2 发布

Spring Cloud Data Flow for Mesos 1.0 RC2 发布了,此次更新增加了支持流分区和缩放功能。 Currently partitioning and scaling of sinks and processors are handled by using multiple a......

凝小紫
2016/08/27
1K
0

没有更多内容

加载失败,请刷新页面

加载更多

jquery通过id显示隐藏

var $div3 = $('#div3'); 显示 $div3.show(); 隐藏 $div3.hide();

yan_liu
今天
3
0
《乱世佳人》读书笔记及相关感悟3900字

《乱世佳人》读书笔记及相关感悟3900字: 之前一直听「荔枝」,后来不知怎的转向了「喜马拉雅」,一听就是三年。上班的时候听房产,买房了以后听装修,兴之所至时听旅行,分手后听亲密关系,...

原创小博客
今天
3
0
大数据教程(9.6)map端join实现

上一篇文章讲了mapreduce配合实现join,本节博主将讲述在map端的join实现; 一、需求 实现两个“表”的join操作,其中一个表数据量小,一个表很大,这种场景在实际中非常常见,比如“订单日志...

em_aaron
今天
3
0
cookie与session详解

session与cookie是什么? session与cookie属于一种会话控制技术.常用在身份识别,登录验证,数据传输等.举个例子,就像我们去超市买东西结账的时候,我们要拿出我们的会员卡才会获取优惠.这时...

士兵7
今天
3
0
十万个为什么之为什么大家都说dubbo

Dubbo是什么? 使用背景 dubbo为什么这么流行, 为什么大家都这么喜欢用dubbo; 通过了解分布式开发了解到, 为适应访问量暴增,业务拆分后, 子应用部署在多台服务器上,而多台服务器通过可以通过d...

尾生
今天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部