當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。