I know it is possible to get the reference to the factorybean instance when defining the beans with XML (Spring). e.g.:
<property name="factoryBean" ref="&theFactoryBean" />
But is this also posible to do this with annotations? (maybe with @Autowired and @Qualifer?)
Do you have to annotate the factorybean itself to be discovered by Spring component-scan?
Make your bean implement
BeanFactoryAware, but as skaffman says, it’s not a great practice.