Java Reference
In-Depth Information
The
ejb-jar.xml
file (Example 23.3) is part of the J2EE standard. It
specifies the names of the home and remote (and local, if any) interfaces, the
implementation class (i.e., the real bean) and the name for the bean.
Example 23.3
Sample
ejb-jar.xml
file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>BudgetPro</description>
<display-name>BudgetPro</display-name>
<enterprise-beans>
<!-- Session Beans -->
<session id="test_Money">
<display-name>Test Money Bean</display-name>
<ejb-name>test/Money</ejb-name>
<home>com.jadol.budgetpro.MoneyHome</home>
<remote>com.jadol.budgetpro.Money</remote>
<ejb-class>com.jadol.budgetpro.MoneyEJBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
</assembly-descriptor>
</ejb-jar>
The name of the bean defined in the
ejb-jar.xml
file is not, however,
the name we will use in our JNDI lookup. Rather, there is one more level of
mapping used by JBoss. Look at the contents of the
jboss.xml
file
(Example 23.4).