當前位置: 首頁>>代碼示例>>Java>>正文


Java BeanNameAware類代碼示例

本文整理匯總了Java中org.springframework.beans.factory.BeanNameAware的典型用法代碼示例。如果您正苦於以下問題:Java BeanNameAware類的具體用法?Java BeanNameAware怎麽用?Java BeanNameAware使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BeanNameAware類屬於org.springframework.beans.factory包,在下文中一共展示了BeanNameAware類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: AbstractAutowireCapableBeanFactory

import org.springframework.beans.factory.BeanNameAware; //導入依賴的package包/類
/**
 * Create a new AbstractAutowireCapableBeanFactory.
 */
public AbstractAutowireCapableBeanFactory() {
	super();
	ignoreDependencyInterface(BeanNameAware.class);
	ignoreDependencyInterface(BeanFactoryAware.class);
	ignoreDependencyInterface(BeanClassLoaderAware.class);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:AbstractAutowireCapableBeanFactory.java

示例2: invokeAwareMethods

import org.springframework.beans.factory.BeanNameAware; //導入依賴的package包/類
private void invokeAwareMethods(final String beanName, final Object bean) {
	if (bean instanceof Aware) {
		if (bean instanceof BeanNameAware) {
			((BeanNameAware) bean).setBeanName(beanName);
		}
		if (bean instanceof BeanClassLoaderAware) {
			((BeanClassLoaderAware) bean).setBeanClassLoader(getBeanClassLoader());
		}
		if (bean instanceof BeanFactoryAware) {
			((BeanFactoryAware) bean).setBeanFactory(AbstractAutowireCapableBeanFactory.this);
		}
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:14,代碼來源:AbstractAutowireCapableBeanFactory.java

示例3: testTargetIsBeanNameAware

import org.springframework.beans.factory.BeanNameAware; //導入依賴的package包/類
@Test
public void testTargetIsBeanNameAware() {
	assertTrue("target bean is bean name aware",this.target instanceof BeanNameAware);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:5,代碼來源:DeclarationOrderIndependenceTests.java

示例4: postProcessBeforeDestruction

import org.springframework.beans.factory.BeanNameAware; //導入依賴的package包/類
@Override
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
	if (bean instanceof BeanNameAware) {
		((BeanNameAware) bean).setBeanName(null);
	}
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:7,代碼來源:SessionScopeTests.java


注:本文中的org.springframework.beans.factory.BeanNameAware類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。