1 / 24

Introduction

Introduction. CORBA loves Java! CORBA provides a platform-independent, language-independent way to write applications that can invoke objects that live across the room or across the planet.

fran
Download Presentation

Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction • CORBA loves Java! • CORBA provides a platform-independent, language-independent way to write applications that can invoke objects that live across the room or across the planet. • Java is an object-oriented language that's ideal for writing the clients and servers living on the Object Bus.

  2. What is CORBA? • Common Object Request Broker Architecture • Communication infrastructure for distributed objects • Allows a heterogeneous, distributed collection of objects to collaborate transparently What is the OMG? • Designers of CORBA • Consortium of 700+ companies • Not including Microsoft • Members: • platform vendors • database vendors • software tool developers • corporate developers • software application vendors

  3. Basic CORBA Architecture Server Client response request ORB ORB “Object Bus”

  4. CORBA Objects • Examples • Service • Client • Component • Business object • CORBA objects approach universal accessibility • Any Language • Any Host on network • Any Platform CORBA Elements • ORB • CORBA Services • CORBA Facilities • Application Objects

  5. ORB • Object Request Broker • “Object Bus” • Handles all communication among objects • Each host (machine) has its own ORB • ORBs know how to talk to each other • ORB also provides basic services to client ORB Responsibilities • Find the object implementation for the request • Prepare the object implementation to receive the request • Communicate the data making up the request • Retrieve results of request

  6. IIOP • Internet Inter-Orb Protocol • Network or “wire” protocol • Works across TCP/IP (the Internet protocol) What is an ORB really? • Not a separate process • Library code that executes in-process • Listens to TCP ports for connections • One port per local object • Opens TCP sockets to other objects • N ports per remote machine

  7. ORB Features • Method invocations • Static and Dynamic • Remote objects or CORBA services • High-level language bindings • Use your favorite language; ORB translates • Self-describing • Provides metadata for all objects and services • Local or remote • Same API wherever target object lives • Preserves context • Distributed security and transactions • Coexistence with legacy code • Just provide a wrapper object

  8. IDL • Interface Definition Language • Defines protocol to access objects • Like a contract • Well-specified • Language-independent IDL Example module Calc { interface Adder { long add(in long x, in long y); } } • Defines an object called Adder with a method called add

  9. Stubs and Skeletons • Stub • lives on client • pretends to be remote object • Skeleton • lives on server • receives requests from stub • talks to true remote object • delivers response to stub Client vs. Server • in CORBA, a client is a client relative to a particular object • i.e. an object with a reference to a “server” object • A client may also act as a server • If it has an IDL and stubs and skeletons • Technically, a CORBA server contains one or more CORBA objects

  10. Stubs and Skeletons Client Host Machine Server Host Machine Client Object Remote Object Stub Skeleton ORB ORB IIOP

  11. CORBA Services • APIs for low-level, common tasks • Life Cycle Service • creating, copying, moving, removing objects • Naming Service • Register objects with a name • Look up objects by name • Concurrency Control Service • Obtain and release exclusive locks • Transaction Service • Two-phase commit coordination • Supports nested transactions • Persistence Service • Storing objects in a variety of databases • RDBMS, OODBMS, file systems • Relationship • Externalization • Query • Licensing • Security Service • Authentication, ACLs, encryption, etc. • Event Service • Uncoupled notifications

  12. CORBA Facilities • Frameworks for specialized applications • Distributed Document Component Facility • OpenDoc • In progress: • Agents • Business Objects • Internationalization Three Tiers • User Interface Tier • Business Logic Tier • Data Storage Tier • Can use CORBA objects in each tier

  13. ORB ORB ORB ORB N-Tier Design with CORBA Storage “Tier” DB ORB ORB DB Data Object ORB TP Monitor ORB ORB Service “Tier” Business Object Tier Client Tier

  14. Java CORBA Products Java IDL - Using CORBA from Java • The Java 2 ORB • VisiBroker for Java • OrbixWeb • Netscape Communicator • Various free or shareware ORBs Java IDL • Should be named “Java CORBA” • More than just IDL • Full implementation of CORBA in 100% Java • Three Parts • ORB • Naming Service • idltojava compiler • Ships with JDK 1.2

  15. The Java ORB • 100% Java • Generic • Allows Java IDL applications to run either as stand-alone Java applications, or as applets within Java-enabled browsers • Uses IIOP Other Java ORBs • Visigenic (Inprise) VisiBroker • Netscape Communicator • Oracle Web Server 3.0 • Free download • Iona OrbixWeb

  16. IDL to Java Type Mapping Java Type boolean char byte short int long float double String IDL Type boolean char / wchar octet short / unsigned short long / unsigned long long long / unsigned long long float double string / wstring IDL vs. Java vs. C++ concepts IDLJavaC++ module package namespace interface interface abstract class operation method member function attribute pair of pair of methods functions

  17. IDL Modules • Map to Java packages • It has the root level name of the module • Clutters up the package hierarchy • e.g. module Calc -> • package Calc • interface Calc.Adder • not package ORG.omg.CORBA.modules.Calc IDL Attributes • Map to pair of functions • IDL • string name; • Java • public void name(String val); • public String name();

  18. idltojava • Development tool • Automatically generates java stubs, skeletons, helpers, holders, ... • Generates stubs for specific remote interfaces Skeletons • Java objects call stub methods • Stubs communicate with CORBA objects • and vice versa • Transparent integration Stubs • ORB passes request to skeleton (like a stub) • Skeleton calls local implementation

  19. Remote Interfaces and Stubs IDL Interface implements implements extends Client Stub Skeleton Remote Object (Server)

  20. idltojava input • Calc.idl module Calc { interface Adder { long add(in long x, in long y); } } idltojava output • idltojava Calc.idl • Adder.java (a Java interface that maps the IDL interface) • _AdderStub.java (a client stub) • _AdderImplBase.java (a server skeleton) • AdderHelper.java (a helper class) • AdderHolder.java (a holder class) • Must compile these files and put them in the CLASSPATH

  21. CORBA Flow Client Virtual Machine Server Virtual Machine Client Remote Object Skeleton Stub Server “Fred” Name Server Virtual Machine

  22. CORBA Flow Client Virtual Machine Server Virtual Machine 1. Server Creates Remote Object2. Server Registers Remote Object Client Remote Object 1 Skeleton Stub Server 2 “Fred” Name Server Virtual Machine

  23. CORBA Flow Client Virtual Machine Server Virtual Machine 3. Client requests object from Name Server 4. Name Server returns remote reference (and stub gets created) Client Remote Object Skeleton Server Stub 3 4 “Fred” Name Server Virtual Machine

  24. RMI Flow Client Virtual Machine Server Virtual Machine 5. Client invokes stub method 6. Stub talks to skeleton 7. Skeleton invokes remote object method Client Remote Object 5 7 Skeleton 6 Stub Server “Fred” Name Server Virtual Machine

More Related