Bài giảng Lập trình mạng nâng cao: Java Remote Method Invocation - Nguyễn Xuân Vinh
Số trang: 26
Loại file: ppt
Dung lượng: 376.50 KB
Lượt xem: 22
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:
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.
Nội dung trích xuất từ tài liệu:
Bài giảng Lập trình mạng nâng cao: Java Remote Method Invocation - Nguyễn Xuân Vinh TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCMGV:NGUYỄNXUÂNVINH KHOACÔNGNGHỆTHÔNGTIN JavaMÔN:LẬPTRÌNHMẠNG2 Remote Method Invocation15/01/16 Presenter:NguyễnXuânVinh InformationTechnologyFaculty/26 NongLamUniversity1 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN “The network is the computer”GV:NGUYỄNXUÂNVINH Considerthefollowingprogramorganization: method callMÔN:LẬPTRÌNHMẠNG2 SomeClass AnotherClass returned object computer1 computer2 Ifthenetworkisthecomputer,weoughttobeabletoputthetwo classesondifferentcomputers15/01/16/262 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN Parameter marshallingGV:NGUYỄNXUÂNVINHMÔN:LẬPTRÌNHMẠNG215/01/16/263 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN Calling the remote getDescription methodGV:NGUYỄNXUÂNVINHMÔN:LẬPTRÌNHMẠNG215/01/16/264 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN RMI and other technologiesGV:NGUYỄNXUÂNVINH CORBA(CommonObjectRequestBrokerArchitecture)was usedforalongtime CORBAsupportsobjecttransmissionbetweenvirtuallyany languages ObjectshavetobedescribedinIDL(InterfaceDefinitionMÔN:LẬPTRÌNHMẠNG2 Language),whichlooksalotlikeC++datadefinitions CORBAiscomplexandflaky CORBAhasfallenoutoffavor MicrosoftsupportedCORBA,thenCOM,now.NET RMIispurelyJavaspecific JavatoJavacommunicationsonly Asaresult,RMIismuchsimplerthanCORBA15/01/16/265 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN What is needed for RMIGV:NGUYỄNXUÂNVINH JavamakesRMI(RemoteMethodInvocation)fairlyeasy,but therearesomeextrasteps Tosendamessagetoaremote“serverobject,” The“clientobject”hastofindtheobject DothisbylookingitupinaregistryMÔN:LẬPTRÌNHMẠNG2 Theclientobjectthenhastomarshaltheparameters(prepare themfortransmission) JavarequiresSerializableparameters Theserverobjecthastounmarshalitsparameters,doits computation,andmarshalitsresponse Theclientobjecthastounmarshaltheresponse Muchofthisisdoneforyoubyspecialsoftware15/01/16/266 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN TerminologyGV:NGUYỄNXUÂNVINH Aremoteobjectisanobjectonanothercomputer Theclientobjectistheobjectmakingtherequest(sendinga messagetotheotherobject) TheserverobjectistheobjectreceivingtherequestMÔN:LẬPTRÌNHMẠNG2 Asusual,“client”and“server”caneasilytraderoles(eachcan makerequestsoftheother) Thermiregistryisaspecialserverthatlooksupobjectsbyname Hopefully,thenameisunique! rmicisaspecialcompilerforcreatingstub(client)andskeleton (server)classes15/01/16/267 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN ProcessesGV:NGUYỄNXUÂNVINH ForRMI,youneedtoberunningthreeprocesses TheClient ...
Nội dung trích xuất từ tài liệu:
Bài giảng Lập trình mạng nâng cao: Java Remote Method Invocation - Nguyễn Xuân Vinh TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCMGV:NGUYỄNXUÂNVINH KHOACÔNGNGHỆTHÔNGTIN JavaMÔN:LẬPTRÌNHMẠNG2 Remote Method Invocation15/01/16 Presenter:NguyễnXuânVinh InformationTechnologyFaculty/26 NongLamUniversity1 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN “The network is the computer”GV:NGUYỄNXUÂNVINH Considerthefollowingprogramorganization: method callMÔN:LẬPTRÌNHMẠNG2 SomeClass AnotherClass returned object computer1 computer2 Ifthenetworkisthecomputer,weoughttobeabletoputthetwo classesondifferentcomputers15/01/16/262 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN Parameter marshallingGV:NGUYỄNXUÂNVINHMÔN:LẬPTRÌNHMẠNG215/01/16/263 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN Calling the remote getDescription methodGV:NGUYỄNXUÂNVINHMÔN:LẬPTRÌNHMẠNG215/01/16/264 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN RMI and other technologiesGV:NGUYỄNXUÂNVINH CORBA(CommonObjectRequestBrokerArchitecture)was usedforalongtime CORBAsupportsobjecttransmissionbetweenvirtuallyany languages ObjectshavetobedescribedinIDL(InterfaceDefinitionMÔN:LẬPTRÌNHMẠNG2 Language),whichlooksalotlikeC++datadefinitions CORBAiscomplexandflaky CORBAhasfallenoutoffavor MicrosoftsupportedCORBA,thenCOM,now.NET RMIispurelyJavaspecific JavatoJavacommunicationsonly Asaresult,RMIismuchsimplerthanCORBA15/01/16/265 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN What is needed for RMIGV:NGUYỄNXUÂNVINH JavamakesRMI(RemoteMethodInvocation)fairlyeasy,but therearesomeextrasteps Tosendamessagetoaremote“serverobject,” The“clientobject”hastofindtheobject DothisbylookingitupinaregistryMÔN:LẬPTRÌNHMẠNG2 Theclientobjectthenhastomarshaltheparameters(prepare themfortransmission) JavarequiresSerializableparameters Theserverobjecthastounmarshalitsparameters,doits computation,andmarshalitsresponse Theclientobjecthastounmarshaltheresponse Muchofthisisdoneforyoubyspecialsoftware15/01/16/266 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN TerminologyGV:NGUYỄNXUÂNVINH Aremoteobjectisanobjectonanothercomputer Theclientobjectistheobjectmakingtherequest(sendinga messagetotheotherobject) TheserverobjectistheobjectreceivingtherequestMÔN:LẬPTRÌNHMẠNG2 Asusual,“client”and“server”caneasilytraderoles(eachcan makerequestsoftheother) Thermiregistryisaspecialserverthatlooksupobjectsbyname Hopefully,thenameisunique! rmicisaspecialcompilerforcreatingstub(client)andskeleton (server)classes15/01/16/267 TRƯỜNGĐẠIHỌCNÔNGLÂMTP.HCM KHOACÔNGNGHỆTHÔNGTIN ProcessesGV:NGUYỄNXUÂNVINH ForRMI,youneedtoberunningthreeprocesses TheClient ...
Tìm kiếm theo từ khóa liên quan:
Lập trình mạng nâng cao Bài giảng Lập trình mạng nâng cao Lập trình mạng Remote Method Invocation Remote interfaces Parameter marshallingTài liệu có liên quan:
-
Đề cương chi tiết học phần: Mạng máy tính và lập trình mạng
4 trang 195 0 0 -
Báo cáo bài tập lớn môn Mạng máy tính và Lập trình mạng: Tìm hiểu về Soap
32 trang 139 0 0 -
349 trang 128 0 0
-
Bài giảng Lập trình mạng - Chương 1: Giới thiệu Lập trình mạng
18 trang 113 0 0 -
Báo cáo chuyên đề: Lập trình mạng nâng cao
24 trang 88 0 0 -
Giáo trình Lập trình mạng: Phần 1 - Trường Đại học Phan Thiết
78 trang 79 0 0 -
Giáo trình Lập trình mạng: Phần 1
54 trang 72 0 0 -
Giáo trình Lập trình mạng - ThS. Văn Thiên Hoàng
201 trang 60 0 0 -
17 trang 51 0 0
-
Tài liệu hệ thống phát hiện xâm nhập
14 trang 41 0 0