Java Reference
In-Depth Information
For EJBs deployed as part of an Enterprise application (EAR file), the default value for
<module-name> will be determined differently depending on whether the EJB is part of
an EJB-JAR or WAR in the EAR. Inside a WAR, the default name follows the standalone
web module rules. Use WEB-INF/web.xml to change this default. In an EJB-JAR, the de-
fault name is the fully qualified path (directory) of the EJB-JAR inside the EAR plus the
name of the EJB-JAR file without the .jar extension. Use the EJB-JAR's META-INF/ejb-
jar.xml to change this default.
The <bean-name> value is required and will always be present. For EJBs defined using
the @Stateless , @Stateful , or @Singleton annotations, the default value for
<bean-name> is the unqualified name of the bean class. This default value can be over-
ridden using the annotation name() attribute. For EJBs defined using ejb-jar.xml the
bean-name element sets the value for the bean name.
The [!fully-qualified-interface-name] is required, and a binding with a
value for this part of the portable EJB name will always exist in JNDI. But the EE server
is also required to create a binding in JNDI with this value missing. This “shortcut” bind-
ing is useful when the EJB can only be accessed through one interface (or has no inter-
face at all). The following examples will make this clearer. The values for [!fully-
qualified-interface-name] are the fully qualified names of each local, remote,
EJB 2 local home, or EJB 2 remote home interface or the fully qualified name of the bean
class if the bean class implements no interfaces.
This is a stateless EJB implementing a single interface:
package com.bazaar;
public class AccountBean implements Account { ... }
If it's deployed as accountejb.jar, it'll have the following JNDI bindings:
Search WWH ::

Custom Search