Series links:
SSD8_Ex3 [JAVA_RMI Service] (1) Overview of RMI and Network APIs
SSD8_Ex3[JAVA_RMI](2) Remote Interface Declaration
SSD8_Ex3 [JAVA_RMI] (3) Open RMI Service
SSD8_Ex3 [JAVA_RMI] (4) conference database table
SSD8_Ex3 [JAVA_RMI] (5) database connection and meeting method definition
SSD8_Ex3 [JAVA_RMI] (6) Create Command Line Navigation Menu
The remote interface declaration, this type of server and the code and the client must be consistent.The client implements the content of the specific method on the server side by calling the interface and binding the remote object.Only relevant methods are defined in the interface and no method implementation is performed.
MeetingInterface.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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; /** * * * Define a remote interface, must inherit the Remote interface, in which the method that requires a remote call must throw 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; } |
This article has been printed on copyright and is protected by copyright laws. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!
Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/ssd8-ex3-java-rmi-2-remote-interface-declarations-2.html
No Comment