Upload
daniel-farmer
View
219
Download
5
Embed Size (px)
Citation preview
CSE812 Monday (Feb. 14, 2003) and Wednesday (Feb. 16, 2003)
Introduction to Introduction to CORBACORBA
SeyedMasoud Sadjadi
Software Engineering and Networking Systems Laboratory
Department of Computer Science and Engineering
Michigan State University
www.cse.msu.edu/sens
CSE 812 04/14-16/2003 2Introduction to CORBA by SeyedMasoud Sadjadi
AcknowledgementsAcknowledgements
Object Management Group (OMG) IONA Technology Eternal Systems Steve Vinoski, IONA Technology Niall Stapley, CERN Mojtaba Hosseini
CSE 812 04/14-16/2003 3Introduction to CORBA by SeyedMasoud Sadjadi
AgendaAgenda
Motivation
Introduction
Interoperability
Example
CORBA Evolution
Advance Features
Interoperability
Introduction
Motivation
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
Big Picture
CSE 812 04/14-16/2003 4Introduction to CORBA by SeyedMasoud Sadjadi
Motivation (1)Motivation (1)
Object-oriented computational model– An application is represented by
interactions among a web of objects
Service provided through interface
Service is accessed through a referenceThread Main Loop
Interoperability
Introduction
Motivation
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 5Introduction to CORBA by SeyedMasoud Sadjadi
Motivation (2)Motivation (2)
Distributed object computational model– Objects are distributed across network.– Tedious and error-prone programming.
So
cket
So
cket
Network
Application Layer
Operating SystemLayer
File
File
Sh
ared
S
har
ed
Mem
ory
Mem
ory
Pip
elin
eP
ipel
ine
So
cket
So
cket
File
File
Sh
ared
S
har
ed
Mem
ory
Mem
ory
Pip
elin
eP
ipel
ine
Interoperability
Introduction
Motivation
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 6Introduction to CORBA by SeyedMasoud Sadjadi
Motivation (3)Motivation (3)MiddlewareMiddleware
SolutionSolution
So
cket
So
cket
StubSkeleton
Network
MiddlewareLayer
Operating SystemLayer
File
File
Sh
ared
S
har
ed
Mem
ory
Mem
ory
Pip
elin
eP
ipel
ine
So
cket
So
cket
File
File
Sh
ared
S
har
ed
Mem
ory
Mem
ory
Pip
elin
eP
ipel
ine
Application Layer
ORB ORB
Interoperability
Introduction
Motivation
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 7Introduction to CORBA by SeyedMasoud Sadjadi
AgendaAgenda
Introduction
Motivation
Interoperability
Example
CORBA Evolution
Advance Features
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
Big Picture
CSE 812 04/14-16/2003 8Introduction to CORBA by SeyedMasoud Sadjadi
What is CORBA?What is CORBA?
Common Object Request Broker Architecture
An industry standard developed by OMG to help in distributed programming
A specification for creating and using distributed objects
A tool for enabling multi-language, multi-platform communication
A CORBA based-system is a collection of objects that isolates the requestors of services (clients) from the providers of services (servers) by an encapsulating interface
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
CORBA
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
DII & DSI & IR
OA
Big Picture
CSE 812 04/14-16/2003 9Introduction to CORBA by SeyedMasoud Sadjadi
Who should use CORBA?Who should use CORBA?
“The architecture and specifications described in the Common Object Request Broker Architecture and Specifications book are aimed at software designers and developers who want to produce applications that comply with OMG standards for the Object Request Broker (ORB)” [OMG].
“The benefit of compliance is, in general, to be able to produce interoperable applications that are based on distributed, interoperating objects” [OMG].
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
CORBA
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
DII & DSI & IR
OA
Big Picture
CSE 812 04/14-16/2003 10Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Features (1)CORBA Features (1)
Heterogeneity– Hardware devices– Operating System– Network protocols– Programming languages
Object Orientation– Encapsulation– Polymorphism– Inheritance– Instantiation
Dynamic binding and typing
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 11Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Features (2)CORBA Features (2)
Transparencies– Location transparency
the physical address of a server is masked
– Access transparency the access method is masked
– Data transparency the different data representations are masked
– Replication transparency the server replicas are masked
– Migration transparency the migration of a server is masked
– Activation transparency the activation of a server is masked
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 12Introduction to CORBA by SeyedMasoud Sadjadi
CORBA ObjectsCORBA Objects
They are different from typical programming objects in three ways:
CORBA objects can run on any platform
CORBA objects can be located anywhere on the network
CORBA objects can be written in any language that has IDL mapping
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Objects
Features
Architecture
ORB
IDL
Stub & Skeleton
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 13Introduction to CORBA by SeyedMasoud Sadjadi
CORBA ArchitectureCORBA Architecture
CORBA is composed of ORB core, ORB interface, stub, skeleton, DII, DSI, and OA.
ClientClient Object ImplementationObject Implementation
DynamicDynamicInvocationInvocation
StaticStaticIDLIDLStubStub
ORBORBInterfaceInterface
Static IDL Static IDL SkeletonSkeleton
Dynamic Dynamic SkeletonSkeleton ObjectObject
AdapterAdapter
ORB CoreORB Core
Interface Identical for all ORB implementations Interface Identical for all ORB implementations
There may be multiple object adaptersThere may be multiple object adapters
There are stubs and a skeleton for each object typeThere are stubs and a skeleton for each object type
ORB-dependent interfaceORB-dependent interface
Up-call interfaceUp-call interface
Normal call interfaceNormal call interface
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Architecture
Features
Objects
CORBA
ORB
IDL
Stub & Skeleton
DII & DSI & IR
OA
Big Picture
CSE 812 04/14-16/2003 14Introduction to CORBA by SeyedMasoud Sadjadi
Object Request Broker (1)Object Request Broker (1)
Responsibilities Object location transparency
– Find the object implementation for the request
Object activation– Prepare the object implementation to
receive the request Communication
– Communicate the data making up the request
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
ORB
Features
Objects
Architecture
CORBA
IDL
Stub & Skeleton
DII & DSI & IR
OA
Big Picture
CSE 812 04/14-16/2003 15Introduction to CORBA by SeyedMasoud Sadjadi
Object Request Broker (2)Object Request Broker (2)
Both the client and the object implementation are isolated from the ORB by an IDL interface.
All requests are managed by the ORB, which means that invocation of a CORBA object is passed to an ORB
CORBA objects implemented in different ORBs from different vendors should be able to communicate with each other because all CORBA compliant ORBs are able to interoperate via IIOP (Internet Inter-ORB Protocol)
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
ORB
Features
Objects
Architecture
CORBA
IDL
Stub & Skeleton
DII & DSI & IR
OA
Big Picture
CSE 812 04/14-16/2003 16Introduction to CORBA by SeyedMasoud Sadjadi
Interface Definition Language Interface Definition Language (1)(1)
Separates the Interface from the Implementation
Multiple-inheritance, strongly typed, public interface specification language
Independent of any particular language and compiler
Mappings will be provided for many languages and compilers
Not a programming language Enables Interoperability Supports the dynamic request
mechanism
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
IDL
Features
Objects
Architecture
ORB
Stub & Skeleton
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 17Introduction to CORBA by SeyedMasoud Sadjadi
Interface Definition Language Interface Definition Language (2)(2)
The role of IDLThe role of IDL
I D L
I D L
I D L
I D L
I D L
I D L
ORB
C
C++
COBOL
Ada
Java
More
Client Side Server Side
COBOL
C
Ada
C++
Smalltalk
More
I D L
I D L
I D L
I D L
I D L
I D L
ORB
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
IDL
Features
Objects
Architecture
ORB
Stub & Skeleton
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 18Introduction to CORBA by SeyedMasoud Sadjadi
Interface Definition Language Interface Definition Language (3)(3)
IDL File
Client StubFile
ServerSkeleton File
ClientImplementation
ObjectImplementation
IDL Compiler
Lang A Compiler Lang B Compiler
ClientProgram
ServerProgram
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
IDL
Features
Objects
Architecture
ORB
Stub & Skeleton
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 19Introduction to CORBA by SeyedMasoud Sadjadi
Interface Definition Language Interface Definition Language (4)(4)
IDL Compiler It will accept as input an IDL file written
using any text editor (fileName.idl) It generates the stub and the skeleton
code in the target programming language (e.g., Java stub and C++ skeleton)
The stub is given to the client as a tool to describe the server functionality and the skeleton file is implemented at the server
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
IDL
Features
Objects
Architecture
ORB
Stub & Skeleton
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 20Introduction to CORBA by SeyedMasoud Sadjadi
Stubs and SkeletonsStubs and Skeletons
In terms of CORBA development, the stubs and skeleton files are standard in terms of their target language.
Each file exposes the same operations specified in the IDL file.
Invoking an operation on the stub file will cause the method to be executed in the skeleton file
The stub file allows the client to manipulate the remote object with the same ease with each a local file is manipulated
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Stub & Skeleton
Features
Objects
Architecture
ORB
IDL
DII & DSI & IR
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 21Introduction to CORBA by SeyedMasoud Sadjadi
Dynamic Invocation InterfaceDynamic Invocation Interface
Operations can be invoked through static or dynamic operations
Static invocation interfaces are determined at compile time being presented to the client using the stubs
The DII allows clients to use server objects without knowing about them at compile time
It allows the client to obtain an instance of a CORBA object and make invocations to it by dynamically constructing requests using the Interface Repository to retrieve an operation signature
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
OA
CORBA
DII & DSI & IR
Big Picture
CSE 812 04/14-16/2003 22Introduction to CORBA by SeyedMasoud Sadjadi
Dynamic Skeleton InterfaceDynamic Skeleton Interface
Similar to DII, the server-side dynamic skeleton interface allows servers to be written without having skeletons, for the objects being implemented.
It allows dynamic handling of object invocations
It can use either the pure static knowledge of parameters or the Interface Repository to determine the parameters
Has other applications such as interactive software
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
OA
CORBA
DII & DSI & IR
Big Picture
CSE 812 04/14-16/2003 23Introduction to CORBA by SeyedMasoud Sadjadi
Interface RepositoryInterface Repository
Provides another way to specify the interfaces to the objects.
Holds a table of interfaces A client, using the IR, should be able to
locate an object , find information about its interface, then make a request to be sent through the ORB
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
DII & DSI & IR
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
OA
CORBA
Big Picture
CSE 812 04/14-16/2003 24Introduction to CORBA by SeyedMasoud Sadjadi
Object AdaptorsObject Adaptors
The primary way that an object implementation accesses services provided by ORB
Method invocation Security Object reference generation Object activation and deactivation
Interoperability
Motivation
Introduction
Example
Evolution
OvervieOverview:w:
Advanced
OA
Features
Objects
Architecture
ORB
IDL
Stub & Skeleton
DII & DSI & IR
CORBA
Big Picture
CSE 812 04/14-16/2003 25Introduction to CORBA by SeyedMasoud Sadjadi
AgendaAgenda
Interoperability
Motivation
Introduction
Example
CORBA Evolution
Advance Features
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
Big Picture
CSE 812 04/14-16/2003 26Introduction to CORBA by SeyedMasoud Sadjadi
Interoperability (1)Interoperability (1)
ORB from different vendors are interoperable
Obj. Impl.Obj. Impl.
IDL
ClientClient
IDL
ORB
Obj. Impl.Obj. Impl.
IDL
ClientClient
IDL
ORB
ORB
Obj. Impl.Obj. Impl.
IDL
ORB
ClientClient
IDL
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
Interoperability
IOR & IOGR
CORBA Clients
Java and CORBA
CORBA vs. RMI
CORBA vs. DCOM
CSE 812 04/14-16/2003 27Introduction to CORBA by SeyedMasoud Sadjadi
Interoperability (2)Interoperability (2)
CORBA 2.0 Interoperability Comprises An overall architecture for CORBA-CORBA
communications An API for adding bridges A general multi-transport message format
(General Inter-ORB Protocol or GIOP) An API for gateways using ESIOPs
(Environment-Specific Inter-ORB Protocols)
UNIVERSAL, OUT-OF-THE-BOX INTEROPERABILITY
GIOP over TCP/IP is mandatory for compliance either internally or via a half-bridge
Specialized protocols are optional and well supported by the specifications.
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
Interoperability
IOR & IOGR
CORBA Clients
Java and CORBA
CORBA vs. RMI
CORBA vs. DCOM
CSE 812 04/14-16/2003 28Introduction to CORBA by SeyedMasoud Sadjadi
IOR ExampleIOR Example
IOR:000000000000001049444c3a5472697669616c3a312e300000000001000000000000007c000102000000000d3135322e38312e342e3131300000048000000025abacab3131303033383632313336005f526f6f74504f410000cafebabe3bd5b8780000000000000000000001000000010000002c0000000000010001000000040001002000010109000101000501000100010109000000020001010005010001
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
IOR & IOGR
Interoperability
CORBA Clients
Java and CORBA
CORBA vs. RMI
CORBA vs. DCOM
CSE 812 04/14-16/2003 29Introduction to CORBA by SeyedMasoud Sadjadi
Interoperable Object Group RefInteroperable Object Group Ref
…Type_idNumber
of Profiles IIOP Profile IIOP ProfileMultiple
Components Profile
tag_group_ version
ft_domain_id
object_group_id
object_group_version
TAG_INTERNET_IOP
ProfileBody
IIOP Version Host Port
Object Key Components
Number ofComponents
TAG_GROUPComponent
TAG_PRIMARYComponent
OtherComponents
corbaloc::1.2@hostA:683,:1.2@hostB:683/myObjIntroduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
IOR & IOGR
Interoperability
CORBA Clients
Java and CORBA
CORBA vs. RMI
CORBA vs. DCOM
CSE 812 04/14-16/2003 30Introduction to CORBA by SeyedMasoud Sadjadi
Clients for CORBAClients for CORBA
CORBA Client – CORBA Server Java Client – CORBA, Java RMI, and HTTP
Server DCOM Client – CORBA and DCOM Server
standaloneCORBAclient
Windows app
COM/CORBA link
ORBORB
CORBAserver
HTTP
JAVA/RMIserver
HTTPserver
JAVA/CORBAclient
JAVA VM (browser)
JAVA ORBlet
DCOMserver
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
CORBA Clients
Interoperability
IOR & IOGR
Java and CORBA
CORBA vs. RMI
CORBA vs. DCOM
CSE 812 04/14-16/2003 31Introduction to CORBA by SeyedMasoud Sadjadi
Java and CORBAJava and CORBA
Not just the usual IDL-to-Java Mapping A Java-to-IDL Mapping. Automates creation of CORBA Objects
from Java Classes Java RMI can use IIOP Protocol There’s an ORB in the JDK
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
Java and CORBA
Interoperability
CORBA Clients
IOR & IOGR
CORBA vs. RMI
CORBA vs. DCOM
CSE 812 04/14-16/2003 32Introduction to CORBA by SeyedMasoud Sadjadi
CORBA vs. Java RMICORBA vs. Java RMI
CORBA was designed for language independence whereas RMI was designed for a single language where objects run in a homogeneous environment
CORBA interfaces are defined in IDL, while RMI interfaces are defined in Java
CORBA objects are not garbage collected because they are language independent and they have to be consistent with languages that do not support garbage collection, on the other hand RMI objects are garbage collected automatically
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
CORBA vs. RMI
Interoperability
CORBA Clients
Java and CORBA
IOR & IOGR
CORBA vs. DCOM
CSE 812 04/14-16/2003 33Introduction to CORBA by SeyedMasoud Sadjadi
DCOM vs. CORBADCOM vs. CORBA
Introduction
Motivation
Interoperability
Example
Evolution
OvervieOverview:w:
Advanced
Big Picture
CORBA vs. DCOM
Interoperability
CORBA Clients
Java and CORBA
CORBA vs. RMI
IOR & IOGR
CSE 812 04/14-16/2003 34Introduction to CORBA by SeyedMasoud Sadjadi
AgendaAgenda
Example
Motivation
Introduction
Interoperability
CORBA Evolution
Advance Features
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Big Picture
CSE 812 04/14-16/2003 35Introduction to CORBA by SeyedMasoud Sadjadi
Steps to Implement “Hello Steps to Implement “Hello World”World”
We use a CROBA implementation such as ORBacus, ORBIX, VisiBroker, JacORB, and TAO
1. Define an interface using IDL
2. Use the IDL compiler
3. Implement the Hello object
4. Implement the server
5. Implement the client
6. Compile
7. Run
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Steps
Write Interface
Implement Hello
Implement Server
Implement Client
Compile and Run
CSE 812 04/14-16/2003 36Introduction to CORBA by SeyedMasoud Sadjadi
Define Interface in IDLDefine Interface in IDL
public class Greeter{ public static void main(String args[]) { System.out.println("Hello World!"); }}
// IDLinterface Hello{ void say_hello();};
Stand-alone hello world application
1. Define an interface using IDL
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Write Interface
Steps
Implement Hello
Implement Server
Implement Client
Compile and Run
CSE 812 04/14-16/2003 37Introduction to CORBA by SeyedMasoud Sadjadi
Implement the Hello ObjectImplement the Hello Object
jidl --package hello Hello.idl
2. Use the IDL compiler
// Javapackage hello;
public class Hello_impl extends HelloPOA { public void say_hello() { System.out.println("Hello World!"); }}
3. Implement the Hello object
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Implement Hello
Write Interface
Steps
Implement Server
Implement Client
Compile and Run
CSE 812 04/14-16/2003 38Introduction to CORBA by SeyedMasoud Sadjadi
Implement the Server (1)Implement the Server (1)
4. Implement the Server
// Javapackage hello;
public class Server { public static void main(String args[]) { java.util.Properties props = System.getProperties(); props.put("org.omg.CORBA.ORBClass", "com.ooc.CORBA.ORB"); props.put("org.omg.CORBA.ORBSingletonClass", "com.ooc.CORBA.ORBSingleton");
int status = 0; org.omg.CORBA.ORB orb = null;
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Implement Server
Write Interface
Implement Hello
Steps
Implement Client
Compile and Run
CSE 812 04/14-16/2003 39Introduction to CORBA by SeyedMasoud Sadjadi
Implement the Server (2)Implement the Server (2)
4. Implement the Server (cont.)
try { orb = org.omg.CORBA.ORB.init(args, props); status = run(orb); } catch(Exception ex) { ex.printStackTrace(); status = 1; } if(orb != null) { try { orb.destroy(); } catch(Exception ex) { ex.printStackTrace(); status = 1; } } System.exit(status);}
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Implement Server
Write Interface
Implement Hello
Steps
Implement Client
Compile and Run
CSE 812 04/14-16/2003 40Introduction to CORBA by SeyedMasoud Sadjadi
Implement the Server (3)Implement the Server (3)
4. Implement the Server (cont.)
static int run(org.omg.CORBA.ORB orb) throws org.omg.CORBA.UserException {
org.omg.PortableServer.POA rootPOA = org.omg.PortableServer.POAHelper.narrow( orb.resolve_initial_references("RootPOA"));
org.omg.PortableServer.POAManager manager = rootPOA.the_POAManager();
Hello_impl helloImpl = new Hello_impl(); Hello hello = helloImpl._this(orb);
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Implement Server
Write Interface
Implement Hello
Steps
Implement Client
Compile and Run
CSE 812 04/14-16/2003 41Introduction to CORBA by SeyedMasoud Sadjadi
Implement the Server (3)Implement the Server (3)
4. Implement the Server (cont.)
try { String ref = orb.object_to_string(hello); String refFile = "Hello.ref"; java.io.PrintWriter out = new java.io.PrintWriter( new java.io.FileOutputStream(refFile)); out.println(ref); out.close(); } catch(IOException ex){ ex.printStackTrace(); return 1; }
manager.activate(); orb.run();
return 0; }}
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Implement Server
Write Interface
Implement Hello
Steps
Implement Client
Compile and Run
CSE 812 04/14-16/2003 42Introduction to CORBA by SeyedMasoud Sadjadi
Implement the Client (1)Implement the Client (1)
5. Implement the Client
// Javapackage hello;
public class Client {
public static void main(String args[]) { ... // Same code as the server }
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Implement Client
Write Interface
Implement Hello
Steps
Implement Server
Compile and Run
CSE 812 04/14-16/2003 43Introduction to CORBA by SeyedMasoud Sadjadi
Implement the Client (2)Implement the Client (2)
5. Implement the Client (cont.)
static int run(org.omg.CORBA.ORB orb) { org.omg.CORBA.Object obj = null; try { String refFile = "Hello.ref"; java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader(refFile)); String ref = in.readLine(); obj = orb.string_to_object(ref); } catch(IOException ex) {ex.printStackTrace(); return 1; }
Hello hello = HelloHelper.narrow(obj); hello.say_hello(); return 0; }}
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Implement Client
Write Interface
Implement Hello
Steps
Implement Server
Compile and Run
CSE 812 04/14-16/2003 44Introduction to CORBA by SeyedMasoud Sadjadi
Compile and RunCompile and Run
6. Compile
CLASSPATH=.:your_orbacus_directory/lib/OB.jar:$CLASSPATHexport CLASSPATH
javac hello/*.java
7. Run
java hello.Server
java hello.Client
Introduction
Motivation
Example
Interoperability
Evolution
OvervieOverview:w:
Advanced
Big Picture
Compile and Run
Write Interface
Implement Hello
Steps
Implement Server
Implement Client
CSE 812 04/14-16/2003 45Introduction to CORBA by SeyedMasoud Sadjadi
AgendaAgenda
CORBA Evolution
Motivation
Introduction
Example
Interoperability
Advance Features
Introduction
Motivation
Evolution
Example
Interoperability
OvervieOverview:w:
Advanced
Big Picture
Big Picture
CSE 812 04/14-16/2003 46Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Evolution (1)CORBA Evolution (1)
CORBA 3.0
Facilities
Interoperability
CORBA Core
1991
1996
1998
1999
IDL, ObjectModel, ORB
InteroperabilityNetworking
Horizontal,VerticalFacilities
CCMReal-time
Fault Tolerance
Introduction
Motivation
Evolution
Example
Interoperability
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 47Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Evolution (2)CORBA Evolution (2)
CORBA 1.0 (October 1991)– CORBA Object model – Interface Definition Language (IDL)– Core DII and Interface Repository – single language mapping for the C
CORBA 1.1 (February 1992)– The first widely published version– Interfaces for the Basic Object Adapter – Clarified some ambiguities
CORBA 1.2 (December 1993)– Closed several ambiguities in memory
management and object reference comparison.
Introduction
Motivation
Evolution
Example
Interoperability
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 48Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Evolution (3)CORBA Evolution (3)
CORBA 2.0 (August 1996)– Dynamic skeleton interface – Extensions to the Interface Repository – Interoperability (GIOP, IIOP, DCE CIOP) – Layered security and transaction services – Datatype extensions for COBOL– Interworking with OLE2/COM – Interoperability protocol specification– Interface repository improvements– C++ and Smalltalk IDL language mappings
CORBA 2.1 (August 1997)– Secure IIOP and IIOP over SSL– COBOL and Ada language maps
Introduction
Motivation
Evolution
Example
Interoperability
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 49Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Evolution (4)CORBA Evolution (4)
CORBA 2.2 (February 1998)– POA – DCOM Interworking– IDL/JAVA language mapping specification.
CORBA 2.3 (June 1999)– COM/CORBA Part A and B– Portability IDL/Java – Objects by value– Java to IDL Language Mapping – IDL to Java Language Mapping – C++ Language Mapping
Introduction
Motivation
Evolution
Example
Interoperability
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 50Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Evolution (5)CORBA Evolution (5)
CORBA 2.4 (October 2000)– Messaging specification – Interoperable Naming service – Notification service – Minimum and Real-time CORBA
CORBA 2.5 (September 2001)– Fault Tolerant – Messaging (editorial changes) – Portable Interceptors – Realtime CORBA, v1.2
CORBA 2.6 (December 2001)– Common Security
Introduction
Motivation
Evolution
Example
Interoperability
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 51Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Evolution (6)CORBA Evolution (6)
CORBA 3.0 (June 2002)– Java and Internet Integration
Objects Passable by Value (first in ver 2.3) Java-to-IDL Mapping (first in ver 2.3) Interoperable Name Service (first in ver 2.4) Firewall Specification
– Quality of Service Control Asynchronous Messaging (first in ver 2.4) Minimum (first in ver 2.4), Fault-Tolerant (first in
ver 2.5), and Real-Time CORBA (first in ver 2.4)
– The CORBA component architecture CORBAcomponents Scripting Languages
Introduction
Motivation
Evolution
Example
Interoperability
OvervieOverview:w:
Advanced
Big Picture
CSE 812 04/14-16/2003 52Introduction to CORBA by SeyedMasoud Sadjadi
AgendaAgenda
Advanced Features
Motivation
Introduction
Interoperability
CORBA Evolution
Example
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Big Picture
CSE 812 04/14-16/2003 53Introduction to CORBA by SeyedMasoud Sadjadi
POA Supports ScalabilityPOA Supports Scalability
Object implementation portability between ORBs
Object instances with persistent identities Transparent activation Single servant implementing multiple
instances Transient objects with minimal programming Fine or coarse control of behavior and
persistence by an implementation Multiple policies for key object behaviors Implementations inheriting from static
skeleton classes
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
QoS
CCM
Minimum CORBA
RT CORBA
FT CORBA
Others
POA
CSE 812 04/14-16/2003 54Introduction to CORBA by SeyedMasoud Sadjadi
Objects by ValueObjects by Value
A struct with added value– They can have state and behaviour– Not CORBA objects– Can inherit from other valuetypes and
support interfaces Supports the CORBA component
model and Java to IDL reverse mapping
New keywords: valuetype, public, private, abstract
Uses a value factory to create local object
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
POA
QoS
CCM
Minimum CORBA
RT CORBA
FT CORBA
Others
Object by Value
CSE 812 04/14-16/2003 55Introduction to CORBA by SeyedMasoud Sadjadi
Quality of Service (1)Quality of Service (1)
Provides policy-based QoS Framework No standard defaults – ORB vendor
sets them Policy areas
– Rebind Support– Request / Reply Priority– Request / Reply Timeout– Synchronization Scope– Routing
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
CCM
Minimum CORBA
RT CORBA
FT CORBA
Others
QoS
CSE 812 04/14-16/2003 56Introduction to CORBA by SeyedMasoud Sadjadi
Quality of Service (2)Quality of Service (2)
Specifying QoS Parameters – Specify for an Object Implementation
In an object reference, QoS requirements are expressed through a profile Component in the IOR
– Specify for a particular Request In a GIOP request, QoS requirements are expressed
as part of its Service Context
– CORBA resolves conflicts Asynchronous Method Invocation (AMI)
– Callback mode Similar to providing a callback handler object
– Polling mode Returns a valuetype object for client to check
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
CCM
Minimum CORBA
RT CORBA
FT CORBA
Others
QoS
CSE 812 04/14-16/2003 57Introduction to CORBA by SeyedMasoud Sadjadi
Quality of Service (3)Quality of Service (3)
Invocation Types– Synchronous: the reply is obtained and returned
to the client as part of the single (blocking, to the client) operation used by the client application to make the request.
– Deferred Synchronous: control returns to the application without a reply, but the client ORB still invokes synchronously on the target. The reply may be returned to the client later.
– Asynchronous: the client ORB does not synchronously invoke the target to obtain a reply. Some other agent separates the client ORB from the target.
– Time-Independent: a specialization of asynchronous invocation in which the computational context that obtains the reply may be different from the computational context from which the original invocation was made.
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
CCM
Minimum CORBA
RT CORBA
FT CORBA
Others
QoS
CSE 812 04/14-16/2003 58Introduction to CORBA by SeyedMasoud Sadjadi
Quality of Service (4)Quality of Service (4)
Ordering Invocations– ANY: the client doesn’t specify in what order its
requests are processed.
– TEMPORAL: requests that invocations be processed in the order in which they were issued. TEMPORAL is the default.
– PRIORITY: requests that invocations be processed based on the priority assigned in the QoS structure described later.
– DEADLINE: requests that invocations whose time_to_live is about to expire are moved to the front of the queue.
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
CCM
Minimum CORBA
RT CORBA
FT CORBA
Others
QoS
CSE 812 04/14-16/2003 59Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Component Model (1)CORBA Component Model (1)
Framework for designing, implementing and deploying CORBA components.
Purpose is to simplify and reduce effort by using a container that:– manages lifecycle– provides CORBA services– allows clean separation between
application logic and CORBA– Support for ready made components
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
Minimum CORBA
RT CORBA
FT CORBA
Others
CCM
CSE 812 04/14-16/2003 60Introduction to CORBA by SeyedMasoud Sadjadi
CORBA Component Model (2)CORBA Component Model (2)
Two levels of component– Basic - fully compatible with EJB– Extended - components expose ports
Component categories– Session, Service, Entity, Process
More extra keywords like component, home, supports
Implementations?– K2 Component Server– MicoCCM– OpenCCM
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
Minimum CORBA
RT CORBA
FT CORBA
Others
CCM
CSE 812 04/14-16/2003 61Introduction to CORBA by SeyedMasoud Sadjadi
Minimum CORBA (1)Minimum CORBA (1)
Designed systems with limited resources– Do not need everything that CORBA
provides– Has size and space limits
Some operations are omitted from Object, ORB
Other omissions– Dynamic Invocation Interface– Dynamic Skeleton interface– Dynamic any– Interface Repository
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
CCM
RT CORBA
FT CORBA
Others
Minimum CORBA
CSE 812 04/14-16/2003 62Introduction to CORBA by SeyedMasoud Sadjadi
Minimum CORBA (2)Minimum CORBA (2)
The POA– Default policies only for:
create_thread_policy create_implicit_activation_policy create_servant_retention_policy create_request_processing_policy
– No dynamic activation of POAs– No ServantManagers
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
CCM
RT CORBA
FT CORBA
Others
Minimum CORBA
CSE 812 04/14-16/2003 63Introduction to CORBA by SeyedMasoud Sadjadi
Real-Time CORBA (1)Real-Time CORBA (1)
Features– Adds QoS control capabilities to regular
CORBA.– Improve application predictability by
bounding priority inversion– Manage system resources end-to-end.
Processor resources Communication resources Memory resources
Shortcomings– Static fixed-priority real-time– Steep learning curve:
Cause by the complex C++ mapping.– Run-time and memory footprint overhead
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
CCM
Minimum CORBA
FT CORBA
Others
RT CORBA
CSE 812 04/14-16/2003 64Introduction to CORBA by SeyedMasoud Sadjadi
Real-Time CORBA (2)Real-Time CORBA (2)
Real-time CORBA extensions
ORB RTORB
RTCORBA::Current
CORBA::Current
RTCORBA::Priority
SchedulingService
RTPOA
RTCORBA::Threadpool
(Others)ESIOPIIOP
(GIOP/TCP)RTCORBA::
PriorityMapping
POA
Servant
Client Server
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
CCM
Minimum CORBA
FT CORBA
Others
RT CORBA
CSE 812 04/14-16/2003 65Introduction to CORBA by SeyedMasoud Sadjadi
Fault Tolerant CORBA (1)Fault Tolerant CORBA (1)
Aims to provide robust support for high reliability
Defines a fault-tolerance infrastructure Provides reliability by
– entity redundancy object replication (passive and active)
– request retry and redirection– fault detection and recovery
Multiple profiles in IOR– Example of a FT corbaloc URL
corbaloc::1.2@hostA:683,:1.2@hostB:683/myObj
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
CCM
Minimum CORBA
RT CORBA
Others
FT CORBA
CSE 812 04/14-16/2003 66Introduction to CORBA by SeyedMasoud Sadjadi
Fault Tolerant CORBA (2)Fault Tolerant CORBA (2)
is_alive()
CORBA ORB CORBA ORBCORBA ORB
ReplicationManager
FaultNotifier
FaultDetector
Client
CServer
S1
Server
S2
LoggingMechanism
FactoryFault
Detector
RecoveryMechanism
LoggingMechanism
FactoryFault
Detector
RecoveryMechanism
LoggingMechanism
set_properties()
create_object()
notifications
fault reportscreate_object()
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
CCM
Minimum CORBA
RT CORBA
Others
FT CORBA
CSE 812 04/14-16/2003 67Introduction to CORBA by SeyedMasoud Sadjadi
Other New SpecificationsOther New Specifications
Data Parallel Processing– Defines Architecture for parallel programming– Data is typically divided and redistributed
Unreliable Multicast (MIOP)– Deliver messages to many objects at once– Takes advantage of network ability– IDL operations would require oneway– Clients “join” a multicast group with a group IOR
Domain CORBAfacilities– “IDL is a great way to define standard interfaces for
standard objects that every company in an industry can share.”
Introduction
Motivation
Advanced
Interoperability
Evolution
OvervieOverview:w:
Example
Big Picture
Object by Value
POA
QoS
CCM
Minimum CORBA
RT CORBA
FT CORBA
Others
CSE 812 04/14-16/2003 68Introduction to CORBA by SeyedMasoud Sadjadi
AgendaAgenda
Big Picture
Motivation
Introduction
Interoperability
CORBA Evolution
Advance Features
Introduction
Motivation
Big Picture
Interoperability
Evolution
OvervieOverview:w:
Advanced
Example
Example
CSE 812 04/14-16/2003 69Introduction to CORBA by SeyedMasoud Sadjadi
Model Driven ArchitectureModel Driven Architecture
Open vendor-neutral approach Separating business logic from technologyIntroduction
Motivation
Big Picture
Interoperability
Evolution
OvervieOverview:w:
Advanced
Example
MDA
OMA
CSE 812 04/14-16/2003 70Introduction to CORBA by SeyedMasoud Sadjadi
MDA SpecificationsMDA Specifications
MDA Specification Support The MDA Architecture The Unified Modeling Language (UML) UML Profiles The Meta-Object Facility (MOF) XML Metadata Interchange (XMI) Common Warehouse Metamodel (CWM) CORBA Writing Standards in the MDA Pervasive Services Domain (Industry-specific) Facilities MDA Applications
Introduction
Motivation
Big Picture
Interoperability
Evolution
OvervieOverview:w:
Advanced
Example
MDA
OMA
CSE 812 04/14-16/2003 71Introduction to CORBA by SeyedMasoud Sadjadi
OMA Overview (1)OMA Overview (1)
ApplicationObjects
HorizomtalCORBA Facilities
Object Request Broker
CORBA Services
VerticalCORBA
Facilities
LifecycleEventsNamingPersistenceTransactionsConcurrency
ExternalizationSecurityTimePropertiesQueryLicensing
Compound DocsObject LinkingHelp FacilitiesDesktop Mgmt
Not standardized by OMG; Scope isSingle application or vendor
Business ObjectsHealthcareFinanceTelecommunication
OMG's vision for the component softwareIntroduction
Motivation
Big Picture
Interoperability
Evolution
OvervieOverview:w:
Advanced
Example
OMA
MDA
CSE 812 04/14-16/2003 72Introduction to CORBA by SeyedMasoud Sadjadi
Object Management Object Management Architecture (2)Architecture (2)
Object Services – (a.k.a, CORBA Services)– Domain-independent services.– Naming Service and Trading Service.
Common Services – (a.k.a, Common Facilities and Horizontal Facilities)– are less oriented towards end-user applications.– Distributed Document Component Facility (DDCF).
Domain Services – (a.k.a, Domain Interfaces and Vertical Facilities)– are more oriented towards specific app domains. – Product Data Management (PDM) Enablers for the
manufacturing domain. Application Services
– (a.k.a, Application Interfaces and Application Objects)– are services developed specifically for a given application.
Introduction
Motivation
Big Picture
Interoperability
Evolution
OvervieOverview:w:
Advanced
Example
OMA
MDA
CSE 812 04/14-16/2003 73Introduction to CORBA by SeyedMasoud Sadjadi
Vertical CORBA ServicesVertical CORBA Services
Official OMG specifications in vertical market domains:– Business Objects– Finance/Insurance– Electronic Commerce– Healthcare– Telecommunications– Transportation– Manufacturing– Life Sciences Research– Coming: Utilities, Statistics
Bring benefits of CORBA and OMA to Domains.
Introduction
Motivation
Big Picture
Interoperability
Evolution
OvervieOverview:w:
Advanced
Example
OMA
MDA
CSE 812 04/14-16/2003 74Introduction to CORBA by SeyedMasoud Sadjadi
CORBA/OMA EnvironmentCORBA/OMA Environment
Starts with the Basics:– IDL Interfaces & Mappings– ORB-based Architecture– Static & Dynamic Invocation Modes– GIOP/IIOP Interoperability– Optional Asynchronous Modes– Naming Service– Event Service
Add Services and Facilities:– Security Service– Transaction Service– Object Trader Service– COM/CORBA Mapping
Then add Domain Componet
Introduction
Motivation
Big Picture
Interoperability
Evolution
OvervieOverview:w:
Advanced
Example
OMA
MDA