![Page 1: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/1.jpg)
RMICORBA
Matt
![Page 2: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/2.jpg)
2
RMI VS CORBA
![Page 3: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/3.jpg)
3
![Page 4: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/4.jpg)
4
J2EE
![Page 5: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/5.jpg)
5
Sample Application
![Page 6: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/6.jpg)
6
![Page 7: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/7.jpg)
7
RMI-IIOP
![Page 8: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/8.jpg)
8
Tools
• New rmic compilerConverts Java Interfaces to IDLGenerates IIOP Stubs and tie classes
• New idlj compilerMaps IDL to JavaGenerates IIOP Stubs and tie classes
![Page 9: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/9.jpg)
9
RMI to RMI-IIOP
IIOP
RMI Java Client
RMI JavaServer
tie class
rmic -iiopComplier
stub class
RMIImplementation
![Page 10: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/10.jpg)
10
RMI to RMI-IIOP
1. Converting Server Extend your implementation class from PortableRemot
eObject rather than UnicastRemoteObject: Use JNDI naming service rather than rmiregistry.
2. Converting Client Use JNDI naming service to locate object Use PortableRemoteObject.narrow() method rather tha
n Java type cast.
![Page 11: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/11.jpg)
11
IDL to RMI-IIOP• Write Java IDL
• Use idlj compiler Generates Java MappingsGenerates stubs and skeletons
• Implement Server
• Run Server and register with JNDI service
• Develop Client and test
![Page 12: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/12.jpg)
12
RMI-IIOP• With RMI and CORBA, programmers face a cruel choice: they must deci
de between RMI, with its easy programming features, and CORBA, with its broad interoperability.
• With RMI-IIOP, programmers can create applications in RMI that include CORBA connections
• RMI over IIOP (RMI-IIOP hereafter), developed jointly by IBM and Sun, is a new version of RMI (Remote Method Invocation) for IIOP (Internet Inter-ORB Protocol) that combines RMI's easy programming features with CORBA's interoperability.
• RMI and CORBA have developed independently as distributed-objects programming models. RMI, a foundation of the EJB and Jini technologies, was introduced as a Java-based, easy-to-use programming model for distributed objects. CORBA (the Common Object Request Broker Architecture), defined by the OMG (Object Management Group), is a well-known distributed-object programming model that supports a number of languages. The IIOP protocol connects CORBA products from different vendors, ensuring interoperability among them. RMI-IIOP is, in a sense, a marriage of RMI and CORBA.
![Page 13: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/13.jpg)
13
RMI-IIOP
• 與 J2EE 1.3相容的 server都有 RMI-IIOP實作功能,可以協助處理各種網路問題
![Page 14: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/14.jpg)
14
Before RMI-IIOP
![Page 15: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/15.jpg)
15
• It used to be difficult to choose between RMI (JRMP) and CORBA when starting a new project. If you selected RMI (JRMP), you got easy programming, but lost interoperability across multiple languages.
• If you selected CORBA, you got interoperability, but faced a more daunting programming task.
Please connect the two Please connect the two
![Page 16: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/16.jpg)
16
Java RMI clients can access RMI/IIOP objects through ordinary RMI interfaces. CORBA clients need equivalent interfaces in IDL.
![Page 17: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/17.jpg)
17
Java RMI clients can access RMI/IIOP objects implemented as CORBA objects through ordinary RMI interfaces. CORBA clients
and RMI/IIOP object implementations need equivalent interfaces in IDL.
![Page 18: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/18.jpg)
18
• Example of interoperability scenario between different vendors of EJB
containers.
![Page 19: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/19.jpg)
19
RMI/IIOP architecture.
![Page 20: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/20.jpg)
20
RMI
![Page 21: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/21.jpg)
21
RMI Architecture
![Page 22: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/22.jpg)
22
![Page 23: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/23.jpg)
23
Java IDL
![Page 24: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/24.jpg)
24
![Page 25: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/25.jpg)
25
CORBA
![Page 26: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/26.jpg)
26
CORBA• CORBA (Common Object Request Broker Architecture) 是在 1992年由 OM
G(Open Management Group) 組織提出的。那時的分佈式應用環境都採用 Client/Server架構, CORBA的應用很大程度的提高了分佈式應用軟體的開發效率。
• CORBA的 IDL採用類 C++的定義,是公開的規範
• IIOP是 Internet CORBA互換性的通訊協定
• Object Request Broker (ORB)是 CORBA之間網路傳遞的基礎, ORB負責找到服務方法的物件,負責處理參數傳遞與傳回結果
![Page 27: RMI CORBA Matt. 2 RMI VS CORBA 3 4 J2EE 5 Sample Application](https://reader035.vdocument.in/reader035/viewer/2022062408/56649f355503460f94c54044/html5/thumbnails/27.jpg)
27
CORBA
• IDL用來發展與整合 CORBA物件的服務, IDL是一個可攜型的規格語言。使用 IDL編譯器可以產生前面所提到的 Stub和 Skeleton程式碼,並且可以對應許多高階程式語言(如:Java、 Smalltalk、 C++等等)
• 有了 IDL, CORBA應用程式可以是由不同程式語言撰寫的
• IDL與 Java結合