What is RMI
This is the back-end small class of the monastery. Each article is shared from
[background introduction] [knowledge analysis] [common problems] [solutions] [coding practice] [extended thinking] [more discussion] [References]
Eight aspects of in-depth analysis of back-end knowledge / skills. This article shares:
[what is RMI]
Hello, I'm Bai Xiaoran, a student of the 24th phase of Beijing Branch of it Academy. I'm an honest, pure and kind java programmer
Today, I'd like to share with you the knowledge points in deep thinking about Java task 8 on the official website of the Academy - what is RMI
1. Background introduction
RMI's full name is remote method invocation, that is, remote method invocation It is a remote calling method based on TCP / IP protocol
RMI uses stubs and skeletons to communicate with remote objects Today, let's take a look at RMI in Java and RMI encapsulation in spring
2. Knowledge analysis
Specific steps of Java RMI: the server creates a remote object interface
Create a specific implementation class of the interface; The main function runs the same interface and then calls the client.
Spring RMI server
Add interfaces to the web project, ordinary interfaces. There is no need to inherit the implementation classes of other public interface interfaces
Add spring's bean configuration file to the server-side Web project, such as rmiserver XML main function startup
The client creates an rmiclient under the source file Src xml
The client program then uses the Maven clean package to jar the client, and then import it on the server
3. Frequently asked questions
Connection timeout; The problem of main function jar package; Link rejected
4. Solutions
It's basically about configuration files. Please refer to my daily report for details http://www.jnshu.com/daily/36333?dailyType=others&total=76&page=7&uid=13397&sort=0&orderBy=3
5. Coding practice
6. Expand thinking
Spring's encapsulation of RMI uses rmiservice exporter on the server side
7. References
Baidu
8. More discussion
Q1: Yu Botao: is there a default registration port
A1: Bai Xiaoran: Yes. The default registration port of rmiservice exporter is 1199
Q2: Yao yuan: is the service port the default?
A2: Bai Xiaoran: if the set is 0, it is a random unused port
Q3: Hu Kaibo: what protocol does he use?
A3: Bai Xiaoran: the service uses HTTP and RMI is a TCP / IP protocol
9. Acknowledgment
Thanks to elder martial brother Yu Botao and Zhang Xin. This tutorial is based on their previous technology sharing
Video:
Why use RMI_ Tencent video
That's all for today's sharing. You are welcome to like, forward, leave messages and make bricks~
------------------------------------------------------------------------------------------------------------------------
Skill tree It Academy
"We believe that everyone can become an engineer. From now on, find a senior brother to introduce you, control your learning rhythm, and stop being confused on the way to learning.".
Here is the skill tree In it academy, thousands of senior brothers have found their own learning route here. Learning is transparent and growth is visible. Senior brothers have 1-to-1 free guidance. Come and study with me~
My invitation code: 13397829, or you can click this link directly: http://www.jnshu.com/login/1/13397829
Author: heavy bell link: https://www.jianshu.com/p/c34ee94fa3d2 Source: the copyright of Jianshu Jianshu belongs to the author. Please contact the author for authorization and indicate the source for any form of reprint.
For more information, you can join the IT communication group 565734203 to discuss and communicate with you
Here is the skill tree · it Academy: a gathering place for beginners to switch to the Internet