"alesj" wrote :
| I wouldn't bother too much.
| If the user overrides class info or existing MDR info with xml, then that's what
we should use.
| If he wants something more on the plain inject, let him add qualifiers via xml as
well.
|
Actually it is worse than I said yesterday. It doesn't really matter whether the
injection point qualifier annotations come from bmd/xml or not, the trigger for looking
for the annotations is @Inject.
This will work
| public class AnnotatedTarget
| {
| @Inject @SomeQualifier
| public void setBean(Bean bean){}
| }
|
but this will not
| public class Target
| {
| @SomeQualifier
| public void setBean(Bean bean){}
| }
|
| <bean name="Target" class="Target">
| <property name="bean">
| <inject/>
| </property>
| </bean>
|
I would have to do
| <bean name="Target" class="Target">
| <property name="bean">
| <inject>
| <qualifier>@SomeQualifier</qualifier>
| </inject>
| </property>
| </bean>
|
but @SomeQualifier already exists in the class, so that is not ideal. The qualifier
annotations need to be added some other way.
I've had a look at plugging this into the annotation adapters, but it doesn't
really "fit".
What is happening at the moment is
1) PreInstallAction describeVisits the BeanMetaData
2) Inspect the parent nodes in AbstractInjectionValueMetaData during describeVisit() to
determine the injection point type.
3) AIVMD.describeVisit() creates a qualifier dependency item if explicit qualifiers are in
place. Otherwise a normal SearchClassContextDependencyItem is created.
4) PreInstallAction populates the MDR
5) PreInstallAction pushes the context's explicit qualifiers to MDR
I think what I will do is
1) PreInstallAction describeVisits the BeanMetaData as before
2) Determine the relevant parent nodes in AbstractInjectionValueMetaData during
describeVisit().
3) Either
a) See if I can get rid of SearchClassContextDependencyItem, since it should just be a
special case of a qualifier dependency item with no qualifiers.
b) Create dependency items as before
Stash the nodes determined in 1) into the dependency item
4) PreInstallAction populates the MDR as before
5) Extend this step to look at all the dependency items. For the relevant ones
(SearchClassContextDependencyItem/qualifier dependency item) check the parent nodes for
qualifiers and add to the dependency item.
Is this too much of a hack? At least this way we don't have to go through everything
again.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269993#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...