use of org.springframework.beans.factory.BeanFactoryAware in project mule by mulesoft.
the class DefaultListableBeanFactory method setAutowireCandidateResolver.
/**
* Set a custom autowire candidate resolver for this BeanFactory to use when deciding whether a bean definition should be
* considered as a candidate for autowiring.
*/
public void setAutowireCandidateResolver(final AutowireCandidateResolver autowireCandidateResolver) {
Assert.notNull(autowireCandidateResolver, "AutowireCandidateResolver must not be null");
if (autowireCandidateResolver instanceof BeanFactoryAware) {
if (System.getSecurityManager() != null) {
final BeanFactory target = this;
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
((BeanFactoryAware) autowireCandidateResolver).setBeanFactory(target);
return null;
}
}, getAccessControlContext());
} else {
((BeanFactoryAware) autowireCandidateResolver).setBeanFactory(this);
}
}
this.autowireCandidateResolver = autowireCandidateResolver;
}
Aggregations