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
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 ...
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ìm kiếm theo từ khóa liên quan:
Mô hình mạng Mạng máy tính Lập trình mạng Bài giảng Lập trình mạng Java remote method invocationGợi ý tài liệu liên quan:
-
Giáo án Tin học lớp 9 (Trọn bộ cả năm)
149 trang 263 0 0 -
Ngân hàng câu hỏi trắc nghiệm môn mạng máy tính
99 trang 251 1 0 -
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 2
102 trang 244 0 0 -
47 trang 237 3 0
-
Đề cương chi tiết học phần Thiết kế và cài đặt mạng
3 trang 234 0 0 -
80 trang 216 0 0
-
122 trang 212 0 0
-
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 1
122 trang 210 0 0 -
Giáo trình môn học/mô đun: Mạng máy tính (Ngành/nghề: Quản trị mạng máy tính) - Phần 1
68 trang 200 0 0 -
Giáo trình căn bản về mạng máy tính -Lê Đình Danh 2
23 trang 187 0 0