Is there currently a way to do lookup method injection with annotations or some way to create/get a new prototype instance inside a singleton bean?
something like this except with annotations
Is there currently a way to do lookup method injection with annotations or some way to create/get a new prototype instance inside a singleton bean?
something like this except with annotations
All you need to do is create a default implementation and annotate it with @Scope("prototype")
See: http://static.springframework.org/sp...scope-resolver
If you also annotate it with @Component, then the only thing you need to add to your Spring context is <context:component-scan base-package="com.mycompany" /> and Spring will find and add your prototype implementation.