Top Banner
CORBA CORBA Missam Momin Missam Momin Auburn University Auburn University
23

CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Dec 22, 2015

Download

Documents

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: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

CORBACORBA

Missam MominMissam Momin

Auburn UniversityAuburn University

Page 2: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

What is Corba ?What is Corba ? Corba is an acronym for common object broker Corba is an acronym for common object broker

architecture.architecture. This architecture is meant to provide flexible This architecture is meant to provide flexible

and interoperable objects .and interoperable objects . structured to allow integration of a wide variety structured to allow integration of a wide variety

of object systems.of object systems. Corba was designed to allow intelligent Corba was designed to allow intelligent

components to discover each other and components to discover each other and interoperate on an object bus.interoperate on an object bus.

Page 3: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

OMG OBJECT MANAGEMENT GROUP A OMG OBJECT MANAGEMENT GROUP A CONSORTIUM OF 800 COMPANIES FOUNDED IN CONSORTIUM OF 800 COMPANIES FOUNDED IN APRIL1989 PREVIOUSLY 11 COMPANIES WERE APRIL1989 PREVIOUSLY 11 COMPANIES WERE MEMBER OF THE CONSORTIUM 3COM MEMBER OF THE CONSORTIUM 3COM CORPORATION, AMERICAN AIRLINES CANON INC, CORPORATION, AMERICAN AIRLINES CANON INC, DATA GENERAL, H.P., PHILIPS DATA GENERAL, H.P., PHILIPS TELECOMMUNICATIONS N.V. , SUN UNISYSTEMS TELECOMMUNICATIONS N.V. , SUN UNISYSTEMS

Page 4: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

WHAT CORBA DOES ?WHAT CORBA DOES ?

CORBA ALLOWS INTELLIGENT COMPONENTS TO CORBA ALLOWS INTELLIGENT COMPONENTS TO DISCOVER EACH OTHER AND INTEROPERATE ON AN DISCOVER EACH OTHER AND INTEROPERATE ON AN OBJECT BUS .OBJECT BUS .

SPECIFIC BUS RELATED SERVICES FOR CREATING AND SPECIFIC BUS RELATED SERVICES FOR CREATING AND DELETING OBJECTS ACCESS BY NAME AND PERSISTENT DELETING OBJECTS ACCESS BY NAME AND PERSISTENT STORAGE EXTERNALIZING STATES AND DEFINES STORAGE EXTERNALIZING STATES AND DEFINES RELATIONSHIPS BETWEEN DIFFERENT OBJECTS EITHER RELATIONSHIPS BETWEEN DIFFERENT OBJECTS EITHER LOCALLY OR REMOTELY.LOCALLY OR REMOTELY.

CORBA CREATES INTERFACE SPECIFICATIONS AND NOT CORBA CREATES INTERFACE SPECIFICATIONS AND NOT CODE INTERFACES DEFINED ARE DERIEVED FROM CODE INTERFACES DEFINED ARE DERIEVED FROM DEMONSTRATED TECHNOLOGIES SUBMITTED BY DEMONSTRATED TECHNOLOGIES SUBMITTED BY MEMBER COMPANIES.MEMBER COMPANIES.

Page 5: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

WHAT IS A DISTRIBUTED CORBA OBJECT ?WHAT IS A DISTRIBUTED CORBA OBJECT ?

CORBA OBJECTS ARE BLOBS OF INTELLIGENCE THAT CN LIVE CORBA OBJECTS ARE BLOBS OF INTELLIGENCE THAT CN LIVE ANYWHERE ON A NETWORK ANYWHERE ON A NETWORK

OBJECTS ARE PACKED AS BINARY COMPONENTS THAT REMOTE OBJECTS ARE PACKED AS BINARY COMPONENTS THAT REMOTE CLIENTS CAN ACCESS THRU METHOD INVOCATION LANGUAGE AND CLIENTS CAN ACCESS THRU METHOD INVOCATION LANGUAGE AND COMPILER USED TO CREATE SERVER OBJECTS ARE TRANSPARENT COMPILER USED TO CREATE SERVER OBJECTS ARE TRANSPARENT TO CLIENT.TO CLIENT.

ALSO THE ISSUE OF IMPLEMENTATION OF THE SERVER OBJECT IS ALSO THE ISSUE OF IMPLEMENTATION OF THE SERVER OBJECT IS TRANSERANTTRANSERANT

CLIENT JUST HAS TO KNOW THE INTERFACE THE SERVER OBJECT CLIENT JUST HAS TO KNOW THE INTERFACE THE SERVER OBJECT PUBLISHESPUBLISHES

INTERFACE SERVES AS A CONTRACT BETWEEN THE CLIENT AND INTERFACE SERVES AS A CONTRACT BETWEEN THE CLIENT AND THE SERVERTHE SERVER

THIS CONTRACT IS TERMED AS IDL TO SPECIFY A COMPONENT’S THIS CONTRACT IS TERMED AS IDL TO SPECIFY A COMPONENT’S BOUNDARIES AND ITS CONTRACTUAL INTERFACES WITH THE BOUNDARIES AND ITS CONTRACTUAL INTERFACES WITH THE POTENTIAL CLIENTS.POTENTIAL CLIENTS.

Page 6: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Client stubs Server skeletons

CORBA IIOP ORB

Smalltalk Cobol C++c javaada

c C++ ada Smalltalk JavaCobol

id id idididlidl

Page 7: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

OMG’S CORBA ARCHITECTUREOMG’S CORBA ARCHITECTURE

ORB: OBJECT REQUEST BROKER : This object bus provides mechanisms required to find the ORB: OBJECT REQUEST BROKER : This object bus provides mechanisms required to find the object implementation for the request made by the client prepare the implementation and object implementation for the request made by the client prepare the implementation and communicate the data to client who has made the request the this is done with the help of communicate the data to client who has made the request the this is done with the help of interfaces.interfaces.

Client idl stubs : provides static interface to object services these are precompiled stubs to Client idl stubs : provides static interface to object services these are precompiled stubs to define how clients invoke corresponding services on servers acts as a local call and is a local define how clients invoke corresponding services on servers acts as a local call and is a local proxy object for the remote server object.proxy object for the remote server object.

DII :discovers methods to be invoked at run times corba defines API for looking in to the DII :discovers methods to be invoked at run times corba defines API for looking in to the metadata that defines the server’s interface parameter generation and issues remote calls metadata that defines the server’s interface parameter generation and issues remote calls and gets the resultsand gets the results

Interface repository: run time distributed data base containing machine readable versions of Interface repository: run time distributed data base containing machine readable versions of the id defined interfacesthe id defined interfaces

ORB Interface :API's to conver a object reference to a string and vice versa useful for storage ORB Interface :API's to conver a object reference to a string and vice versa useful for storage and communication.and communication.

SERVER IDL STUBS OR SKELETON: Provice static interfaces to each service exported by the SERVER IDL STUBS OR SKELETON: Provice static interfaces to each service exported by the server server

DSI :Provides run time mechanism for server that need to handle incoming method calls for DSI :Provides run time mechanism for server that need to handle incoming method calls for components that don’t have id based compiled skeletonscomponents that don’t have id based compiled skeletons

Object Adapter accepts requests for service passes request for server objects assign object Object Adapter accepts requests for service passes request for server objects assign object id’sid’s

implementation repository run time repository of information about class a server supportsimplementation repository run time repository of information about class a server supports

Page 8: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Applicationobjects

Common object services

ORB

Common facilities (corba facilities)

Page 9: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Facilities of corba Facilities of corba architecturearchitecture

Corba facilitiesCorba facilities vertical facilitiesvertical facilities horizontal facilitieshorizontal facilities examples:examples: distributed docdistributed doc information managementinformation management systems managementsystems management task managementtask management

Corba servicesCorba services namingnaming persistencepersistence lifecyclelifecycle properties properties concurrencyconcurrency collectioncollection securitysecurity tradertrader licensinglicensing startupstartup timetime relationshipsrelationships queryquery transactionstransactions eventsevents externalizationexternalization

Page 10: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Life cycle service create copy move and delete objectsLife cycle service create copy move and delete objects persistence storage issue ODBMS and RDBMS SERVERSpersistence storage issue ODBMS and RDBMS SERVERS naming service discover components on object bus by namenaming service discover components on object bus by name event service register and unregistered events events channel works as a broker to event service register and unregistered events events channel works as a broker to

collect a and distribute events amongst components even if they don’t know each collect a and distribute events amongst components even if they don’t know each otherother

concurrency: provides lock managerconcurrency: provides lock manager transaction 2 phase commit coordination amongst persistent objectstransaction 2 phase commit coordination amongst persistent objects relationship: dynamic associations among components that are unknown to each otherrelationship: dynamic associations among components that are unknown to each other query service :query for objectsquery service :query for objects licensing service meter for the use of componentslicensing service meter for the use of components properties association with the component state like title date ,etcproperties association with the component state like title date ,etc time service: important issue in distributed computing environment synchronizationtime service: important issue in distributed computing environment synchronization security framework for authentication access control lists etcsecurity framework for authentication access control lists etc trader service yellow pages for objectstrader service yellow pages for objects collection service generically create and manipulate common collectionscollection service generically create and manipulate common collections externalization : data in to and out of component using stream like mechanismexternalization : data in to and out of component using stream like mechanism

Page 11: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Java meets corbaJava meets corba

Corba/java ORB; CORBA IIOP WRITTEN ENTIRELY Corba/java ORB; CORBA IIOP WRITTEN ENTIRELY IN JAVAIN JAVA

E.G. JAVA APPLET ON THE BROWSER INVOKES E.G. JAVA APPLET ON THE BROWSER INVOKES METHODS DIRECTLY ON CROBA OIBJECT USIGN METHODS DIRECTLY ON CROBA OIBJECT USIGN IIOP PROTOCOLIIOP PROTOCOL

ADVANTAGES :IT BY PASSES HTTP AND CGI SO ADVANTAGES :IT BY PASSES HTTP AND CGI SO THE STATELESSNESS OF THE THE CGI PARADIGM THE STATELESSNESS OF THE THE CGI PARADIGM IS NOT THERE AND OBJECT STATE AND NAME IS NOT THERE AND OBJECT STATE AND NAME ARE MAINTAINED .ARE MAINTAINED .

Page 12: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

CORBA JAVA STANDARDSCORBA JAVA STANDARDS

IDL TO JAVA MAPS CORBA IDL TO JAVAIDL TO JAVA MAPS CORBA IDL TO JAVA

JAVA TO IDL: CORBA/RMI CONVERGENCE STANDARD JAVA TO IDL: CORBA/RMI CONVERGENCE STANDARD SPECIFIES REMOTE INTERFACES USING RMI SPECIFIES REMOTE INTERFACES USING RMI SEMANTICS OF CORBA IDLSEMANTICS OF CORBA IDL

ENTERPRISE JAVA BEANS CORBA MAPPING SPECS ENTERPRISE JAVA BEANS CORBA MAPPING SPECS BASED ON RMI/IDL SUBSET AND CORBA BASED ON RMI/IDL SUBSET AND CORBA TRANSACTIONS ALSO MAPS JNDI TO CORBA NAMING TRANSACTIONS ALSO MAPS JNDI TO CORBA NAMING SERVICESERVICE

Page 13: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

STEPS TO CREATE SERVER STEPS TO CREATE SERVER CLASSESCLASSES

3

2

8

9

4

5

1

6

7

LOAD

Page 14: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

STEPS 1: CREATE IDL DEFINATIONS OBJECTS TELL THE STEPS 1: CREATE IDL DEFINATIONS OBJECTS TELL THE POTENTIAL CLIENTS OPERATIONS AND METHODS AND POTENTIAL CLIENTS OPERATIONS AND METHODS AND INVOCATIONS MEANS SO TYPES ATTRIBUTES PARAMETERS INVOCATIONS MEANS SO TYPES ATTRIBUTES PARAMETERS ETC ARE DEF INEDETC ARE DEF INEDEXAMPLE: MODULE CounterEXAMPLE: MODULE Counter

{ interface Count{ interface Count{ attribute long sum;{ attribute long sum;long increment() ;long increment() ;};};};}; this file is named as count.idl contains idl for the this file is named as count.idl contains idl for the interface Countinterface Count

need idl2java compiler for understanding between java need idl2java compiler for understanding between java clients and serversclients and serversstep 2 load it into the interface repository for run times step 2 load it into the interface repository for run times access access

Page 15: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Step3:Step3: pre compile the idl using the pre compile the idl using the idl2java compileridl2java compileridl2java count.old -options idl2java count.old -options note options are for inheritance based note options are for inheritance based and delegation based and delegation based pre compiler has created 5 different pre compiler has created 5 different classes and one interface classes and one interface

Page 16: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

1) Counter._CountImplBase : this implements server side 1) Counter._CountImplBase : this implements server side skeleton for Count skeleton for Count 2) Counter._St_Count :client side stub implementation2) Counter._St_Count :client side stub implementation3) Counter.CountHELPER cast Corba objects to Count type 3) Counter.CountHELPER cast Corba objects to Count type

4) Counter.CountHolder holder for public instance 4) Counter.CountHolder holder for public instance member of the typemember of the typeCountCount5)Counter.Count : interface mapping depending on the 5)Counter.Count : interface mapping depending on the languagelanguage

6)Counter._example_Count: example class for Count 6)Counter._example_Count: example class for Count object implementationobject implementation

Page 17: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Counter.CountCounter.Count

package Counter;package Counter;

public interface Count extends public interface Count extends org.omg.CORBA.Objectorg.omg.CORBA.Object

{{

public int sum();public int sum();

public void sum (int x);public void sum (int x);

public int increment();public int increment();

}}

Page 18: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

Counter._example_CountCounter._example_CountPackage Counter;Package Counter;

public class_example_Count extends public class_example_Count extends Counter._CountImplBaseCounter._CountImplBase

{{

public _example_Count (java.lang.String name) {public _example_Count (java.lang.String name) {

super (name);super (name);

}}

public _example_Count() {public _example_Count() {

super();super();

}}

public int increment()public int increment()

{{}}

public void sum(int sum){public void sum(int sum){

}}

public int sum() {public int sum() {

}}

}}

Page 19: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

// count impl.java this is the Count implementation// count impl.java this is the Count implementation

class CountImpl extends Counter._CountImplBaseclass CountImpl extends Counter._CountImplBase{{private int sum;private int sum;//constructor//constructorCountImpl(String name)CountImpl(String name){ super (name);{ super (name);System.out.println(“Count Object Created”);System.out.println(“Count Object Created”);sum =0;sum =0;}}//accessor method for attribute//accessor method for attributepublic int sum()public int sum(){ return sum;{ return sum;}}

public void sum(int x)public void sum(int x){{sum =x;sum =x;}}public int increment()public int increment(){{sum++sum++return sum;return sum;}}}}

Page 20: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

//Count server provides main function on the server//Count server provides main function on the serverclass CountServerclass CountServer{static public void main(String [] args){static public void main(String [] args){{trytry{{org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, null org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, null ););

org.omg.CORBA.BOA boa = orb.BOA_init ();org.omg.CORBA.BOA boa = orb.BOA_init ();CountImpl count = new CountImpl (“my count” );CountImpl count = new CountImpl (“my count” );boa.obj_is_ready() (count); //export to the orb the new object boa.obj_is_ready() (count); //export to the orb the new object countcount

boa.Impl_is_ready();boa.Impl_is_ready();}}catch (org.omg.CORBA.SystemException e)catch (org.omg.CORBA.SystemException e){ System.err.println(e);{ System.err.println(e);}} } }

} }

Page 21: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

COUNTSERVER

ORB BOA

ORB.init

BOA_init

Obj_is_ready

Impl_is_ready

New CountImpl

Page 22: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

//Count client//Count clientclass CountClientclass CountClient{{public static void main (String [] args)public static void main (String [] args){ try{ try{ System.out.println (“initializing the ORB”);{ System.out.println (“initializing the ORB”);org.omg.CORBA.ORB orb = org.omg.CORBA.init (args, null org.omg.CORBA.ORB orb = org.omg.CORBA.init (args, null ););// bind to the count object// bind to the count objectSystem.out.println (“ Binding to Count Object” );System.out.println (“ Binding to Count Object” );Counter.Count counter = Counter.CountHelper.bind (orb, Counter.Count counter = Counter.CountHelper.bind (orb, “My Count”);“My Count”);System.out.println (“setting sum to 0”);System.out.println (“setting sum to 0”);count .sum((int) 0);count .sum((int) 0);long startTime = System.currentTimeMillis();long startTime = System.currentTimeMillis();

Page 23: CORBA Missam Momin Auburn University. What is Corba ? b Corba is an acronym for common object broker architecture. b This architecture is meant to provide.

System.out.println (“incrementing”);System.out.println (“incrementing”);for (int i=0; i< 1000; I++)for (int i=0; i< 1000; I++){counter.increment();{counter.increment();}}long stopTime = System.currentTimeMills();long stopTime = System.currentTimeMills();System.out.println (“ Avg Ping =“ + ((stopTime - System.out.println (“ Avg Ping =“ + ((stopTime - startTime) / 1000f ) + “msecs”);startTime) / 1000f ) + “msecs”);System.out.println (“Sum = “ + counter.sum());System.out.println (“Sum = “ + counter.sum());}}catch (org.omg.CORBA.SystemException e)catch (org.omg.CORBA.SystemException e){{System.err.println (“SystemException “);System.err.println (“SystemException “);System.err.println (e);System.err.println (e);}}}}}}