@ConditionalOnMissingBean now also checks beans available via BeanFactory

Currently when we've BeanFactory in our configuration and bean annotated with @ConditionalOnMissingBean both are created (ExampleBeanAndFactoryBeanConfiguration). This causes problem with autowiring/getting bean by type - NoUniqueBeanDefinitionException is thrown.

I've added support for such situation (it happens in our project - we've got MongoBeanFactory and MongoAutoConfiguration contains @Bean returning Mongo instance.

In fact it's quite big change and causes problems, which I cannot overcome (for example with getting BeanFactory return type without initialization - to prevent eager loading).

Any comments/ideas are welcomed :)