A local client can access an entity object through the entity bean’s local [component] interface. An entity bean’s local interface MUST extend the javax.ejb.EJBLocalObject interface. A local interface defines the business methods that are callable by local clients.
public interface Account extends javax.ejb.EJBLocalObject { void debit(double amount) throws InsufficientBalanceException; void credit(double amount); double getBalance(); }Methods of the entity bean’s local interface MUST NOT throw the java.rmi.RemoteException.
The javax.ejb.EJBLocalObject interface defines the methods that allow the local client to perform the following operations on an entity object’s local reference:
Obtain the local home interface for the entity object.
Remove the entity object.
Obtain the entity object’s primary key.
The CONTAINER provides the implementation of the methods defined in the javax.ejb.EJBLocalObject interface. Only the business methods are delegated to the instances of the enterprise bean class.
public interface EJBLocalObject { EJBLocalHome getEJBLocalHome() throws EJBException; Object getPrimaryKey() throws EJBException; boolean isIdentical(EJBLocalObject obj) throws EJBException; void remove() throws RemoveException, EJBException; }