版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 化工企业环保排放准则
- 景区城北街道佳家花园社区临时公益性岗位招聘3人考试参考题库及答案解析
- 2026年四川省达州市事业单位人员招聘笔试备考题库与答案详解
- 2026重庆市永川区永昌街道办事处招聘全日制公益性岗位人员1人考试备考题库及答案解析
- 2026浙江宁波市人力资源发展服务中心赴北京科技大学招聘活动考试参考题库及答案解析
- 2026福建泉州工程职业技术学院第二批人才引进招聘考试参考题库及答案解析
- 2027清华大学第一附属医院应届毕业生招聘(第一批)笔试备考题库及答案解析
- 2026年昆明市盘龙区金辰街道办事处社区服务中心见习岗位招录(10人)笔试模拟试题及答案解析
- 2026年绵阳市游仙区公务员人员招聘考试备考题库与答案详解
- 2026年榆林市榆阳区公务员人员招聘考试备考试题与答案详解
- 2026年上海企业负责人a证模拟试卷目带答案
- 浙江宁波市2026-2027学年第一学期模拟考试高三语文试卷(含答案)
- 2026年江苏省职业院校技能大赛-高职组(药学技能赛项)考试题库(带答案)
- 2026年译林版五年级英语上册期中测试卷(含答案)-中等难度第10套-含答案解析
- 2026年《口腔颌面部外伤诊疗指南》
- 2026年新修订《中国共产党发展党员工作细则》逐条全文精讲(权威完整版)
- 墙面抹灰空鼓开裂修补方案
- 林木采伐专项施工方案
- 青岛水务集团招聘74人笔试试题
- 2026年价格鉴证师《法学基础知识与价格政策法规》真题及答案解析
- 肠道与健康-课件
评论
0/150
提交评论