alesj wrote:
On a related note, can you think about how "OSGi like properties" could
be used together with your existing qualifiers to limit the injection lookup.
e.g. we register OSGi service with property a=b, then at injection point we would also apply this filter<inject filter="(a=b)"/> <inject> <qualifier type="filter">(a=b)</qualifier> </inject>
Or something like that ...
What I'm interested in is to make this play nicely with qualifiers,
so we don't do duplicate work.
Discussion of this part moved here: http://community.jboss.org/thread/146084
As discussed offline the qualifier matching was a bit too strict, in that if an injection point expected a qualifier, only target contexts where ALL the supplied contexts were matched by the injection point qualifiers were injected. In other words we had this:
@Red @Blue
class Bean{}
This would work
class Target
{
@Constructor
public Target(@Inject @Red @Blue Bean bean){}
}
However this would not (since the constructor does not have all the supplied qualifiers) - (*)
class Target
{
@Constructor
public Target(@Inject @Red Bean bean){}
}
Which is weird since this would work (as long as there are no ambiguities)
class Target
{
@Constructor
public Target(@Inject Bean bean){}
}
I have fixed this so that (*) also works as long as there are no ambiguities