[jboss-dev-forums] [Design of EJB 3.0] - Re: javax.ejb.EJB Annotations Outside EJB3 Components

jaikiran do-not-reply at jboss.com
Thu Apr 30 02:42:57 EDT 2009


"richard.opalka at jboss.com" wrote : 
  | Also javax.ejb.EJB annotation is really confusing me. What's the difference between name and mappedName? 
  | 
The "name" attribute is jndiname within the java:comp/env namespace of the component into which the bean is being injected. So if you have:

  | @Stateless
  | public AnotherBean...
  | {
  | 
  |  @EJB(name="someName")
  |  private BeanOne bean;
  | ..
  | }
This means that the BeanOne is available at java:comp/env/someName jndiname of the AnotherBean's java:comp/env namespace.

The mappedName is actually the global jndiname (not the java:comp/env namespace) of the bean. The mappedName is actually not portable. Each vendor (application server) can implement this the way they want and are even allowed to ignore it.

anonymous wrote : Where in the EJB spec I can find exhausting description of this annotation?
I found this useful http://java.sun.com/products/ejb/javadoc-3_0-fr/javax/ejb/EJB.html

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

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



More information about the jboss-dev-forums mailing list