spring-framework / org.springframework.context.annotation / CommonAnnotationBeanPostProcessor / setResourceFactory

setResourceFactory

open fun setResourceFactory(resourceFactory: BeanFactory): Unit

Specify the factory for objects to be injected into @Resource / @WebServiceRef / @EJB annotated fields and setter methods, for name attributes and default names.

The default is the BeanFactory that this post-processor is defined in, if any, looking up resource names as Spring bean names. Specify the resource factory explicitly for programmatic usage of this post-processor.

Specifying Spring's org.springframework.jndi.support.SimpleJndiBeanFactory leads to JNDI lookup behavior equivalent to standard Java EE 5 resource injection, even for name attributes and default names. This is the same behavior that the "alwaysUseJndiLookup" flag enables.

See Also
#setAlwaysUseJndiLookup