Danh mục

Bài giảng Lập trình mạng: Java remote method invocation - GV. Nguyễn Xuân Vinh

Số trang: 26      Loại file: ppt      Dung lượng: 374.50 KB      Lượt xem: 8      Lượt tải: 0    
Jamona

Xem trước 3 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM.GV: NGUYỄN XUÂN VINH KHOA CÔNG NGHỆ THÔNG TIN..... Java.MÔN: LẬP TRÌNH MẠNG 2..... Remote Method Invocation.27/10/14..... Presenter: Nguyễn Xuân Vinh. Information Technology Faculty./26.....
Nội dung trích xuất từ tài liệu:
Bài giảng Lập trình mạng: Java remote method invocation - GV. Nguyễn Xuân Vinh TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCMGV: NGUYỄN XUÂN VINH KHOA CÔNG NGHỆ THÔNG TIN JavaMÔN: LẬP TRÌNH MẠNG 2 Remote Method Invocation27/10/14 Presenter: Nguyễn Xuân Vinh Information Technology Faculty/26 Nong Lam University1 TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN “The network is the computer”GV: NGUYỄN XUÂN VINH  Consider the following program organization: method callMÔN: LẬP TRÌNH MẠNG 2 SomeClass AnotherClass returned object computer1 computer2  If the network is the computer, we ought to be able to put the two classes on different computers27/10/14/262 TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Parameter marshallingGV: NGUYỄN XUÂN VINHMÔN: LẬP TRÌNH MẠNG 227/10/14/263 TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Calling the remote getDescription methodGV: NGUYỄN XUÂN VINHMÔN: LẬP TRÌNH MẠNG 227/10/14/264 TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN RMI and other technologiesGV: NGUYỄN XUÂN VINH  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 DefinitionMÔN: LẬP TRÌNH MẠNG 2 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 CORBA27/10/14/265 TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN What is needed for RMIGV: NGUYỄN XUÂN VINH  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 registryMÔN: LẬP TRÌNH MẠNG 2  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 software27/10/14/266 TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN TerminologyGV: NGUYỄN XUÂN VINH  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 requestMÔN: LẬP TRÌNH MẠNG 2  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) classes27/10/14/267 TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN ProcessesGV: NGUYỄN XUÂN VINH  For RMI, you need to be running three processes  The Client ...

Tài liệu được xem nhiều: