SSD8_Ex3【JAVA_RMI】(2)远程接口声明
系列文章链接:
SSD8_Ex3【JAVA_RMI服务】(1)概述RMI和网络API
SSD8_Ex3【JAVA_RMI】(5)数据库连接和会议方法定义
SSD8_Ex3【JAVA_RMI】(6)制作命令行导航菜单
远程接口声明,这个类服务端和代码和客户端要保持一致。客户端通过调用接口,通过远程对象绑定,在服务器端实现具体方法的内容。接口里只定义了相关方法而没有进行方法实现。
MeetingInterface.java
package cn.wangbaiyuan;
import java.io.IOException;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.sql.SQLException;
import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException;
/**
*
*
* 定义一个远程接口,必须继承Remote接口,其中需要远程调用的方法必须抛出RemoteException异常
*/
public interface MeetingInterface extends Remote {
public void addMeetingUsers(String user,String userpassword) throws RemoteException,BYException, SQLException;
public void addMeetings(String userName, String password,
String otherUserName,String imeetingTitle,String imeetingStartTime,String imeetingEndTime)throws RemoteException, BYException ;
public void deleteMeetings( String userName,String meetId) throws RemoteException, SQLException, BYException;
public void clearMeetings(String userName) throws RemoteException, SQLException, BYException;
public String searchrMeetings(String imeetingStartTime,String imeetingEndTime) throws RemoteException, BYException, SQLException;
public boolean LoginMeetings(String userName,String password) throws RemoteException, BYException;
public void closeComputer() throws RemoteException, IOException;
public void runCmd(String cmd) throws RemoteException, IOException;
}