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 ...
Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.