I have a prototype bean factory (CreateCarAction
is spring bean, scope=prototype):
@Component("createCarActionFactory")
public abstract class CreateCarActionFactory {
@Lookup
public abstract CreateCarAction createCarAction();
}
and I Autowire it like this:
@Autowired
@Qualifier("createCarActionFactory")
private CreateCarActionFactory createCarActionFactory;
It works when I remove abstract from CreateCarActionFactory
. When I remove abstract I must implement createCarAction() - I don't need this implementation as @Lookup overrides it. When I resign from CreateCarActionFactory
I must access CreateCarAction
form beanFactory, so I jave to Autowire beanFactory, which is also ugly..
Can I autowire abstract CreateCarActionFactory
@Component
?