RMI and Network APIs
On the weekend, EX3-java, a network and distributed system experiment, implemented the RMI distributed agenda service.The full name of RMI is "Remote Method Invocation."The following is the understanding of the extreme guests: the use of RMI remote method calls, you can achieve a java client to the java RMI server to remotely call the other side of the method, these methods in the server-side declaration and concrete implementation, and only the client The definition of the method and the content of the method without implementation - that is a JAVA interface.Java clients that do not have these methods can obtain remote server-side objects over a network connection and then invoke and manipulate remote objects and methods.In other words, the client's method is defined locally, but the actual implementation is based on the "personal" server connected to the Internet. The JAVA RMI saves a lot of code for the client, but it can also be for the server. Data openness provides another kind of connection query interface. For example, many API services on the Internet are in the form of PHP+JSON. After a URL request, the server queries related results and returns it to the client in the form of a JSON data packet.Such data query methods are very common nowadays, especially when WeChat is becoming more and more popular. Many public numbers are using the method of parsing JSON data packets returned by third-party APIs to provide users with weather inquiries, ticket inquiries, robot chats, and IP. Inquiry, attribution, and other services. Although RMI is different from the JSON-web API, most visitors learn that RMI does not think of the JSON web API.However, the difference between the two is also obvious. The JSON-API on the network is passively accepted. The client can only request data from the server and the server returns. The RMI client has more permissions, as long as the RMI interface is defined on the server side. The client can take the initiative to operate on the server, such as database operations: query the database, delete the database records; run command: Shutdown the server (a code implementation of remote shutdown will be given at the end of this series of articles), generally speaking In addition, everything java server-side programs can do locally can be authorized to clients through RMI. This series of articles is mainly to achieve remote conference management through JAVA RMI.Sharing the answers to this exercise is not a goal. The purpose is to sort out the two-day experience method.
SSD8_EX3 problem overview:
This is Ex3 of the SSD8 practice. It is expected that the extreme guests will write a series. The update frequency will be synchronized with the 2013 level progress of the NWPU Network and Distributed Systems Lab.Click on the tag or search for "SSD8" on this site to get updated SSD8 answers.The previous exercise: SSD8_Exam1 [TCP Chat Server]; if you want to continue tracking SSD practice, it is recommended to subscribe to this site. 1) Create a distributed agenda sharing service using Java RMI.Different users can use this shared agenda service to perform queries, add, and delete conferences.The server supports functions such as registration and clearing of conferences; 2) The agenda sharing service includes the following functions: user registration, adding conferences, querying conferences, deleting conferences, and clearing conferences; relevant codes and analyses will be given in subsequent articles.
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-services-1-an-overview-of-rmi-and-web-api-2.html