正在加载图片...
RMI Architecture server client RMI Tra skeleton Sample Client Code remote object stub o.myMethod () To achieve location transparency,RMI introduces two special kinds of objects known as stubs and skeletons. The stub is a client-side object that represents the remote object.The stub has the same interface,or list of methods,as the remote object,but when the client calls a stub method,the stub forwards the request via the RMI infrastructure to the remote object,which actually executes it. On the server side,the skeleton object takes care of all of the details of "remoteness"so that the actual remote object doesn't need to worry about them.In other words,you can pretty much code a remote object the same way as if it were local--the skeleton insulates the remote object from the RMI infrastructure.During remote method requests,the RMI infrastructure automatically invokes the skeleton object so it can do its magic. The best news about this setup is that you don't have to write the code for the stubs and skeletons yourself!The JDK contains a tool,rmic,that creates the class files for the stubs and skeletons for you. RMI Architecture - skeleton - remote object client - stub server RMI Transport RMI Transport MyRemoteObject o = ...; o.myMethod (); Sample Client Code To achieve location transparency, RMI introduces two special kinds of objects known as stubs and skeletons. The stub is a client-side object that represents the remote object. The stub has the same interface, or list of methods, as the remote object, but when the client calls a stub method, the stub forwards the request via the RMI infrastructure to the remote object, which actually executes it. On the server side, the skeleton object takes care of all of the details of "remoteness" so that the actual remote object doesn't need to worry about them. In other words, you can pretty much code a remote object the same way as if it were local -- the skeleton insulates the remote object from the RMI infrastructure. During remote method requests, the RMI infrastructure automatically invokes the skeleton object so it can do its magic. The best news about this setup is that you don't have to write the code for the stubs and skeletons yourself! The JDK contains a tool, rmic, that creates the class files for the stubs and skeletons for you
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有