13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

23.2 Lend Me Your EAR: Enterprise Packaging and Deployment509com/jadol/budgetpro/M<strong>on</strong>eyEJBean.classcom/jadol/budgetpro/M<strong>on</strong>eyHome.classcom/jadol/budgetpro/M<strong>on</strong>ey.classcom/jadol/budgetpro/M<strong>on</strong>eyLocalHome.classcom/jadol/budgetpro/TestM<strong>on</strong>eyEJBean.classnet/multitool/util/Save.classnet/multitool/util/Cost.classnet/multitool/util/Debt.classnet/multitool/util/SAM<strong>on</strong>ey.classMETA-INF/ejb-jar.xmlMETA-INF/jboss.xml$The EJB-JAR file c<strong>on</strong>tains the specifics for our EJB file (Table 23.2).To keep Table 23.2 simpler and shorter, we didn’t list each of the directoriesin the tree of directories down to each class file. When we show, for example,com/jadol/budgetpro/*, realize that each directory that is part of thatstructure (com, com/jadol, and so <strong>on</strong>) is part of the JAR file. The class filesare located in that tree.So what are the two XML files?These XML files provide the EJB c<strong>on</strong>tainer with informati<strong>on</strong> <strong>on</strong> how thebean parts are wired together. Let’s look at the c<strong>on</strong>tents of each.Table 23.2 C<strong>on</strong>tents of the EJB-JAR fileNameMANIFEST.MFejb-jar.xmljboss.xmlnet/multitool/util/*com/jadol/budgetpro/*META-INFTypetextXMLXMLclass filesclass filesdirectoryC<strong>on</strong>tentA standard JAR manifest; besides defining theJAR versi<strong>on</strong> it can be empty.A descripti<strong>on</strong> of the EJB, most importantly themapping between the name of the EJB and theactual Java class file.This file is specific to JBoss (well, duh!). Itdescribes a mapping between the JNDI nameused in the locate() and the name of the EJB.The equivalent file for Ger<strong>on</strong>imo (which usesOpenEJB) is openejb-jar.xml.Various classes.Various classes.A directory with other files.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!