Chapter 1. Your First Enterprise JavaBean

Table of Contents

1. Developing the Home Interface
2. Developing the Component Interface
3. Developing the Bean Implementation Class
4. Writing the Deployment Descriptor
5. Preparing the EJB JAR File
6. Client Development and Lookup
7. Make process
8. Deployment
9. Running the Client Application

We will develop a simple JavaBean that returns the version of this workshop. This bean is stateless, since every client is returned the same static information.

1. Developing the Home Interface

The Home Interface enables a client to get a reference to a JavaBean. It is responsible for creating, removing, locating the bean.

We choose our Home interface to be remote, because we want our JavaBean to be accessable by a simple stand-alone Java client that will be running in its own JVM separate from the bean.

Example 1.1. AboutHome.java

package nl.datraverse.workshop.ejb.beans; 1

public interface AboutHome extends javax.ejb.EJBHome { 2
   public create() throws java.rmi.RemoteException, javax.ejb.CreateException;
}
1

This package is used throughout the workshop.

2

Because we develop a remote interface we extend the EJBHome class and not the EJBLocalHome class.