The Contents of an Enterprise Bean


To develop an enterprise bean, you must provide the following files:

  • Enterprise bean class: Implements the methods defined in the business interface and any life cycle callback methods.

  • Business Interfaces: The business interface defines the methods implemented by the enterprise bean class.

  • Helper classes: Other classes needed by the enterprise bean class, such as exception and utility classes.

You package the files in the preceding list into an EJB JAR file, the module that stores the enterprise bean. An EJB JAR file is portable and can be used for different applications. To assemble a Java EE application, you package one or more modulessuch as EJB JAR filesinto an EAR file, the archive file that holds the application. When you deploy the EAR file that contains the bean's EJB JAR file, you also deploy the enterprise bean to the Application Server. You can also deploy an EJB JAR that is not contained in an EAR file. Figure 202 shows the contents of an EJB JAR file.

Figure 202. Structure of an Enterprise Bean JAR




The JavaT EE 5 Tutorial
The JavaT EE 5 Tutorial
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 309

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net