Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

The Contents of an Enterprise Bean

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

  • Deployment descriptor: An XML file that specifies information about the bean such as its persistence type and transaction attributes. The deploytool utility creates the deployment descriptor when you step through the New Enterprise Bean wizard.

  • Enterprise bean class: Implements the methods defined in the following interfaces.

  • Interfaces: The remote and home interfaces are required for remote access. For local access, the local and local home interfaces are required. See the section Defining Client Access with Interfaces (page 58). (Please note that these interfaces are not used by message-driven beans.)

  • 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 may be used for different applications. To assemble a J2EE application, you package one or more modules—such as EJB JAR files—into 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 onto the J2EE server.

  • + Share This
  • 🔖 Save To Your Account