[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBMICROCONT-380; constructor (property) matching

adrian@jboss.org do-not-reply at jboss.com
Thu Nov 6 10:38:23 EST 2008


Like I said on the JIRA issue, its not possible in general.

The only way to get close would be for the ValueMetaData to say
that it doesn't need the type before you can get the value.

Then you could invoke getValue(TypeInfo, ClassLoader)
(with null for the TypeInfo) before you determine the constructor.

But you'd still need to extend the fuzzy match processing
to not only look at the exact type but also all the interfaces
of the value returned.

Even then you could still get an ambiguity, e.g. in the example on the JIRA issue
if the injection implemented both Kernel and Controller.

This particular issue would probably be better resolved if we just
changed the BeanMetaDataDeployer to use @Inject for the controller
so you don't have to specify it in the xml.
The only reason all the different config mechanisms exist
(constructors/setters) is supposedly for backwards compatiblity
but the example from embedded shows that the ambiguous constructor
breaks that anyway. ;-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187392#4187392

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187392



More information about the jboss-dev-forums mailing list