RMI learning notes (1) ----- Overview

xiaoxiao2021-03-06  75

1. What is the distributed application?

Simply put is the application of the client, application server and database resident on multiple computers.

It is the three-layer architecture or N layer architecture we often say. The application server is the business logic layer, also known as the intermediate layer of the component-based three-layer architecture.

2. What is the advantage of the three-story architecture?

The two-layer architecture is the C / S architecture that we often say, if we call the business logic layer into the client code in the second floor, it is called a fat server.

1) Since the two-layer architecture has an earlier connection to the database, it will cause the database performance to decline when the database is loaded or connected, and the client's access is rejected.

2) The three-layer architecture is equilibrated with the intermediate layer, and the database connection is handled only when the customer needs to access the database and other connection resources are released.

3) There is still a matter of important: When the code requires a big change, it is only necessary to update the intermediate layer code, and it is not necessary to modify the client.

3. The company introduced RMI (remote method call) due to the need to handle distributed applications.

4. RMI is implemented in the middle layer.

5. Distributed RMI application consists of two parts.

1) RMI Server ----- contains methods that need to be called remotely. The server creates several remote objects and generates their references in the RMI registry (that is, the only name of the remote object is registered, the RMI registration is a service running on the RMI server), the client will get the reference to this remote object. You can call those methods in the server.

2) RMI customers

6. RMI architecture (Mirosoft has MTS architecture)

1) Pile / Skeleton Stub / Skeleton

2) Remote call layer Remote Reference Layer

3) Transport layer Transport Layer

Process:

The client request begins with Stub, and Stub is a client agent of the remote object, and the customer communicates with Skeleton through Stubleton, and Skeleton is a server-side proxy, responsible for communication with stub.

The remote call layer RRL has the client and the server side, and the client's RRL accepts STUB request, and the package is sent to the server RRL after the format that can be transmitted on the network. Skeleton.

The transport layer is responsible for the connection of the client RRL and server RRL

7. Develop RMI steps:

1) Define the remote interface ----- Remote Interface class

2) Define and implement remote methods in servers ----- Server class

3) Define and implement customers ----- Customer class

4) Compile

5) Generate Stub and Skeleton

6) Create a security policy

7) Start the RMI Remote Registry

8) Start the server

9) Start customers

About the actual application can see some of my RMI instances

转载请注明原文地址:https://www.9cbs.com/read-121863.html

New Post(0)