Top Banner
1 95-702 OCT Master of Information System Management QuickTime™ and a TIFF (Uncompressed) d are needed to see t Organizational Communications and Distributed Object Technologies Lecture 13: CORBA
21

Organizational Communications and Distributed Object Technologies

Jan 17, 2016

Download

Documents

glenys

Organizational Communications and Distributed Object Technologies. Lecture 13: CORBA. CORBA. Chapter 20 Coulouris text. Today’s Topics. CORBA History and goals CORBA RMI CORBA services The Distributed Whiteboard Revisited. CORBA History and Goals. Object Management Group Formed in 1989 - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Organizational Communications and Distributed Object Technologies

195-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Organizational Communications and Distributed Object Technologies

Lecture 13: CORBA

Page 2: Organizational Communications and Distributed Object Technologies

295-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

CORBA

Chapter 20 Coulouris text

Page 3: Organizational Communications and Distributed Object Technologies

395-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Today’s Topics

• CORBA History and goals• CORBA RMI• CORBA services• The Distributed Whiteboard

Revisited

Page 4: Organizational Communications and Distributed Object Technologies

495-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

CORBA History and Goals

• Object Management Group Formed in 1989

• Goals: -- OOP on distributed systems -- heterogeneous hardware -- heterogeneous OS -- different programming languages

Page 5: Organizational Communications and Distributed Object Technologies

595-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

History and Goals

• OMG Introduced the Object Request Broker (ORB)

• The role of the ORB is to help a client find an object, activate the object if necessary, and call a method on the object.

• Common Object Request Broker Architecture (CORBA) agreed to by a group of companies in 1991

• CORBA 2.0 specification released in 1996

Page 6: Organizational Communications and Distributed Object Technologies

695-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

History and Goals

• CORBA 2.0 specification defined standards for different implementations of CORBA to communicate with one another

• These standards are called the General Inter-ORB protocol (GIOP) and may run over various transports

• GIOP over TCP/IP is called the Internet Inter-ORB Protocol

Page 7: Organizational Communications and Distributed Object Technologies

795-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

CORBA RMI

• Main components -- An Interface Definition language (IDL) that promotes the use of different programming languages, stubs are generated in the client’s language and skeletons are generated in the server’s language -- An architecture -- GIOP defines an external data representation (CDR) as well as message formats and message types -- Message types include request and reply as well as location requests, errors, and request cancellations

Page 8: Organizational Communications and Distributed Object Technologies

895-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

CORBA Services• A set of generic services that can be used for distributed application -- Naming Service (location by name) -- Trading Service (location by attribute - directory service) -- Event Service -- Security Service (authentication, ACL’s, auditing, non- repudiation) -- Transaction Service (begin, commit, rollback a series of RMI calls using the Two Phase Commit Protocol) -- Persistent Object Service (POS)

Page 9: Organizational Communications and Distributed Object Technologies

995-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

The Distributed Whiteboard Example in CORBA

Page 10: Organizational Communications and Distributed Object Technologies

1095-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

IDL Interfaces Shape and ShapeList

struct Rectangle{ // no class in IDL 1long width; long height;long x;long y;

} ;

struct GraphicalObject {2string type; Rectangle enclosing; boolean isFilled;

};

interface Shape { 3long getVersion() ;GraphicalObject getAllState() ; // returns state of the GraphicalObject

};

typedef sequence <Shape, 100> All; // All is a 100 element array 4interface ShapeList { 5

exception FullException{ }; 6Shape newShape(in GraphicalObject g) raises (FullException); 7All allShapes(); // returns sequence of remote object references 8long getVersion() ; // parameters are in, out, or both

}; // parameters may be primitive, struct or array and // are passed by value // parameters whose type is an IDL interface // is passed by remote reference

Page 11: Organizational Communications and Distributed Object Technologies

1195-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

The “idltojava” tool• Run idltojava on the above interface.• The command idlj is found in j2sdk1.4.2\bin.• The Java 2 Platform, Standard Edition,

v1.4, provides an Object Request Broker (ORB) runtime component.

• The JDK documentation states that its Java ORB has not been tested with ORB’s written in other languages.

• JDK 1.4 provides an Orb class with a pluggable architecture.

Page 12: Organizational Communications and Distributed Object Technologies

1295-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

From IDL to Your Language of Choice

The OMG specifies a mapping from IDL to several different programming languages, including Java, C, C++, Lisp, Python, Smalltalk, COBOL, and Ada. When mapped, statements in the OMG IDL are translated to corresponding statements in the programming language of choice. From JDK Documentation

The IDL and the IDL compiler give CORBA its interoperability.

IDL IDL Compiler Proxy

Quiz: How does this compare with Web Services?

Page 13: Organizational Communications and Distributed Object Technologies

1395-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Java Interface ShapeList Generated by idltojava from CORBA Interface

ShapeList

public interface ShapeList extends org.omg.CORBA.Object {Shape newShape(GraphicalObject g) throws ShapeListPackage.FullException;Shape[] allShapes();int getVersion();

}

Page 14: Organizational Communications and Distributed Object Technologies

1495-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

ShapeListServant.java Written by a Java Developer

import org.omg.CORBA.*;class ShapeListServant extends _ShapeListImplBase {

ORB theOrb;private Shape theList[];private int version;private static int n=0;public ShapeListServant(ORB orb){

theOrb = orb; // initialize the other instance variables

}public Shape newShape(GraphicalObject g) throws ShapeListPackage.FullException { 1

version++; Shape s = new ShapeServant( g, version); if(n >=100) throw new ShapeListPackage.FullException(); theList[n++] = s; 2 theOrb.connect(s); return s; }

public Shape[] allShapes(){ ... }public int getVersion() { ... }

}

Note how it talks to the CORBAObject Request Broker.

Page 15: Organizational Communications and Distributed Object Technologies

1595-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

ShapeListServer.javaimport org.omg.CosNaming.*;import org.omg.CosNaming.NamingContextPackage.*;import org.omg.CORBA.*;public class ShapeListServer {

public static void main(String args[]) {try{

ORB orb = ORB.init(args, null); 1

ShapeListServant shapeRef = new ShapeListServant(orb); 2 orb.connect(shapeRef); 3

org.omg.CORBA.Object objRef =

orb.resolve_initial_references("NameService"); 4 NamingContext ncRef = NamingContextHelper.narrow(objRef);

NameComponent nc = new NameComponent("ShapeList", ""); 5NameComponent path[] = {nc}; 6ncRef.rebind(path, shapeRef); 7

java.lang.Object sync = new java.lang.Object();synchronized (sync) { sync.wait();}

} catch (Exception e) { ... }}

}

Note the callon rebind.

Page 16: Organizational Communications and Distributed Object Technologies

1695-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

ShapeListClient.javaimport org.omg.CosNaming.*;import org.omg.CosNaming.NamingContextPackage.*;import org.omg.CORBA.*;public class ShapeListClient{

public static void main(String args[]) {try{

ORB orb = ORB.init(args, null); 1

org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");

NamingContext ncRef = NamingContextHelper.narrow(objRef);NameComponent nc = new NameComponent("ShapeList", "");NameComponent path [] = { nc };ShapeList shapeListRef =

ShapeListHelper.narrow(ncRef.resolve(path));2

Shape[] sList = shapeListRef.allShapes();3

GraphicalObject g = sList[0].getAllState();4

} catch(org.omg.CORBA.SystemException e) {...} }

Note the use of Javainterfaces and classes that were generated by idltojava.

These are not dynamic calls. The compiler sees the interfaces and classes.

Page 17: Organizational Communications and Distributed Object Technologies

1795-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

CORBA Architecture (1)

client server

proxy

or dynamic invocation

implementation repository object

adapter

ORBORB

skeleton

or dynamic skeleton

client program

interface repository

Request

Replycorecore for A

Servant A

CORBA allows for static and dynamic invocation. Applications may invoke operations on target objects with or without having compile-time knowledge of the remote object interface. (The client is a lot easier to read when it makes static calls.)

Page 18: Organizational Communications and Distributed Object Technologies

1895-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

CORBA Architecture (2)

client server

proxy

or dynamic invocation

implementation repository object

adapter

ORBORB

skeleton

or dynamic skeleton

client program

interface repository

Request

Replycorecore for A

Servant A

The Implementation Repository contains information that allows the ORB to locate and activate implementations of objects. The implementation repository : 1. Maintain a registry of known servers. 2. Record which server is currently running, and which port and host it uses. 3. Starts servers on demand if they are registered with the Implementation Repository. From [http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/TAO/ docs/implrepo/paper.html]

Page 19: Organizational Communications and Distributed Object Technologies

1995-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

CORBA Architecture (3)

client server

proxy

or dynamic invocation

implementation repository object

adapter

ORBORB

skeleton

or dynamic skeleton

client program

interface repository

Request

Replycorecore for A

Servant A

Dynamic CORBA applications require a means of obtaining type information at run time. This is the function of the Interface Repository.

Page 20: Organizational Communications and Distributed Object Technologies

2095-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Naming Graph in CORBA Naming Service

initial naming context

ShapeList

CD E

B

initial naming context

P

R S T

V

Q U

initial naming context

XX

CORBA provides a registry service and a directory service.

Quiz: How does a registry differ from a directory?

Quiz: How is this different from the rmiregistry?

Page 21: Organizational Communications and Distributed Object Technologies

2195-702 OCT

Master of Information System Management

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

My SummaryCORBA Binary

fastInteroperable

Complex OOP

Java RMI Binaryfast

Java only Complex OOP

.NET Remoting

Binaryfast

.Net Languages

Complex OOP

Web Services

Text w/binary encodedslow

Interoperable

Not OOP Simple & Simple wins