use of org.springframework.beans.factory.wiring.BeanWiringInfoResolver in project cxf by apache.
the class ConfigurerImpl method configureBean.
public synchronized void configureBean(String bn, Object beanInstance, boolean checkWildcards) {
if (null == appContexts) {
return;
}
if (null == bn) {
bn = getBeanName(beanInstance);
}
if (null == bn) {
return;
}
if (checkWildcards) {
configureWithWildCard(bn, beanInstance);
}
final String beanName = bn;
setBeanWiringInfoResolver(new BeanWiringInfoResolver() {
public BeanWiringInfo resolveWiringInfo(Object instance) {
if (!"".equals(beanName)) {
return new BeanWiringInfo(beanName);
}
return null;
}
});
for (ApplicationContext appContext : appContexts) {
if (appContext.containsBean(bn)) {
this.setBeanFactory(appContext.getAutowireCapableBeanFactory());
}
}
try {
// this can leak memory
if (beanFactory instanceof AbstractBeanFactory) {
((AbstractBeanFactory) beanFactory).getMergedBeanDefinition(bn);
}
super.configureBean(beanInstance);
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Successfully performed injection.");
}
} catch (NoSuchBeanDefinitionException ex) {
// incorrect bean ids
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "NO_MATCHING_BEAN_MSG", beanName);
}
}
}
Aggregations