@EJB declares an EJB link from your component to the target EJB. name is the link key in your component environment. There are several ways to specify the target EJB:
beanName (or <ejb-link> in XML) can be used to specify the target EJB if the EJB is in the same application as your componentmappedName is not a portable, vendor-specific string (even if it is part of the standard!) that somehow identifies the target.- In EJB 3.1, a
lookup is a portable way to specify the target JNDI string. - Vendor-specific mechanisms, such as binding files.
- If none of the other mechanisms are used, javadoc says that
@EJB will target the EJB in the same application that implements the target type if there is only one.
source share