分布式計(jì)算原理與應(yīng)用(Distributed-Computing)第八章課件_第1頁(yè)
分布式計(jì)算原理與應(yīng)用(Distributed-Computing)第八章課件_第2頁(yè)
分布式計(jì)算原理與應(yīng)用(Distributed-Computing)第八章課件_第3頁(yè)
分布式計(jì)算原理與應(yīng)用(Distributed-Computing)第八章課件_第4頁(yè)
分布式計(jì)算原理與應(yīng)用(Distributed-Computing)第八章課件_第5頁(yè)
已閱讀5頁(yè),還剩59頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

AdvancedRemoteMethodInvocationsM.L.Liu11/30/20221DistributedComputing,M.L.LiuAdvancedRemoteMethodInvocatRMI–AdvancedtopicsTheJavaRMIAPIhasarichcollectionoffeatures.WewilllookatsomeofRMI’smoreinterestingadvancedfeatures,namely:

stubdownloadingsecuritymanagerclientcallback.Althoughthesefeaturesarenotinherenttothedistributedobjectparadigm,theyarehelpfulmechanismsandcanbeusefultoapplicationdevelopers.11/30/20222DistributedComputing,M.L.LiuRMI–AdvancedtopicsTheJavaTheJavaRMIArchitecture11/30/20223DistributedComputing,M.L.LiuTheJavaRMIArchitecture11/30JavaRMIClientServerInteraction11/30/20224DistributedComputing,M.L.LiuJavaRMIClientServerInteracRMIStubDownloadingRMIisdesignedtoallowstubstobemadeavailabletotheclientdynamically.Doingsoallowschangestobemadeintheremotemethodswithoutaffectingtheclientprogram.ThestubcanbefiledwithanwebserverandbedownloadedusingHTTP.Securitymeasuresareneededtopreventboththeclientsideandtheserverside:Ajavasecuritypolicyfileneedstobesetontheserverhostandalsoontheclienthost.AJavaSecurityManagershouldbeinstantiatedinboththeclientandserverprograms.11/30/20225DistributedComputing,M.L.LiuRMIStubDownloadingRMIisdesStubdownloadingIfthestubistobedownloadedfromaremoteserver,transferthestubclasstotheappropriatedirectoryonthatserver,e.g.,/~mliu/www,andmakesurethattheaccesspermissiontothefileisset.Whenactivatingtheserver,specifycommandoptions:

11/30/20226DistributedComputing,M.L.LiuStubdownloadingIfthestubisThejava.policyfileTheRMIsecuritymanagerdoesnotpermitnetworkaccess.Exceptionscanbemadeviathespecificationinajava.policyfile. grant{ //permitssocketaccesstoallcommonTCPports,includingthedefault//RMIregistryport(1099)–needforboththeclientandtheserver.permission.SocketPermission"*:1024-65535","connect,accept,resolve";//permitssocketaccesstoport80,thedefaultHTTPport–needed//byclienttocontactanHTTPserverforstubdownloadingpermission.SocketPermission"*:80","connect";};

Thisfilecanbefiledinthesamedirectoryastheserverclassfile.Whenactiviatingtheclient,ajava.policyfilealsoshouldbespecified:java-Djava.security.policy=java.policySomeClientSee/products/jdk/1.2/docs/guide/security/PolicyFiles.htmland/products/jdk/1.2/docs/guide/security/permissions.html11/30/20227DistributedComputing,M.L.LiuThejava.policyfileTheRMIseFilePlacements11/30/20228DistributedComputing,M.L.LiuFilePlacements11/30/20228DistRMISecurityManagerSinceRMIinvolvesaccessto/fromaforeignhost,andpossiblyobjectdownloading,itisimportantforboththeserverandtheclienttoprotectitssystemfrommaliciousaccess.TheRMISecurityManagerisaclassprovidedJava,andcanbeinstantiatedinboththeclientandtheserverforlimitingaccesspriviledges.Youcanwriteyourownsecuritymanager,ifsodesired.

try{System.setSecurityManager(newRMISecurityManager());}catch{…}11/30/20229DistributedComputing,M.L.LiuRMISecurityManagerSinceRMIAlgorithmforbuildinganRMIApplicationServerside:Openadirectoryforallthefilestobegeneratedforthisapplication.Specifytheremote-serverinterface,andcompileittogeneratetheinterfaceclassfile.Buildtheremoteserverclassbyimplementingtheinterface,andcompileitusingjavac.Usermictoprocesstheserverclasstogenerateastub.classfileandaskelton.classfile:rmicSomeServerIfstubdownloadingisdesired,copythestubfiletoanappropriatedirectoryontheHTTPhost.ActivatetheRMIRegistry,ifithasnotalreadybeenactivated.Setupajava.policyfile.Activatetheserver,specifying(i)thecodebaseifstubdownloadingisdesired,(ii)theserverhostname,and(iii)thesecuritypolicyfile.

11/30/202210DistributedComputing,M.L.LiuAlgorithmforbuildinganRMIAlogorithmforbuildinganRMIApplicationClientside:Openadirectoryforallthefilestobegeneratedforthisapplication.Implementtheclientprogramorapplet,andcompileittogeneratetheclientclass.Ifstubdownloadingisnotineffect,copytheserverinterfacestubclassfilebyhand.Setupajava.policyfile.Activatetheclient,specifying(i)theserverhostname,and(ii)thesecuritypolicyfile.

11/30/202211DistributedComputing,M.L.LiuAlogorithmforbuildinganRMIRMICallbacks11/30/202212DistributedComputing,M.L.LiuRMICallbacks11/30/202212DistrIntroductionIntheclientservermodel,theserverispassive:theIPCisinitiatedbytheclient;theserverwaitsforthearrivalofrequestsandprovidesresponses.Someapplicationsrequiretheservertoinitiatecommunicationuponcertainevents.Examplesapplicationsare:monitoringgamesauctioningvoting/pollingchat-toommessage/bulletinboardgroupware11/30/202213DistributedComputing,M.L.LiuIntroductionIntheclientservPollingvs.CallbackIntheabsenceofcallback,aclientwillhavetopollapassiveserverrepeatedlyifitneedstobenotifiedthataneventhasoccurredattheserverend.11/30/202214DistributedComputing,M.L.LiuPollingvs.CallbackIntheabsTwo-waycommunicationsSomeapplicationsrequirethatbothsidesmayinitiateIPC.Usingsockets,duplexcommunicationcanbeachievedbyusingtwosocketsoneitherside.Withconnection-orientedsockets,eachsideactsasbothaclientandaserver.11/30/202215DistributedComputing,M.L.LiuTwo-waycommunicationsSomeappRMICallbacksAcallbackclientregistersitselfwithanRMIserver.Theservermakesacallbacktoeachregisteredclientupontheoccurrenceofacertainevent.11/30/202216DistributedComputing,M.L.LiuRMICallbacksAcallbackclientCallbackClient-ServerInteractions11/30/202217DistributedComputing,M.L.LiuCallbackClient-ServerInteracCallbackapplicationfiles11/30/202218DistributedComputing,M.L.LiuCallbackapplicationfiles11/3RMICallbackfileplacements11/30/202219DistributedComputing,M.L.LiuRMICallbackfileplacements11TheHelloApplicationwithCallback

11/30/202220DistributedComputing,M.L.LiuTheHelloApplicationwithCalRMICallbackInterfaceTheserverprovidesaremotemethodwhichallowsaclienttoregisteritselfforcallbacks.ARemoteinterfaceforthecallbackisneeded,inadditiontotheserver-sideinterface.Theinterfacespecifiesamethodforacceptingacallbackfromtheserver.TheclientprogramisasubclassofRemoteObjectandimplementsthecallbackinterface,includingthecallbackmethod.Theclientregistersitselfforcallbackinitsmainmethod.Theserverinvokestheclient’sremotemethodupontheoccurrenceoftheanticipatedevent.11/30/202221DistributedComputing,M.L.LiuRMICallbackInterfaceTheservRemoteInterfaceforServerpublicinterfaceHelloInterfaceextendsRemote{//remotemethodpublicStringsayHello()throwsjava.rmi.RemoteException;

//methodtobeinvokedbyaclienttoadditselftothecallbacklistpublicvoidaddCallback(HelloCallbackInterfaceCallbackObject)throwsjava.rmi.RemoteException;}11/30/202222DistributedComputing,M.L.LiuRemoteInterfaceforServerpubRemoteInterfaceforCallbackClient//aninterfacespecifyingacallbackmethodpublicinterfaceHelloCallbackInterfaceextendsjava.rmi.Remote{

//methodtobecalledbytheserveroncallbackpublicvoidcallMe(Stringmessage)throwsjava.rmi.RemoteException;}11/30/202223DistributedComputing,M.L.LiuRemoteInterfaceforCallbackHelloServer,withcallbackpublicclassHelloServerextendsUnicastRemoteObjectimplementsHelloInterface{staticintRMIPort;

//vectorforstorelistofcallbackobjectsprivatestaticVectorcallbackObjects;publicHelloServer()throwsRemoteException{super();

//instantiateaVectorobjectforstoringcallbackobjectscallbackObjects=newVector();}

//methodforclienttocalltoadditselftoitscallbackpublicvoidaddCallback(HelloCallbackInterfaceCallbackObject){//storethecallbackobjectintothevectorSystem.out.println("Servergotan'addCallback'call.");callbackObjects.addElement(CallbackObject);}

11/30/202224DistributedComputing,M.L.LiuHelloServer,withcallbackpublHelloServer,withcallback-2publicstaticvoidmain(Stringargs[]){…registry=LocateRegistry.createRegistry(RMIPort);…

callback();…}//endmainprivatestaticvoidcallback(){…

for(inti=0;i<callbackObjects.size();i++){System.out.println("Nowperformingthe"+i+"thcallback\n");//convertthevectorobjecttoacallbackobject

HelloCallbackInterfaceclient=(HelloCallbackInterface)callbackObjects.elementAt(i);…client.callMe("Servercallingbacktoclient"+i);…11/30/202225DistributedComputing,M.L.LiuHelloServer,withcallback-AlogorithmforbuildinganRMICallbackApplicationServerside:Openadirectoryforallthefilestobegeneratedforthisapplication.Specifytheremote-serverinterface,andcompileittogeneratetheinterfaceclassfile.Buildtheremoteserverclassbyimplementingtheinterface,andcompileitusingjavac.Usermictoprocesstheserverclasstogenerateastub.classfileandaskelton.classfile:rmicSomeServerIfstubdownloadingisdesired,copythestubfiletoanappropriatedirectoryontheHTTPhost.ActivatetheRMIRegistry,ifithasnotalreadybeenactivated.Setupajava.policyfile.Activatetheserver,specifying(i)thecodebaseifstubdownloadingisdesired,(ii)theserverhostname,and(iii)thesecuritypolicyfile.ObtaintheCallbackInterface.Compileitwithjavac,thenusermictogeneratethestubfileforthecallback.

11/30/202226DistributedComputing,M.L.LiuAlogorithmforbuildinganRMIAlogorithmforbuildinganRMICallbackApplicationClientside:Openadirectoryforallthefilestobegeneratedforthisapplication.Implementtheclientprogramorapplet,andcompileittogeneratetheclientclass.Ifstubdownloadingisnotineffect,copytheserverinterfacestubclassfilebyhand.Implementthecallbackinterface.Compileitusingjavac,thenusingrmictogenerateastubclassandaskeletonclassforit.Setupajava.policyfile.Activatetheclient,specifying(i)theserverhostname,and(ii)thesecuritypolicyfile.

11/30/202227DistributedComputing,M.L.LiuAlogorithmforbuildinganRMIHelloClient,withcallback

HelloClient(){//constructorSystem.setSecurityManager(newRMISecurityManager());//exportthisobjectasaremoteobjectUnicastRemoteObject.exportObject(this);//…Registryregistry=LocateRegistry.getRegistry("localhost",RMIPort);h=(HelloInterface)registry.lookup("helloLiu");h.addCallback(this);//…}//endconstructor

//callbackmethod-thisdisplaysthemessagesentbytheserverpublicvoidcallMe(Stringmessage){System.out.println("Callbackreceived:"+message);}publicstaticvoidmain(Stringargs[]){//…

HelloClientclient=newHelloClient();//…

while(true){;}//endwhile}//endmain}//endHelloClientclass11/30/202228DistributedComputing,M.L.LiuHelloClient,withcallbackHelloServer,HelloClient11/30/202229DistributedComputing,M.L.LiuHelloServer,HelloClient11/30/Summary-1Clientcallback:Clientcallbackisusefulforanapplicationwheretheclientsdesiretobenotifiedbytheserveroftheoccurrenceofsomeevent.Clientcallbackallowsanobjectservertomakeremotemethodcalltoaclientviaareferencetoaclientremoteinterface.11/30/202230DistributedComputing,M.L.LiuSummary-1Clientcallback:11/30Summary-2Clientcallback:Toprovideclientcallback,theclient-sidesoftwaresuppliesaremoteinterface,instantiateanobjectwhichimplementstheinterface,passesareferencetotheobjecttotheserverviaaremotemethodcalltotheserver.Theobjectserver:collectstheseclientreferencesinadatastructure.whentheawaitedeventoccurs,theobjectserverinvokesthecallbackmethod(definedintheclientremoteinterface)topassdatatotheclient.Twosetsofstub-skeletonsareneeded:onefortheserverremoteinterface,theotheronefortheclientremoteinterface.Twosetsofstub-skeletonsareneeded:onefortheserverremoteinterface,theotheronefortheclientremoteinterface.11/30/202231DistributedComputing,M.L.LiuSummary-2Clientcallback:11/30Summary-3Stubdownloadingallowsastubclasstobeloadedtoanobjectclientatruntime,therebyallowingaremoteobject’simplementationtobemodifiedanditsstubclassregeneratedwithoutaffectingthesoftwareontheclienthost.

AsecuritymanageroverseesaccessrestrictionsspecifiedinaJavasecuritypolicyfile,whichcanbeasystem-widepolicyfile,orapolicyfileappliedtoanindividualapplicationonly.Forsecurityprotection,theuseofsecuritymanagersisrecommendedinallRMIapplications,regardlessofwhetherstubdownloadingisinvolved.

11/30/202232DistributedComputing,M.L.LiuSummary-3StubdownloadingalloAdvancedRemoteMethodInvocationsM.L.Liu11/30/202233DistributedComputing,M.L.LiuAdvancedRemoteMethodInvocatRMI–AdvancedtopicsTheJavaRMIAPIhasarichcollectionoffeatures.WewilllookatsomeofRMI’smoreinterestingadvancedfeatures,namely:

stubdownloadingsecuritymanagerclientcallback.Althoughthesefeaturesarenotinherenttothedistributedobjectparadigm,theyarehelpfulmechanismsandcanbeusefultoapplicationdevelopers.11/30/202234DistributedComputing,M.L.LiuRMI–AdvancedtopicsTheJavaTheJavaRMIArchitecture11/30/202235DistributedComputing,M.L.LiuTheJavaRMIArchitecture11/30JavaRMIClientServerInteraction11/30/202236DistributedComputing,M.L.LiuJavaRMIClientServerInteracRMIStubDownloadingRMIisdesignedtoallowstubstobemadeavailabletotheclientdynamically.Doingsoallowschangestobemadeintheremotemethodswithoutaffectingtheclientprogram.ThestubcanbefiledwithanwebserverandbedownloadedusingHTTP.Securitymeasuresareneededtopreventboththeclientsideandtheserverside:Ajavasecuritypolicyfileneedstobesetontheserverhostandalsoontheclienthost.AJavaSecurityManagershouldbeinstantiatedinboththeclientandserverprograms.11/30/202237DistributedComputing,M.L.LiuRMIStubDownloadingRMIisdesStubdownloadingIfthestubistobedownloadedfromaremoteserver,transferthestubclasstotheappropriatedirectoryonthatserver,e.g.,/~mliu/www,andmakesurethattheaccesspermissiontothefileisset.Whenactivatingtheserver,specifycommandoptions:

11/30/202238DistributedComputing,M.L.LiuStubdownloadingIfthestubisThejava.policyfileTheRMIsecuritymanagerdoesnotpermitnetworkaccess.Exceptionscanbemadeviathespecificationinajava.policyfile. grant{ //permitssocketaccesstoallcommonTCPports,includingthedefault//RMIregistryport(1099)–needforboththeclientandtheserver.permission.SocketPermission"*:1024-65535","connect,accept,resolve";//permitssocketaccesstoport80,thedefaultHTTPport–needed//byclienttocontactanHTTPserverforstubdownloadingpermission.SocketPermission"*:80","connect";};

Thisfilecanbefiledinthesamedirectoryastheserverclassfile.Whenactiviatingtheclient,ajava.policyfilealsoshouldbespecified:java-Djava.security.policy=java.policySomeClientSee/products/jdk/1.2/docs/guide/security/PolicyFiles.htmland/products/jdk/1.2/docs/guide/security/permissions.html11/30/202239DistributedComputing,M.L.LiuThejava.policyfileTheRMIseFilePlacements11/30/202240DistributedComputing,M.L.LiuFilePlacements11/30/20228DistRMISecurityManagerSinceRMIinvolvesaccessto/fromaforeignhost,andpossiblyobjectdownloading,itisimportantforboththeserverandtheclienttoprotectitssystemfrommaliciousaccess.TheRMISecurityManagerisaclassprovidedJava,andcanbeinstantiatedinboththeclientandtheserverforlimitingaccesspriviledges.Youcanwriteyourownsecuritymanager,ifsodesired.

try{System.setSecurityManager(newRMISecurityManager());}catch{…}11/30/202241DistributedComputing,M.L.LiuRMISecurityManagerSinceRMIAlgorithmforbuildinganRMIApplicationServerside:Openadirectoryforallthefilestobegeneratedforthisapplication.Specifytheremote-serverinterface,andcompileittogeneratetheinterfaceclassfile.Buildtheremoteserverclassbyimplementingtheinterface,andcompileitusingjavac.Usermictoprocesstheserverclasstogenerateastub.classfileandaskelton.classfile:rmicSomeServerIfstubdownloadingisdesired,copythestubfiletoanappropriatedirectoryontheHTTPhost.ActivatetheRMIRegistry,ifithasnotalreadybeenactivated.Setupajava.policyfile.Activatetheserver,specifying(i)thecodebaseifstubdownloadingisdesired,(ii)theserverhostname,and(iii)thesecuritypolicyfile.

11/30/202242DistributedComputing,M.L.LiuAlgorithmforbuildinganRMIAlogorithmforbuildinganRMIApplicationClientside:Openadirectoryforallthefilestobegeneratedforthisapplication.Implementtheclientprogramorapplet,andcompileittogeneratetheclientclass.Ifstubdownloadingisnotineffect,copytheserverinterfacestubclassfilebyhand.Setupajava.policyfile.Activatetheclient,specifying(i)theserverhostname,and(ii)thesecuritypolicyfile.

11/30/202243DistributedComputing,M.L.LiuAlogorithmforbuildinganRMIRMICallbacks11/30/202244DistributedComputing,M.L.LiuRMICallbacks11/30/202212DistrIntroductionIntheclientservermodel,theserverispassive:theIPCisinitiatedbytheclient;theserverwaitsforthearrivalofrequestsandprovidesresponses.Someapplicationsrequiretheservertoinitiatecommunicationuponcertainevents.Examplesapplicationsare:monitoringgamesauctioningvoting/pollingchat-toommessage/bulletinboardgroupware11/30/202245DistributedComputing,M.L.LiuIntroductionIntheclientservPollingvs.CallbackIntheabsenceofcallback,aclientwillhavetopollapassiveserverrepeatedlyifitneedstobenotifiedthataneventhasoccurredattheserverend.11/30/202246DistributedComputing,M.L.LiuPollingvs.CallbackIntheabsTwo-waycommunicationsSomeapplicationsrequirethatbothsidesmayinitiateIPC.Usingsockets,duplexcommunicationcanbeachievedbyusingtwosocketsoneitherside.Withconnection-orientedsockets,eachsideactsasbothaclientandaserver.11/30/202247DistributedComputing,M.L.LiuTwo-waycommunicationsSomeappRMICallbacksAcallbackclientregistersitselfwithanRMIserver.Theservermakesacallbacktoeachregisteredclientupontheoccurrenceofacertainevent.11/30/202248DistributedComputing,M.L.LiuRMICallbacksAcallbackclientCallbackClient-ServerInteractions11/30/202249DistributedComputing,M.L.LiuCallbackClient-ServerInteracCallbackapplicationfiles11/30/202250DistributedComputing,M.L.LiuCallbackapplicationfiles11/3RMICallbackfileplacements11/30/202251DistributedComputing,M.L.LiuRMICallbackfileplacements11TheHelloApplicationwithCallback

11/30/202252DistributedComputing,M.L.LiuTheHelloApplicationwithCalRMICallbackInterfaceTheserverprovidesaremotemethodwhichallowsaclienttoregisteritselfforcallbacks.ARemoteinterfaceforthecallbackisneeded,inadditiontotheserver-sideinterface.Theinterfacespecifiesamethodforacceptingacallbackfromtheserver.TheclientprogramisasubclassofRemoteObjectandimplementsthecallbackinterface,includingthecallbackmethod.Theclientregistersitselfforcallbackinitsmainmethod.Theserverinvokestheclient’sremotemethodupontheoccurrenceoftheanticipatedevent.11/30/202253DistributedComputing,M.L.LiuRMICallbackInterfaceTheservRemoteInterfaceforServerpublicinterfaceHelloInterfaceextendsRemote{//remotemethodpublicStringsayHello()throwsjava.rmi.RemoteException;

//methodtobeinvokedbyaclienttoadditselftothecallbacklistpublicvoidaddCallback(HelloCallbackInterfaceCallbackObject)throwsjava.rmi.RemoteException;}11/30/202254DistributedComputing,M.L.LiuRemoteInterfaceforServerpubRemoteInterfaceforCallbackClient//aninterfacespecifyingacallbackmethodpublicinterfaceHelloCallbackInterfaceextendsjava.rmi.Remote{

//methodtobecalledbytheserveroncallbackpublicvoidcallMe(Stringmessage)throwsjava.rmi.RemoteException;}11/30/202255DistributedComputing,M.L.LiuRemoteInterfaceforCallbackHelloServer,withcallbackpublicclassHelloServerextendsUnicastRemoteObjectimplementsHelloInterface{staticintRMIPort;

//vectorforstorelistofcallbackobjectsprivatestaticVectorcallbackObjects;publicHelloServer()throwsRemoteException{super();

//instantiateaVectorobjectforstoringcallbackobjectscallbackObjects=newVector();}

//methodforclienttocalltoadditselftoitscallbackpublicvoidaddCallback(HelloCallbackInterfaceCallbackObject){//storethecallbackobjectintothevectorSystem.out.println("Servergotan'addCallback'call.");callbackObjects.addElement(CallbackObject);}

11/30/202256DistributedComputing,M.L.LiuHelloServer,withcallbackpublHelloServer,withcallback-2publicstaticvoidmain(Stringargs[]){…registry=LocateRegistry.createRegistry(RMIPort);…

callback();…}//endmainprivatestaticvoidcallback(){…

for(inti=0;i<callbackObjects.size();i++){System.out.println("Nowperformingthe"+i+"thcallback\n");//convertthevectorobjecttoacallbackobject

HelloCallbackInterfaceclient=(HelloCallbackInterface)callbackObjects.elementAt(i);…client.callMe("Servercallingbacktoclient"+i);…11/30/202257DistributedComputing,M.L.LiuHelloServer,withcallback-AlogorithmforbuildinganRMICallbackApplicationServerside:Openadirectoryforallthefilestobegeneratedforthisapplication.Specifytheremote-serverinterface,andcompileittogeneratetheinterfaceclassfile.Buildtheremoteserverclassbyimplementingtheinterface,andcompileitusingjavac.Usermictoprocesstheserverclasstogenerateastub.classfileandaskelton.classfile:rmicSomeServerIfstubdownloadingisdesired,copythestubfiletoanappropriatedirectoryontheHTTPhost.ActivatetheRMIRegistry,ifithasnotalreadybeenactivated.Setupajava.policyfile.Activatetheserver,specifying(i)thecodebaseifstubdownloadingisdesired,(ii)theserverhostname,and(iii)thesecuritypolicyfile.ObtaintheCallbackInterface.Compileitwithjavac,thenusermictogeneratethestubfileforthecallback.

11/30/202258DistributedComputing,M.L.LiuAlogorithmforbuildinganRMIAlogorithmforbuildinganRMICallbackApplicationClientside:Openadirectoryforallthefilestobegeneratedforthisapplication.Implementtheclientprogramorapplet,andcompileittogeneratetheclientclass.Ifstubdownloadingisnotineffect,copytheserverinterfacestubclassfilebyhand.Implementthecallbackinterface.Compileitusingjavac,thenusingrmictogenerateastubclassandaskeletonclassforit.Setupajava.policyfile.Activatetheclient,specifying(i)theserverhostname,and(ii)thesecuritypolicyfile.

11/30/202259DistributedComputing,M.L.LiuAlogorithmforbuildinganRMIHelloClient,withcallback

HelloClient(){//constructor

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論