7.2. The Home Interface

A Session Bean's home interface defines one or more create(...) methods. Each create method must be named create and must match one of the ejbCreate methods defined in the enterprise Bean class. The return type of a create method must be the enterprise Bean's remote interface type.

The home interface of a stateless Session Bean must have one create method that takes no arguments.

All the exceptions defined in the throws clause of an ejbCreate method must be defined in the throws clause of the matching create method of the home interface.

A remote home interface extends the javax.ejb.EJBHome interface, while a local home interface extends the javax.ejb.EJBLocalHome interface.

7.2.1. Session Bean Example:

The following examples use a Session Bean named Op.

public interface OpHome extends EJBHome {
    Op create(String user) throws CreateException, RemoteException;
}

A local home interface could be defined as follows (LocalOp being the local component interface of the bean):

public interface LocalOpHome extends EJBLocalHome {
    LocalOp create(String user) throws CreateException;
}