Bài giảng Lập trình mạng nâng cao: Java Remote Method Invocation - Nguyễn Xuân Vinh

This chapter presents the following content: Start the registry server, rmiregistry; start the object server; start the client; the client makes a request. Inviting you to refer. | Java Remote Method Invocation Presenter: Nguyễn Xuân Vinh Information Technology Faculty Nong Lam University “The network is the computer” Consider the following program organization: SomeClass AnotherClass method call returned object computer 1 computer 2 If the network is the computer, we ought to be able to put the two classes on different computers Parameter marshalling Calling the remote getDescription method RMI and other technologies CORBA (Common Object Request Broker Architecture) was used for a long time CORBA supports object transmission between virtually any languages Objects have to be described in IDL (Interface Definition Language), which looks a lot like C++ data definitions CORBA is complex and flaky CORBA has fallen out of favor Microsoft supported CORBA, then COM, now .NET RMI is purely Java-specific Java to Java communications only As a result, RMI is much simpler than CORBA What is needed for RMI Java makes RMI (Remote Method Invocation) fairly easy, but there are some extra steps To send a message to a remote “server object,” The “client object” has to find the object Do this by looking it up in a registry The client object then has to marshal the parameters (prepare them for transmission) Java requires Serializable parameters The server object has to unmarshal its parameters, do its computation, and marshal its response The client object has to unmarshal the response Much of this is done for you by special software Terminology A remote object is an object on another computer The client object is the object making the request (sending a message to the other object) The server object is the object receiving the request As usual, “client” and “server” can easily trade roles (each can make requests of the other) The rmiregistry is a special server that looks up objects by name Hopefully, the name is unique! rmic is a special compiler for creating stub (client) and skeleton (server) classes Processes For RMI, you need to be running three . | Java Remote Method Invocation Presenter: Nguyễn Xuân Vinh Information Technology Faculty Nong Lam University “The network is the computer” Consider the following program organization: SomeClass AnotherClass method call returned object computer 1 computer 2 If the network is the computer, we ought to be able to put the two classes on different computers Parameter marshalling Calling the remote getDescription method RMI and other technologies CORBA (Common Object Request Broker Architecture) was used for a long time CORBA supports object transmission between virtually any languages Objects have to be described in IDL (Interface Definition Language), which looks a lot like C++ data definitions CORBA is complex and flaky CORBA has fallen out of favor Microsoft supported CORBA, then COM, now .NET RMI is purely Java-specific Java to Java communications only As a result, RMI is much simpler than CORBA What is needed for RMI Java makes RMI (Remote Method Invocation) fairly easy, but there are

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.