Writing the Remote home interface for a session bean

Now that you’ve seen the lookup and create process from the client’s point of view, we’ll see what you have to do to write a home interface for your bean. For session beans, the process is very easy. In fact, for stateless session beans, it’s ludicrously easy—you just declare a single, no-arg create() method.

package headfirst;

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


public interface AdviceHome extends EJBHome {

  public Advice create() throws CreateException, RemoteException;

}

Get Head First EJB 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.