Java 类org.springframework.beans.factory.BeanNameAware 实例源码

项目:lams    文件:AbstractAutowireCapableBeanFactory.java   
/**
 * Create a new AbstractAutowireCapableBeanFactory.
 */
public AbstractAutowireCapableBeanFactory() {
    super();
    ignoreDependencyInterface(BeanNameAware.class);
    ignoreDependencyInterface(BeanFactoryAware.class);
    ignoreDependencyInterface(BeanClassLoaderAware.class);
}
项目:lams    文件:AbstractAutowireCapableBeanFactory.java   
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);
        }
    }
}
项目:spring4-understanding    文件:AbstractAutowireCapableBeanFactory.java   
/**
 * Create a new AbstractAutowireCapableBeanFactory.
 */
public AbstractAutowireCapableBeanFactory() {
    super();
    ignoreDependencyInterface(BeanNameAware.class);
    ignoreDependencyInterface(BeanFactoryAware.class);
    ignoreDependencyInterface(BeanClassLoaderAware.class);
}
项目:spring4-understanding    文件:AbstractAutowireCapableBeanFactory.java   
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);
        }
    }
}
项目:spring    文件:AbstractAutowireCapableBeanFactory.java   
/**
 * Create a new AbstractAutowireCapableBeanFactory.
 */
public AbstractAutowireCapableBeanFactory() {
    super();
    ignoreDependencyInterface(BeanNameAware.class);
    ignoreDependencyInterface(BeanFactoryAware.class);
    ignoreDependencyInterface(BeanClassLoaderAware.class);
}
项目:spring    文件:AbstractAutowireCapableBeanFactory.java   
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);
        }
    }
}
项目:class-guard    文件:AbstractAutowireCapableBeanFactory.java   
/**
 * Create a new AbstractAutowireCapableBeanFactory.
 */
public AbstractAutowireCapableBeanFactory() {
    super();
    ignoreDependencyInterface(BeanNameAware.class);
    ignoreDependencyInterface(BeanFactoryAware.class);
    ignoreDependencyInterface(BeanClassLoaderAware.class);
}
项目:class-guard    文件:AbstractAutowireCapableBeanFactory.java   
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);
        }
    }
}
项目:spring4-understanding    文件:DeclarationOrderIndependenceTests.java   
@Test
public void testTargetIsBeanNameAware() {
    assertTrue("target bean is bean name aware",this.target instanceof BeanNameAware);
}
项目:spring4-understanding    文件:SessionScopeTests.java   
@Override
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
    if (bean instanceof BeanNameAware) {
        ((BeanNameAware) bean).setBeanName(null);
    }
}
项目:class-guard    文件:DeclarationOrderIndependenceTests.java   
@Test
public void testTargetIsBeanNameAware() {
    assertTrue("target bean is bean name aware",this.target instanceof BeanNameAware);
}
项目:class-guard    文件:SessionScopeTests.java   
@Override
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
    if (bean instanceof BeanNameAware) {
        ((BeanNameAware) bean).setBeanName(null);
    }
}