远程接口的源代码。

列表 2. Book.java – 这个类反映了我们的 BookBean 类定义的公共方法

package il.co.lerner.book;

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

/* The remote interface for the Book entity bean.
   We declare a method for each method in the
   BookBean class, with an identical signature. */

public interface Book extends EJBObject
{
   public int getId() throws RemoteException;
   public void setId(int newId) throws RemoteException;

   public String getTitle() throws RemoteException;
   public void setTitle(String newTitle)
      throws RemoteException;

   public String getAuthor() throws RemoteException;
   public void setAuthor(String newAuthor)
      throws RemoteException;

   public String getPublisher() throws RemoteException;
   public void setPublisher(String newPublisher)
      throws RemoteException;

   public double getUsDollarPrice()
      throws RemoteException;
   public void setUsDollarPrice(double newDollarPrice)
      throws RemoteException;
}
© . All rights reserved.