版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1、Slides for Chapter 5: Distributed objects and remote invocationFrom Coulouris, Dollimore and KindbergDistributed Systems: Concepts and DesignEdition 4, Addison-Wesley 2005Instructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Fi
2、gure 5.1Middleware layersApplicationsMiddlewarelayers Request reply protocolExternal data representationOperating SystemRMI, RPC and eventsInstructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.2CORBA IDL example/ In fi
3、le Person.idlstruct Person string name; string place;long year; ;interface PersonList readonly attribute string listname;void addPerson(in Person p) ;void getPerson(in string name, out Person p);long number();Instructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and D
4、esign Edn. 4 Pearson Education 2005 Figure 5.3Remote and local method invocationsinvocationinvocationremoteinvocationremotelocallocallocalinvocationinvocationABCDEFInstructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.
5、4A remote object and its remote interfaceinterfaceremotem1m2m3m4m5m6Dataimplementationremoteobjectof methodsInstructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.5 Instantiation of remote objects Instructors Guide for
6、Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.6Invocation semanticsFault tolerance measuresInvocation semanticsRetransmit request messageDuplicate filteringRe-execute procedure or retransmit replyNoYesYesNot applicableNoYesNot appli
7、cableRe-execute procedureRetransmit replyAt-most-onceAt-least-onceMaybeInstructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.7The role of proxy and skeleton in remote method invocationobject Aobject BskeletonRequestpro
8、xy for BReplyCommunicationRemote Remote referenceCommunication module modulereference module modulefor Bs class& dispatcherremoteclient serverservantInstructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.8 Role of clien
9、t and server stub procedures in RPC in the context of a procedural languageclient RequestReplyCommunicationCommunication module moduledispatcherservice client stub server stubprocedureprocedureclient process server process procedureprogram Instructors Guide for Coulouris, Dollimore and Kindberg Dist
10、ributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.9Files interface in Sun XDRconst MAX = 1000;typedef int FileIdentifier;typedef int FilePointer;typedef int Length;struct Data int length;char bufferMAX;struct writeargs FileIdentifier f;FilePointer position;Data data;struct
11、readargs FileIdentifier f;FilePointer position;Length length;program FILEREADWRITE version VERSION void WRITE(writeargs)=1;1Data READ(readargs)=2;2 =2; = 9999;Instructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.10Dea
12、ling room systemDealers computerInformationproviderDealerExternalsourceExternalsourceInformationproviderDealerDealerDealerNotificationNotificationNotificationNotificationNotificationNotificationNotificationNotificationDealers computerDealers computerDealers computerNotificationNotificationInstructor
13、s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.11Architecture for distributed event notificationsubscriberobserverobject of interestEvent serviceobject of interestobject of interestobserversubscribersubscriber3.1.2.notifi
14、cationnotificationnotificationnotificationInstructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.12Java Remote interfaces Shape and ShapeListimport java.rmi.*;import java.util.Vector;public interface Shape extends Remot
15、e int getVersion() throws RemoteException;GraphicalObject getAllState() throws RemoteException;1public interface ShapeList extends Remote Shape newShape(GraphicalObject g) throws RemoteException;2Vector allShapes() throws RemoteException;int getVersion() throws RemoteException;Instructors Guide for
16、Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.13The Naming class of Java RMIregistryvoid rebind (String name, Remote obj) This method is used by a server to register the identifier of a remote object by name, as shown in Figure 15.1
17、3, line 3. void bind (String name, Remote obj) This method can alternatively be used by a server to register a remote object by name, but if the name is already bound to a remote object reference an exception is thrown.void unbind (String name, Remote obj) This method removes a binding.Remote lookup
18、(String name) This method is used by clients to look up a remote object by name, as shown in Figure 15.15 line 1. A remote object reference is returned.String list() This method returns an array of Strings containing the names bound in the registry.Instructors Guide for Coulouris, Dollimore and Kind
19、berg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 2005 Figure 5.14Java class ShapeListServer with main methodimport java.rmi.*;public class ShapeListServerpublic static void main(String args)System.setSecurityManager(new RMISecurityManager(); tryShapeList aShapeList = new ShapeL
20、istServant();1 Naming.rebind(Shape List, aShapeList );2System.out.println(ShapeList server ready); catch(Exception e) System.out.println(ShapeList server main + e.getMessage();Instructors Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 Pearson Education 20
21、05 Figure 5.15Java class ShapeListServant implements interface ShapeListimport java.rmi.*;import java.rmi.server.UnicastRemoteObject;import java.util.Vector;public class ShapeListServant extends UnicastRemoteObject implements ShapeList private Vector theList; / contains the list of Shapes1 private i
22、nt version;public ShapeListServant()throws RemoteException.public Shape newShape(GraphicalObject g) throws RemoteException 2version+; Shape s = new ShapeServant( g, version);3 theList.addElement(s); return s;public Vector allShapes()throws RemoteException. public int getVersion() throws RemoteException . Instructors Guide for Coulouris, Dollimore and Kindberg Distributed System
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 孫武教學(xué)課件
- 手術(shù)室輸血安全管理課件
- 截肢患者的日常生活技能訓(xùn)練
- 寶寶免疫系統(tǒng)建設(shè)
- 2025年高校新聞媒體三審三校自查報告及整改措施
- 蚌埠醫(yī)學(xué)院護理學(xué)護理康復(fù)技術(shù)
- 腦出血術(shù)后康復(fù)護理評估會議
- DB14∕T 3449-2025 危險化學(xué)品道路運輸事故液態(tài)污染物應(yīng)急收集系統(tǒng)技術(shù)指南
- 鄭州體育職業(yè)學(xué)院《中國近代史綱要》2023-2024學(xué)年第一學(xué)期期末試卷
- 學(xué)校教師發(fā)展培訓(xùn)計劃4篇
- 2025秋小學(xué)湘科版(新教材)科學(xué)三年級上冊知識點及期末測試卷及答案
- 非電性質(zhì)保安措施
- GB/T 3452.1-2005液壓氣動用O形橡膠密封圈第1部分:尺寸系列及公差
- 馬工程區(qū)域經(jīng)濟學(xué)全套課件
- 藥品生產(chǎn)質(zhì)量管理規(guī)范(2010版)(含13個附錄)
- tm114航空硬軟管基本知識
- 工業(yè)以太網(wǎng)交換機行業(yè)應(yīng)用案例ppt課件
- 基于霍爾式傳感器的電子秤-課程設(shè)計
- 電廠黑啟動方案及其系統(tǒng)試驗
- 【精品模板】蘭州交通大學(xué)畢業(yè)論文答辯演示PPT模板_
- 華南理工大學(xué)課堂教學(xué)質(zhì)量評價表
評論
0/150
提交評論