4.2. Coding the EJB and test client
4.2.1. The (remote) home interface
As this is a stateless session bean, the home interface is straightforward: It specifies exactly one no-argument create() method. The home interface is shown in Listing 4.1
Listing 4.1. Home interface for the ‘Interest’ EJB.
package com.kevinboone.ejb_book.interest; import javax.ejb.*; import java.rmi.*; 5 /** (Remote) home interface for the ‘Interest’ EJB (c)2002 Kevin Boone */ public interface InterestHome extends EJBHome 10 { /** Create an instance of the EJB */ public Interest create() 15 throws CreateException, RemoteException; } |
Points to note include the following.
The interface extends javax.ejb.EJBHome, as required by the EJB Specification [EJB2.0 7.10.5].
The ...
Get Applied Enterprise JavaBeans™ Technology 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.