O'Reilly logo

Sams Teach Yourself EJB in 21 Days by Krishna Kothapalli, Ragae Ghaly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the Stateless Session Bean

This section discusses the implementation of the remote home interface SignOnHome, remote interface SignOn and the stateless session bean class SignOnEJB.

Defining the Home Interface

The home interface, SignOnHome, is defined in Listing 5.1.

Listing 5.1. The Full Text of day05/SignOnHome.java
package day05;

import java.rmi.RemoteException;
import javax.ejb.*;

public interface SignOnHome extends EJBHome {
  SignOn create()
     throws CreateException, RemoteException;
}

So, to create a bean instance, you call the create() method on the home interface, and receive a reference to the remote interface.

Note

For a stateless session bean, the return parameter of create() method of home interface must be remote interface ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required