[jboss-as7-dev] mappedname behavior ?

Jaikiran Pai jpai at redhat.com
Tue May 31 06:51:42 EDT 2011


On Tuesday 31 May 2011 04:07 PM, Max Rydahl Andersen wrote:
> ...
>
> With AS7-900 i'm now even more confused what will actually work/not work in AS 7 :)
See my reply here on what will work in AS7 
http://lists.jboss.org/pipermail/jboss-as7-dev/2011-May/002234.html.

I can see that there's a bit of confusion on the usage of mappedName 
with various annotations. Note that, typically when users use mappedName 
attribute with @Stateless, @Stateful annotation they expect it to act as 
a jndi name to which the container is expected to bind the bean. Now 
when this mappedName is used with @MessageDriven, they expect it to be 
the location at which the queue/topic is bound. We have never supported 
this attribute for any of these semantics with @Stateless, @Stateful and 
@MessageDriven, for very minimally this inconsistent semantic (there's 
one other reason, but I would add those details here, for now). We had 
JBoss specific annotations to specify/override where the beans will be 
bound to. In AS7, we (currently) just bind to the EJB3.1 spec specified 
JNDI names. Usage of mappedName attribute with these annotations wasn't 
ever supported by JBoss EJB3 and there aren't any plans to support it as 
of now, in AS7.

Now, when this mappedName attribute is used with *injection*  
annotations like @EJB and @Resource, the attribute behaves differently. 
It specifies the location from where to *lookup* a resource. This was 
supported in previous versions of AS and will continue to be supported 
in AS7. To add a bit more confusion to the matter, Java EE 6 also 
introduced a "lookup" attribute to @EJB and @Resource annotations. This 
attribute is expected to be portable and is expected to be the jndi name 
of the resource being injected. We treat (both in AS6 and AS7) 
mappedName attribute and lookup attribute on @EJB and @Resource as 
equivalent. Again, this will continue to be supported.

-Jaikiran

>
> /max
>
>>
>> On Tue, May 31, 2011 at 1:17 PM, Max Rydahl Andersen<max.andersen at redhat.com>  wrote:
>> Hi,
>>
>> I've started trying to use various examples about JEE5/JEE6 which all seem to use mappedname as Glassfish, Weblogic and recently Websphere is using it (as a name that can be used at both declaration and resource lookup time within the same module)
>>
>> I know that mappendname is left unspecified in the spec, but it seems most other JEE vendors have aligned (or at least seem to have aligned).
>>
>> > From what I can understand and see JBoss EJB3 have had different implementations of this over time and in AS 7 have moved to simply completely ignore the mappedname attribute.
>>
>> Does there exist any forum threads and documentation (beyond the  that outlines
>> the reasons why JBoss EJB3 isn't aligning with what seems to be the consensus across the various servers ?
>>
>> I'm asking since it would make not only users but also tool developers life much easier if one could actually write and generate almost portable code ;)
>>
>> /max
>> http://about.me/maxandersen
>>
>>
>>
>>
>> _______________________________________________
>> jboss-as7-dev mailing list
>> jboss-as7-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>>
>>
>> -- 
>> ---
>> Nik
>
> /max
> http://about.me/maxandersen
>
>
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev



More information about the jboss-as7-dev mailing list