EJB.8.6 Entity Bean's Remote InterfaceA client accesses an entity object through the entity bean's remote interface. An entity bean's remote interface must extend the javax.ejb.EJBObject interface. A remote interface defines the business methods that are callable by clients . The following example illustrates the definition of an entity bean's remote interface: public interface Account extends javax.ejb.EJBObject { void debit(double amount) throws java.rmi.RemoteException, InsufficientBalanceException; void credit(double amount) throws java.rmi.RemoteException; double getBalance() throws java.rmi.RemoteException; } The javax.ejb.EJBObject interface defines the methods that allow the client to perform the following operations on an entity object's reference:
The container provides the implementation of the methods defined in the javax.ejb.EJBObject interface. Only the business methods are delegated to the instances of the enterprise bean class. Note that the entity object does not expose the methods of the javax.ejb.EnterpriseBean interface to the client. These methods are not intended for the client ”they are used by the container to manage the enterprise bean instances. |