I've implemented a Spring bean utilizing the @Lookup annotation. (This thread was helpful: How to use spring @Lookup annotation?)
I've subsequently noticed a strange behavior that I'm not sure is by design or my own misunderstanding. Spring will implement a @Lookup method in a ComponentScan-ed bean annotated with @Service, @Component, etc. but will not implement such a method in a @Bean defined in a @Configuration class (Application.java).
This isn't a big problem, as I can remove the @Bean definition from the configuration and instead annotate its class directly; but I'm wondering whether this behavior is documented somewhere, or am I implementing it incorrectly?
@Bean
public Service getService() {
// ServiceImpl has a @Lookup method,
// but Spring does not implement it unless the class itself is annotated.
return new ServiceImpl();
}