javaee / ejb-spec

See javax.ejb project for API. Contains legacy issues only.
https://github.com/javaee/javax.ejb
6 stars 1 forks source link

EJB 3.2 spec section 14.2 Enterprise bean's name needs clarification #134

Open amykang2020 opened 7 years ago

amykang2020 commented 7 years ago

EJB 3.2 spec section 14.2

Enterprise bean’s name . A logical name is assigned to each enterprise bean in the ejb-jar file or .war file. The Bean Provider can specify the enterprise bean’s name in the ejb-name element. If the enterprise bean’s name is not explicitly specified in metadata annotations or in the deployment descriptor, it defaults to the unqualified name of the bean class.

Based on EJB spec lead/Java EE architects discussion, the above section needs clarification, something like following:

" The Bean Provider can specify an enterprise bean's name by using the Stateful, Stateless, or MessageDriven annotation or in the deployment descriptor.

If the Stateful, Stateless, or MessageDriven annotation is used, the name of the bean is as specified by the name element of the annotation. If the name element is not specified, the name of the bean defaults to the unqualified name of the bean class.

The Bean Provider can specify an enterprise bean's name by the ejb-name element of the deployment descriptor.

An enterprise bean has a single name. This name must be unique within the ejb-jar file. The deployment descriptor may be used to define multiple enterprise beans that use the same enterprise bean class, in which case those enterprise beans will have different names. "

amykang2020 commented 7 years ago

From @vinayvishal - should the following be added to the clarification ? Adding an annotation to the class is the same as adding another entry to the deployment descriptor with a name corresponding to the annotation (explicit or default). The only way a deployment descriptor entry can override an annotation is if it uses the same name as the annotation, or metadata-complete is set. Otherwise, it augments the annotation.