EJB Annotations

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

If an XML deployment descriptor containing the same semantics exists, the XML content overrides the annotation.

@javax.ejb.EJB

@EJB
private MyBusinessInterface myEjb;

mappedName

The annotation has a "mappedName()" attribute. The specification designates it as vendor specific metadata. JBoss uses this metadata to specify the global JNDI name of the EJB. If mappedName() is specified, all other attributes (name, description, beanName, beanInterface, lookup) are ignored and this global JNDI name is used for binding.

@EJB(mappedName = "/somehting/something")
private SimpleStateless bean;

@javax.annotation.Resource