中间件课件Corba内容补充

上传人:206****923 文档编号:46774531 上传时间:2018-06-27 格式:PDF 页数:88 大小:608.18KB
返回 下载 相关 举报
中间件课件Corba内容补充_第1页
第1页 / 共88页
中间件课件Corba内容补充_第2页
第2页 / 共88页
中间件课件Corba内容补充_第3页
第3页 / 共88页
中间件课件Corba内容补充_第4页
第4页 / 共88页
中间件课件Corba内容补充_第5页
第5页 / 共88页
点击查看更多>>
资源描述

《中间件课件Corba内容补充》由会员分享,可在线阅读,更多相关《中间件课件Corba内容补充(88页珍藏版)》请在金锄头文库上搜索。

1、1中间件技术中间件技术 Middleware technologyCORBACORBA 内容补充内容补充赖永炫 博士 厦门大学 软件学院2内容内容对象管理体系结构(OMA)CORBA的组成结构IDL语法及Java IDLCORBA服务开发实例3Java CORBA ProductsJava CORBA ProductsThe Java 2 ORBVisiBroker for JavaOrbixWebNetscape CommunicatorVarious free or shareware ORBs4Java IDLJava IDLShould be named “Java CORBA” Mo

2、re than just IDL Full (?) implementation of CORBA in 100% JavaThree Parts ORB Naming Service idltojava compilerShips with JDK 1.25Transparent APITransparent APIJavaIDL turns IDL into direct method callsEasy to programClients have no knowledge of implementationHighly portable6The Java ORBThe Java ORB

3、100% JavaGenericAllows Java IDL applications to run either as stand-alone Java applications, or as applets within Java-enabled browsersUses IIOP7Other Java ORBsOther Java ORBsVisigenic (Inprise) VisiBroker Netscape Communicator Oracle Web Server 3.0 Free downloadIona OrbixWeb8IDL to Java MappingIDL

4、to Java MappingDefined by OMGTranslates IDL concepts into Java language constructsEverything is accessible by writing normal- looking Java code9IDL to Java Type MappingIDL to Java Type MappingIDL Type boolean char / wchar octet short / unsigned short long / unsigned long long long / unsigned long lo

5、ng float double string / wstringJava Type boolean char byte short int long float double String10IDL vs. Java vs. C+ conceptsIDL vs. Java vs. C+ conceptsIDLJavaC+ module package namespaceinterface interface abstract classoperation method member functionattribute pair of pair of methods functions11IDL

6、 ModulesIDL ModulesMap to Java packages Unfortunately, it has the root level name of the moduleClutters up your package hierarchye.g. module Calc - package Calc interface Calc.Adder not package ORG.omg.CORBA.modules.Calc12IDL InterfacesIDL InterfacesMap to Java interfacesMap to Java methods13IDL Att

7、ributesIDL AttributesMap to pair of functionsIDL string name;Java public void name(String val); public String name();14idltojavaidltojavaDevelopment toolAutomatically generates java stubs, skeletons, helpers, holders, .Generates stubs for specific remote interfaces15StubsStubsJava objects call stub

8、methodsStubs communicate with CORBA objects and vice versaTransparent integration16SkeletonsSkeletonsORB passes request to skeleton (like a stub)Skeleton calls local implementationRemote Interfaces and StubsRemote Interfaces and StubsIDL InterfaceStubRemote Object (Server)ClientSkeletonimplementsimp

9、lementsextends18Show Me The Source CodeShow Me The Source CodeOK, here it comes.19idltojava inputidltojava inputHello.idl module hello interface Hello string sayHello(); oneway void shutdown(); ; ;20idltojava outputidltojava outputidlj -fall Hello.idl HelloPOA.java: This abstract class is the stream

10、- based server skeleton, providing basic CORBA functionality for the server. It extends org.omg.PortableServer.Servant, and implements the InvokeHandler interface and the HelloOperations interface. The server class, HelloServant, extends HelloPOA. 21 _HelloStub.java This class is the client stub, pr

11、oviding CORBA functionality for the client. It extends org.omg.CORBA.portable.ObjectImpl and implements the Hello.java interface. Hello.java This interface contains the Java version of our IDL interface. The Hello.java interface extends org.omg.CORBA.Object, providing standard CORBA object functiona

12、lity. It also extends the HelloOperations interface and org.omg.CORBA.portable.IDLEntity. 22 HelloHelper.java This class provides auxiliary functionality, notably the narrow() method required to cast CORBA object references to their proper types. The Helper class is responsible for reading and writi

13、ng the data type to CORBA streams, and inserting and extracting the data type from Anys. The Holder class delegates to the methods in the Helper class for reading and writing. HelloHolder.java This final class holds a public instance member of type Hello. Whenever the IDL type is an out or an inout

14、parameter, the Holder class is used. It provides operations for org.omg.CORBA.portable.OutputStream and org.omg.CORBA.portable.InputStream arguments, which CORBA allows, but which do not map easily to Javas semantics. The Holder class delegates to the methods in the Helper class for reading and writ

15、ing. It implements org.omg.CORBA.portable.Streamable. 23 HelloOperations.java This interface contains the methods sayHello() and shutdown(). The IDL-to-Java mapping puts all of the operations defined on the IDL interface into this file, which is shared by both the stubs and skeletons.24HelloImpl.jav

16、aHelloImpl.javapackage hello; import org.omg.CosNaming.*; import org.omg.CosNaming.NamingContextPackage.*; import org.omg.CORBA.*; import org.omg.PortableServer.*;import java.util.Properties; public class HelloImpl extends HelloPOA private ORB orb; public void setORB(ORB orb_val) orb = orb_val; / implement sayHello() method publi

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号