📄 account.java
字号:
//定义本接口在包examples.ejb20.relationships.many2many中
package examples.ejb20.relationships.many2many;
//本接口用到的其他类
import java.rmi.RemoteException;
import javax.ejb.*;
import java.util.Collection;
/**
* 这是AccontBean的远程接口定义。远程接口中定义了客户端能远程调用EJBean的方法。这些方法除了
* 要抛出异常java.rmi.RemoteException之外,和EJBean中的定义是一致的。但并不是EJBean来实
* 现这个接口,而是由容器自动产生的类AccontBeanE实现的。
*/
//这个接口必须继承javax.ejb.EJBObject接口
public interface Account extends EJBObject {
/**
* 远程方法:存入一定数目的金额
*
* @参数 amount 存入金额的数量
* @返回 double 操作实际结果
* @异常 RemoteException 当系统通讯发生故障时抛出
*/
public double deposit(double amount)
throws RemoteException;
/**
* 远程方法:提取一定数目的金额
*
* @参数 amount 提取金额的数量
* @返回 double 操作实际结果
* @异常 RemoteException 当系统通讯发生故障时抛出
* @异常 ProcessingErrorException
* 购买操作出错时抛出的异常
*/
public double withdraw(double amount)
throws RemoteException;
/**
* 远程方法:结算
* @返回 double 结算值
* @异常 RemoteException 当系统通讯发生故障时抛出
*/
public double balance()
throws RemoteException;
/**
* 返回账号类型
*
* @返回 String 账号类型
* @异常 RemoteException 当系统通讯发生故障时抛出
*/
public String accountType()
throws RemoteException;
/**
* 增加客户.
*
* @异常 java.rmi.RemoteException 当系统通讯发生故障时抛出
*/
public void addCustomer(Customer cust) throws RemoteException;
/**
* 返回账号ID.
*
* @返回 String 账号 ID
* @异常 java.rmi.RemoteException 当系统通讯发生故障时抛出
*/
public java.lang.String getAccountId() throws RemoteException;
/**
* 返回一个客户的集合
*
* @返回 Collection
* @异常 java.rmi.RemoteException 当系统通讯发生故障时抛出
*/
public Collection getAllCustomers() throws RemoteException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -