当前位置: 首页>>代码示例>>Java>>正文


Java BeanFactoryPostProcessor.postProcessBeanFactory方法代码示例

本文整理汇总了Java中org.springframework.beans.factory.config.BeanFactoryPostProcessor.postProcessBeanFactory方法的典型用法代码示例。如果您正苦于以下问题:Java BeanFactoryPostProcessor.postProcessBeanFactory方法的具体用法?Java BeanFactoryPostProcessor.postProcessBeanFactory怎么用?Java BeanFactoryPostProcessor.postProcessBeanFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.factory.config.BeanFactoryPostProcessor的用法示例。


在下文中一共展示了BeanFactoryPostProcessor.postProcessBeanFactory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testFactoryBeansWithAutowiring

import org.springframework.beans.factory.config.BeanFactoryPostProcessor; //导入方法依赖的package包/类
@Test
public void testFactoryBeansWithAutowiring() throws Exception {
	DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
	new XmlBeanDefinitionReader(factory).loadBeanDefinitions(WITH_AUTOWIRING_CONTEXT);

	BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
	ppc.postProcessBeanFactory(factory);

	assertNull(factory.getType("betaFactory"));

	Alpha alpha = (Alpha) factory.getBean("alpha");
	Beta beta = (Beta) factory.getBean("beta");
	Gamma gamma = (Gamma) factory.getBean("gamma");
	Gamma gamma2 = (Gamma) factory.getBean("gammaFactory");

	assertSame(beta, alpha.getBeta());
	assertSame(gamma, beta.getGamma());
	assertSame(gamma2, beta.getGamma());
	assertEquals("yourName", beta.getName());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:21,代码来源:FactoryBeanTests.java

示例2: testFactoryBeansWithAutowiring

import org.springframework.beans.factory.config.BeanFactoryPostProcessor; //导入方法依赖的package包/类
@Test
public void testFactoryBeansWithAutowiring() throws Exception {
	DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
	new XmlBeanDefinitionReader(factory).loadBeanDefinitions(WITH_AUTOWIRING_CONTEXT);

	BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
	ppc.postProcessBeanFactory(factory);

	Alpha alpha = (Alpha) factory.getBean("alpha");
	Beta beta = (Beta) factory.getBean("beta");
	Gamma gamma = (Gamma) factory.getBean("gamma");
	Gamma gamma2 = (Gamma) factory.getBean("gammaFactory");
	assertSame(beta, alpha.getBeta());
	assertSame(gamma, beta.getGamma());
	assertSame(gamma2, beta.getGamma());
	assertEquals("yourName", beta.getName());
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:18,代码来源:FactoryBeanTests.java

示例3: invokeBeanFactoryPostProcessors

import org.springframework.beans.factory.config.BeanFactoryPostProcessor; //导入方法依赖的package包/类
/**
 * Invoke the given BeanFactoryPostProcessor beans.
 */
private static void invokeBeanFactoryPostProcessors(
		Collection<? extends BeanFactoryPostProcessor> postProcessors, ConfigurableListableBeanFactory beanFactory) {

	for (BeanFactoryPostProcessor postProcessor : postProcessors) {
		postProcessor.postProcessBeanFactory(beanFactory);
	}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:11,代码来源:AbstractDelegatedExecutionApplicationContext.java

示例4: testFactoryBeansWithIntermediateFactoryBeanAutowiringFailure

import org.springframework.beans.factory.config.BeanFactoryPostProcessor; //导入方法依赖的package包/类
@Test
public void testFactoryBeansWithIntermediateFactoryBeanAutowiringFailure() throws Exception {
	DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
	new XmlBeanDefinitionReader(factory).loadBeanDefinitions(WITH_AUTOWIRING_CONTEXT);

	BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
	ppc.postProcessBeanFactory(factory);

	Beta beta = (Beta) factory.getBean("beta");
	Alpha alpha = (Alpha) factory.getBean("alpha");
	Gamma gamma = (Gamma) factory.getBean("gamma");
	assertSame(beta, alpha.getBeta());
	assertSame(gamma, beta.getGamma());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:15,代码来源:FactoryBeanTests.java

示例5: testRegisteredScopeView

import org.springframework.beans.factory.config.BeanFactoryPostProcessor; //导入方法依赖的package包/类
@Test
public void testRegisteredScopeView() {
	ConfigurableListableBeanFactory beanFactory = new DefaultListableBeanFactory();
	BeanFactoryPostProcessor beanFactoryPostProcessor = ViewScopeAutoConfiguration.viewScopeConfigurer();

	beanFactoryPostProcessor.postProcessBeanFactory(beanFactory);

	assertThat(beanFactory.getRegisteredScope(ViewScope.SCOPE_VIEW))
			.isInstanceOf(ViewScope.class);
}
 
开发者ID:joinfaces,项目名称:joinfaces,代码行数:11,代码来源:ViewScopeAutoConfigurationTest.java

示例6: invokeBeanFactoryPostProcessors

import org.springframework.beans.factory.config.BeanFactoryPostProcessor; //导入方法依赖的package包/类
/**
 * Invoke the given BeanFactoryPostProcessor beans.
 */
private void invokeBeanFactoryPostProcessors(
		Collection<? extends BeanFactoryPostProcessor> postProcessors, ConfigurableListableBeanFactory beanFactory) {

	for (BeanFactoryPostProcessor postProcessor : postProcessors) {
		postProcessor.postProcessBeanFactory(beanFactory);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:11,代码来源:AbstractApplicationContext.java

示例7: invokeBeanFactoryPostProcessors

import org.springframework.beans.factory.config.BeanFactoryPostProcessor; //导入方法依赖的package包/类
/**
 * Invoke given post processors.
 *
 * @param beanFactory
 * @param postProcessors
 */
private void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory, List postProcessors) {
	for (Iterator it = postProcessors.iterator(); it.hasNext();) {
		BeanFactoryPostProcessor postProcessor = (BeanFactoryPostProcessor) it.next();
		postProcessor.postProcessBeanFactory(beanFactory);
	}
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:13,代码来源:AbstractDelegatedExecutionApplicationContext.java


注:本文中的org.springframework.beans.factory.config.BeanFactoryPostProcessor.postProcessBeanFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。