I have a spring component that has an @Autowired
constructor that takes its arguments from @Value
annotations. Like this:
@Component
public class MyImplClass implement MyInterface
...
public MyImplClass(@Value("${prop.name}") final String name, @Value("${prop.value}") final String value) {
...
}
...
in another class i autowire this type like so
@Autowired
protected MyInterface _myInterface;
now I need to get the MyInterface bean with dynamically generated values (generated in runtime) passed to the constructor. I tried to use an AbstractBeanFactory
but this didn't work. How do i do this?