RMI Remote Method Call Tutorial

Source: Internet
Author: User

RMI Remote Method Call Tutorial

1. RMI Overview

RMI (Remote method invocation)

RMI is a distributed object package that simplifies communication between Java applications on multiple machines.

Must be above the jdk1.1

Classes used by RMI

Java.rmi.Remote

All objects that can be invoked remotely must implement this interface

Java.rmi.server.UnicastRemoteObject

All objects that can be invoked remotely must extend the class

What is RMI

A remote method call is a mechanism by which objects between computers invoke each other's functions to start each other's processes, using this mechanism when an object on a computer invokes a method on another computer.

The order grammar rules are the same as the syntax rules for method calls between objects on the local machine.

Advantages

This mechanism has brought great convenience to the system design and programming of distributed computing.

As long as you follow the RMI rules to design the program, you can no longer have to ask about the network details under RMI, such as: TCP and socket and so on.

The communication between any two computers is entirely the responsibility of RMI. Calling objects on a remote computer is as convenient as a local object.

1. Object oriented:

RMI can pass complete objects as parameters and return values, not just predefined data types.

That is, a complex type like the Java Hassi can be passed as a parameter.

2, removable properties:

RMI can move properties from the client to the server or from the server to the client.

3. Design Method:

Object passing enables you to take advantage of the powerful features of object-oriented technology in distributed computing, such as two-tier and three-tier architecture systems.

If users can pass properties, they can use an object-oriented design approach in their own solutions.

All object-oriented design methods rely on different attributes to function, if complete objects are not delivered-including implementations and types

-You lose the benefits of the design approach.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.