I'm sorry to be slow but I don't understand your answer.
In your original post, you imagined to be able to do:
Code:
Object[] conArgs = new Object[] { arg1, arg2,...}
MyClass partDI = (MyClass) ctx.getBean("myClassBean", conArgs);
However you were planing to come up arg1, arg2, etc., well, just do the same in your FactoryBean.
OK, but I was planning to provide these arguments at runtime,
as I created the bean. That's why I wanted to provide them
directly to the 'getBean' method of the ApplicationContext.
In other words, I can't wire them into the FactoryBean.
The only difference is on the second line above you would be directly calling MyClass constructor with all the args.
But, if I call the MyClass constructor directly with all the arguments
then how is the BeanFactory involved at all? Are you suggesting that
the code looks like this?:
Code:
Object[] conArgs = new Object[] { arg1, arg2,...}
MyClass partDI = new MyClass(conArgs);
or perhaps even like this:
Code:
MyClass partDI = new MyClass(arg1, arg2,....);
This is straight Java object creation and I don't see how the
BeanFactory is involved at all. I need the BeanFactory to
fill in the other, more static, parameters to my bean which
are not given in the constructor.
Anyway, sorry not to understand you. I would love to know
a simple solution, like you hint at. Thanks,
-tom