I thought I said not to add that xml config?
You're not listening to any of my objections on this which has just led to all
sorts of hacks and stupid configurations.
The way you've done is also crippled, see below.
1) The name injection should be configured on a property
e.g. something like
| <property name="name"><inject
fromContext="name"/></property>
|
You should be able to inject the bean name anywhere, e.g.
on a parameter to the constructor
| <constructor>
| <parameter><inject fromContext="name"/></parameter>
| </constructor>
|
and even potentially use it to resolve an alias to the real name
| <inject bean="SomeAlias" fromContext="name"/>
|
2) This just matches what should be doable and should be done via an annotation
| @inject(fromContext="name")
| public void setName(String name);
|
THERE SHOULD BE A CORRESPONDANCE BETWEEN THE
XML AND THE ANNOTATION FEATURES.
3) The idea of hardwiring "setName" into the microcontainer code
as some kind of default is just stupid.
e.g. What if the bean already uses the "name" property for something else?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064946#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...