SlideShare a Scribd company logo
CORBA Introduction
- Common Object Request Broker Architecture
1
--by WangJianmin
http://weibo.com/lanxuezaipiao/
http://www.cnblogs.com/lanxuezaipiao
2
Outline
 Distributed Computing
 CORBA Introduction
 Architecture
 Key components
 An example
 Advantages
3
Distributed Computing
 Local vs. Remote objects
 An enterprise app is a collection of co-
operating objects located on different machines
4
Existing Mechanisms
 Sockets (TCP, UDP) not OO
 RPC (not OO)
 CORBA
 RMI
 EJB
 JMS
 DCOM
 WebService
 ……
CORBA vs. WebService
5
 One important observation concerning CORBA and Web services
is that whatever can be accomplished by CORBA can be
accomplished using Web service technologies and vice versa,
although the amount of effort required would be noticeably
different. In particular, one can implement CORBA on top of
SOAP, or SOAP on top of CORBA.
6
Aspect CORBA Web services
Data model Object model SOAP message exchange
model
Client-Server coupling Tight Loose
Location transparency Object references URL
Type system IDL XML schemas
static + runtime checks runtime checks only
Error handling IDL exception SOAP fault messages
Serialization built into the ORB can be chosen by the user
Parameter passing by reference by value (no notion of
objects)
by value (valuetype)
Transfer syntax CDR used on the wire XML used on the wire
binary format Unicode
State stateful stateless
Request semantics at-most-once defined by SOAP
Runtime composition DII UDDI/WSDL
Registry Interface Repository UDDI/WSDL
Implementation repository
Service discovery CORBA naming/trading
service
UDDI
RMI registry
Language support any language with an IDL
binding
any language
Security CORBA security service HTTP/SSL, XML signature
Firewall Traversal work in progress uses HTTP port 80
Events CORBA event service N/A
CORBA vs. RMI
 CORBA interfaces are defined in IDL, RMI interfaces are defined
in Java
 CORBA is language-independent, RMI is not
 CORBA objects are not garbage collected, RMI objects are
garbage collected automatically.
 RMI does not support “out” and “inout” operations since local
objects are copied, and remote objects passed by reference to
stub
 RMI-IIOP(RMI and CORBA): less resources and more robust
7
8
CORBA vs. EJB
 These have many common objectives
– definition, packaging and deployment of components
 CORBA has always been component oriented
– EJB ideas are being extended and incorporated into CORBA 3
– EJB is like CORBA without language independence
 A Java-based CORBA will then be the best EJB
– a EJB flavor on the richness of CORBA
 EJB mandates CORBA interoperability
– and many EJB services are very close derivatives of their
CORBA forerunners.
 Why is this so important?
– Because more component frameworks will emerge over time!
9
CORBA Introduction
 A standard controlled by the Object
Management Group (OMG)
 A spec for creating distributed objects
 Its architecture is based on the object model
 Promotes design of applications as a set of
cooperating objects
 based on client/server concepts
CORBA Objects
 It is important to note that CORBA objects differ
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.
10
CORBA Architecture
11
ORB core
Dynamic
Invocation
IDL
Stubs
ORB
Interface
Object
Adapter
Static IDL
Skeleton
Dynamic
Skeleton
Client Object Implementation
Standard Interface Per-Object Type
Generated Interface
ORB Dependent
Interface
Interface
Repository
Implementation
Repository
12
Middleware?
First key - ORB
13
Client
Client
Client
Server
Server
Server
ORB
First key - ORB
 Provides a communications hub for all objects
– analogous to a hardware bus
 Uses a broker to handle messages requests
between clients and servers
– broker can choose server that best fits needs of
client
– allows separation of interface and implementation
– allows building block approach to development and
evolution
14
15
First key - ORB
 Object bus that provides object location
transparency
 Responsible for mechanisms to:
– Find the object implementation of the request
– Prepare object implementation to receive the
request
– Communicate the data making up the request
Object adapter
 An object adapter is the primary means for an object
implementation to access ORB services such as object
reference generation.
 an object adapter bridges the gap between
– CORBA objects with IDL interfaces and
– the programming language interfaces of the corresponding servant
(classes)
16
Object adapter
 An object adapter has the following tasks:
– it creates remote object references for CORBA objects;
– it dispatches each RMI via a skeleton to the appropriate servant;
– it activates objects.
 An object adapter gives each CORBA object a unique object
name.
– the same name is used each time an object is activated.
 it is specified by the application program or generated by the object
adapter.
– Each active CORBA object is registered with its object adapter,
 which keeps a remote object table to maps names of CORBA objects to
servants.
 Each object adapter has its own name - specified by the
application program or generated automatically.
 OA helps the ORB to operate with different type of objects.
17
18
How to Communicate?
19
Second key - IDL
Java
C++
C
VB
Ada
Implementation is
Hidden behind
interface
Service or Contract-
oriented View
Why IDL?
 IDL provides facilities for defining modules, interfaces,
types, attributes and method signatures.
 IDL has the same lexical rules as C++ but has
additional keywords to support distribution,
– e.g. interface, any, attribute, in, out, inout, readonly, raises.
 It allows standard C++ pre-processing facilities.
– e.g. typedef for All.
 The grammar of IDL is a subset of ANSI C++ with
additional constructs to support method signatures.
20
IDL Structure
module <identifier> {
<type declarations>;
<constant declarations>;
<exception declarations;
<interface definition>;
<interface definition>;
};
21
22
Agreement?
23
CORBA Software Bus
C++ COBOL Smalltalk
Interface
Definition
Language
Protocol for
communication:
IIOP
Java VB
24
Third key - IIOP
 The General Inter-ORB protocol(GIOP) defines
– an external data representation, called CDR
– specifies formats for the messages in a request-
reply protocol.
• including messages for enquiring about the location of an
object, for cancelling requests and for reporting errors.
 The Internet Inter-ORB protocol (IIOP) defines
a standard form for remote object references.
– IIOP is a specialized form of GIOP for TCP/IP
networks.
25
Third key - IIOP
 Don't be put off by GIOP and IIOP, they are just
names for familiar things
– GIOP is just about external data representation and
a Request-reply protocol allowing for objects to be
activated
– IIOP is just about remote object references
26
Corba Services
 Naming Service
 Event Service and Notification Service:
– in ES suppliers and consumers communicate via an event channel
– NS extends this to allow filtering and typed events
 Security service:
– authentication of principals and access control of CORBA objects with
policies
– auditing by servers, facilities for non-repudiation
 Trading service:
– allows CORBA objects to be located by attribute
 Transaction service and concurrency control service
– TS provides flat or nested transactions
– CCS provides locking of CORBA objects
 Persistent object service:
– for storing the state of CORBA objects in a passive form and
retrieving it
Steps of a CORBA-based App
 The steps involved:
– Define an interface(IDL file)
– Map IDL to Java (idlj compiler)
– Implement the interface
– Write a Server
– Write a Client
– Run the application
 Example: a step-by-step Hello example
27
Step 1: define the interface
28
 Hello.idl
module HelloApp {
interface Hello {
string sayHello();
};
};
Step 2: map Hello.idl to Java
29
 Use the idlj compiler
idlj -fall Hello.idl (Inheritance model)
idlj -fallTie -oldImplBase Hello.idl (Tie model)
 This will generate:
_HelloImplBase.java (server skeleton)
HelloStub.java (client stub, or proxy)
Hello_Tie.java (only Tie model)
Hello.java
HelloHelper.java
HelloHolder.java
HelloOperations.java
Step 3: implement the interface
30
 Implement the servant
public class HelloImpl extends _HelloImplBase {
public String sayHello() {
return "nHello world !!n";
}
}
Step 4: implement the server
31
 Creates and initializes an ORB instance
– ORB orb = ORB.init(args, null);
 Creates a servant instance (the implementation of one CORBA
Hello object)
– HelloImpl helloImpl = new HelloImpl();
 Obtain a reference for the desired object and register it with ORB
– By creating a tie with the servant being the delegate(Tie model)
– By a naming context (Inheritance model)
 "Stringify" the reference
– String ior = orb.object_to_string(hello);
 Waits for invocations of the new object from the client
– orb.run();
– Thread.currentThread().join();
Step 4: implement the server
 Note: to use a CORBA object, you must posses a valid reference
to it. An object reference may be obtained in one of three ways:
– CORBA::ORB::resolve_initial_references( <class-name> )
returns a reference to the specified class if the ORB can find it
– Invoking a "factory" method on an object whose reference you
already have (a "factory" creates other objects)
– Converting a "stringified" reference to a real reference
 the preferred way to obtain an object reference is the latter
32
Step 5: write a client
33
 Creates and initializes an ORB instance
– ORB orb = ORB.init(args, null);
 Obtain a reference for the desired object from IOR.
– read stringified object from IOR
– resolve the Object Reference(by HelloHelper.narrow() method)
 "Invokes the object's sayHello() operations and prints the result
Step 6: run the application
 Compile the .java files, including the stubs and skeletons
– javac *.java HelloApp/*.java
 Start orbd
– orbd -ORBInitialPort 1050 -ORBInitialHost localhost&
 Start the Hello server
– java HelloServer -ORBInitialPort 1050 -ORBInitialHost localhost&
 Run the client application
– java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost
34
35
Advantages of CORBA
 Object Location Transparency
 Server Transparency
 Language Transparency
 Implementation Transparency
 Architecture Transparency
 Operating System Transparency
 Protocol Transparency
References
 Java IDL: The "Hello World" Example With The ImplBase Server-Side
Model (old version)
 Java IDL: The "Hello World" Example
 Java IDL: The "Hello World" Example With The ImplBase Server-Side
Model
 CORBA Tutorial
 Locating CORBA objects using Java IDL
36
37
THANK YOU

More Related Content

PPTX
Epp6 aralin 1 punongkahoy
PDF
Sales and inventory management project report
PDF
Sample project abstract
PPT
Distributed objects & components of corba
PPSX
JDBC: java DataBase connectivity
PDF
IBM Food Trust
PPT
PPTX
Java Server Pages(jsp)
Epp6 aralin 1 punongkahoy
Sales and inventory management project report
Sample project abstract
Distributed objects & components of corba
JDBC: java DataBase connectivity
IBM Food Trust
Java Server Pages(jsp)

What's hot (20)

PPT
CORBA Basic and Deployment of CORBA
PDF
Remote Method Invocation (RMI)
PPTX
Corba concepts & corba architecture
PPTX
Dead Lock in operating system
PPTX
RPC: Remote procedure call
PPTX
Inheritance in java
PPTX
Osi model vs TCP/IP
PDF
Servlet and servlet life cycle
PPTX
Computer Network - Network Layer
PPT
C O R B A Unit 4
PPTX
Threads (operating System)
PPSX
Introduction to .net framework
PDF
Semaphores
DOCX
Cs8581 networks lab manual 2017
PPTX
User datagram protocol (udp)
PPTX
Presentation on Core java
PPTX
Rmi presentation
PPTX
Memory Management in OS
PDF
IoT Communication Protocols
CORBA Basic and Deployment of CORBA
Remote Method Invocation (RMI)
Corba concepts & corba architecture
Dead Lock in operating system
RPC: Remote procedure call
Inheritance in java
Osi model vs TCP/IP
Servlet and servlet life cycle
Computer Network - Network Layer
C O R B A Unit 4
Threads (operating System)
Introduction to .net framework
Semaphores
Cs8581 networks lab manual 2017
User datagram protocol (udp)
Presentation on Core java
Rmi presentation
Memory Management in OS
IoT Communication Protocols
Ad

Viewers also liked (20)

PDF
Common Object Request Broker Architecture - CORBA
PPTX
PDF
RMI and CORBA Why both are valuable tools
PPT
Corba by Example
PDF
CORBA Programming with TAOX11/C++11 tutorial
PPT
java 6 (rmi-corba) education
PDF
Service Oriented Architecture
PDF
PPTX
CORBA Component Model
PDF
PPTX
Client server component
PPT
Linux Firewall - NullCon Chennai Presentation
PPTX
A Case Study In Social CRM Without Technology: The Green Bay Packers
PPTX
PPT
Interoperability
PPT
Service Oriented Architecture
PPT
Distributed Multimedia Systems(DMMS)
PPT
Chapter 17 corba
PPT
Common Object Request Broker Architecture - CORBA
RMI and CORBA Why both are valuable tools
Corba by Example
CORBA Programming with TAOX11/C++11 tutorial
java 6 (rmi-corba) education
Service Oriented Architecture
CORBA Component Model
Client server component
Linux Firewall - NullCon Chennai Presentation
A Case Study In Social CRM Without Technology: The Green Bay Packers
Interoperability
Service Oriented Architecture
Distributed Multimedia Systems(DMMS)
Chapter 17 corba
Ad

Similar to Corba introduction and simple example (20)

DOCX
85305524 i-t-case-study
PPT
CORBA.ppt
PPT
Unit iv
PPT
Corba and-java
DOCX
82159587 case-study-on-corba
PPT
ADVANCED JAVA MODULE III & IV.ppt
PPTX
PPTX
corba-151024114450-lva1-app6891.pptx
PPT
PPT
Distributed systems corba remote connection
PDF
CORBA - Introduction and Details
PPTX
Distributing computing.pptx
PPTX
Corba model ppt
PDF
Distributed computing - november 2006
PPT
MIDELWARE TECH
PDF
EAI and Attachmate Pt. 2 9-00
DOCX
Chapter2
PDF
6. The grid-COMPUTING OGSA and WSRF
PPTX
Common Object Request Broker Architecture
PPTX
Corba in power system
85305524 i-t-case-study
CORBA.ppt
Unit iv
Corba and-java
82159587 case-study-on-corba
ADVANCED JAVA MODULE III & IV.ppt
corba-151024114450-lva1-app6891.pptx
Distributed systems corba remote connection
CORBA - Introduction and Details
Distributing computing.pptx
Corba model ppt
Distributed computing - november 2006
MIDELWARE TECH
EAI and Attachmate Pt. 2 9-00
Chapter2
6. The grid-COMPUTING OGSA and WSRF
Common Object Request Broker Architecture
Corba in power system

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
August Patch Tuesday
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Encapsulation theory and applications.pdf
Network Security Unit 5.pdf for BCA BBA.
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Heart disease approach using modified random forest and particle swarm optimi...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
cloud_computing_Infrastucture_as_cloud_p
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
August Patch Tuesday
A comparative analysis of optical character recognition models for extracting...
Unlocking AI with Model Context Protocol (MCP)
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
Group 1 Presentation -Planning and Decision Making .pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia

Corba introduction and simple example

  • 1. CORBA Introduction - Common Object Request Broker Architecture 1 --by WangJianmin http://weibo.com/lanxuezaipiao/ http://www.cnblogs.com/lanxuezaipiao
  • 2. 2 Outline  Distributed Computing  CORBA Introduction  Architecture  Key components  An example  Advantages
  • 3. 3 Distributed Computing  Local vs. Remote objects  An enterprise app is a collection of co- operating objects located on different machines
  • 4. 4 Existing Mechanisms  Sockets (TCP, UDP) not OO  RPC (not OO)  CORBA  RMI  EJB  JMS  DCOM  WebService  ……
  • 5. CORBA vs. WebService 5  One important observation concerning CORBA and Web services is that whatever can be accomplished by CORBA can be accomplished using Web service technologies and vice versa, although the amount of effort required would be noticeably different. In particular, one can implement CORBA on top of SOAP, or SOAP on top of CORBA.
  • 6. 6 Aspect CORBA Web services Data model Object model SOAP message exchange model Client-Server coupling Tight Loose Location transparency Object references URL Type system IDL XML schemas static + runtime checks runtime checks only Error handling IDL exception SOAP fault messages Serialization built into the ORB can be chosen by the user Parameter passing by reference by value (no notion of objects) by value (valuetype) Transfer syntax CDR used on the wire XML used on the wire binary format Unicode State stateful stateless Request semantics at-most-once defined by SOAP Runtime composition DII UDDI/WSDL Registry Interface Repository UDDI/WSDL Implementation repository Service discovery CORBA naming/trading service UDDI RMI registry Language support any language with an IDL binding any language Security CORBA security service HTTP/SSL, XML signature Firewall Traversal work in progress uses HTTP port 80 Events CORBA event service N/A
  • 7. CORBA vs. RMI  CORBA interfaces are defined in IDL, RMI interfaces are defined in Java  CORBA is language-independent, RMI is not  CORBA objects are not garbage collected, RMI objects are garbage collected automatically.  RMI does not support “out” and “inout” operations since local objects are copied, and remote objects passed by reference to stub  RMI-IIOP(RMI and CORBA): less resources and more robust 7
  • 8. 8 CORBA vs. EJB  These have many common objectives – definition, packaging and deployment of components  CORBA has always been component oriented – EJB ideas are being extended and incorporated into CORBA 3 – EJB is like CORBA without language independence  A Java-based CORBA will then be the best EJB – a EJB flavor on the richness of CORBA  EJB mandates CORBA interoperability – and many EJB services are very close derivatives of their CORBA forerunners.  Why is this so important? – Because more component frameworks will emerge over time!
  • 9. 9 CORBA Introduction  A standard controlled by the Object Management Group (OMG)  A spec for creating distributed objects  Its architecture is based on the object model  Promotes design of applications as a set of cooperating objects  based on client/server concepts
  • 10. CORBA Objects  It is important to note that CORBA objects differ 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. 10
  • 11. CORBA Architecture 11 ORB core Dynamic Invocation IDL Stubs ORB Interface Object Adapter Static IDL Skeleton Dynamic Skeleton Client Object Implementation Standard Interface Per-Object Type Generated Interface ORB Dependent Interface Interface Repository Implementation Repository
  • 13. First key - ORB 13 Client Client Client Server Server Server ORB
  • 14. First key - ORB  Provides a communications hub for all objects – analogous to a hardware bus  Uses a broker to handle messages requests between clients and servers – broker can choose server that best fits needs of client – allows separation of interface and implementation – allows building block approach to development and evolution 14
  • 15. 15 First key - ORB  Object bus that provides object location transparency  Responsible for mechanisms to: – Find the object implementation of the request – Prepare object implementation to receive the request – Communicate the data making up the request
  • 16. Object adapter  An object adapter is the primary means for an object implementation to access ORB services such as object reference generation.  an object adapter bridges the gap between – CORBA objects with IDL interfaces and – the programming language interfaces of the corresponding servant (classes) 16
  • 17. Object adapter  An object adapter has the following tasks: – it creates remote object references for CORBA objects; – it dispatches each RMI via a skeleton to the appropriate servant; – it activates objects.  An object adapter gives each CORBA object a unique object name. – the same name is used each time an object is activated.  it is specified by the application program or generated by the object adapter. – Each active CORBA object is registered with its object adapter,  which keeps a remote object table to maps names of CORBA objects to servants.  Each object adapter has its own name - specified by the application program or generated automatically.  OA helps the ORB to operate with different type of objects. 17
  • 19. 19 Second key - IDL Java C++ C VB Ada Implementation is Hidden behind interface Service or Contract- oriented View
  • 20. Why IDL?  IDL provides facilities for defining modules, interfaces, types, attributes and method signatures.  IDL has the same lexical rules as C++ but has additional keywords to support distribution, – e.g. interface, any, attribute, in, out, inout, readonly, raises.  It allows standard C++ pre-processing facilities. – e.g. typedef for All.  The grammar of IDL is a subset of ANSI C++ with additional constructs to support method signatures. 20
  • 21. IDL Structure module <identifier> { <type declarations>; <constant declarations>; <exception declarations; <interface definition>; <interface definition>; }; 21
  • 23. 23 CORBA Software Bus C++ COBOL Smalltalk Interface Definition Language Protocol for communication: IIOP Java VB
  • 24. 24 Third key - IIOP  The General Inter-ORB protocol(GIOP) defines – an external data representation, called CDR – specifies formats for the messages in a request- reply protocol. • including messages for enquiring about the location of an object, for cancelling requests and for reporting errors.  The Internet Inter-ORB protocol (IIOP) defines a standard form for remote object references. – IIOP is a specialized form of GIOP for TCP/IP networks.
  • 25. 25 Third key - IIOP  Don't be put off by GIOP and IIOP, they are just names for familiar things – GIOP is just about external data representation and a Request-reply protocol allowing for objects to be activated – IIOP is just about remote object references
  • 26. 26 Corba Services  Naming Service  Event Service and Notification Service: – in ES suppliers and consumers communicate via an event channel – NS extends this to allow filtering and typed events  Security service: – authentication of principals and access control of CORBA objects with policies – auditing by servers, facilities for non-repudiation  Trading service: – allows CORBA objects to be located by attribute  Transaction service and concurrency control service – TS provides flat or nested transactions – CCS provides locking of CORBA objects  Persistent object service: – for storing the state of CORBA objects in a passive form and retrieving it
  • 27. Steps of a CORBA-based App  The steps involved: – Define an interface(IDL file) – Map IDL to Java (idlj compiler) – Implement the interface – Write a Server – Write a Client – Run the application  Example: a step-by-step Hello example 27
  • 28. Step 1: define the interface 28  Hello.idl module HelloApp { interface Hello { string sayHello(); }; };
  • 29. Step 2: map Hello.idl to Java 29  Use the idlj compiler idlj -fall Hello.idl (Inheritance model) idlj -fallTie -oldImplBase Hello.idl (Tie model)  This will generate: _HelloImplBase.java (server skeleton) HelloStub.java (client stub, or proxy) Hello_Tie.java (only Tie model) Hello.java HelloHelper.java HelloHolder.java HelloOperations.java
  • 30. Step 3: implement the interface 30  Implement the servant public class HelloImpl extends _HelloImplBase { public String sayHello() { return "nHello world !!n"; } }
  • 31. Step 4: implement the server 31  Creates and initializes an ORB instance – ORB orb = ORB.init(args, null);  Creates a servant instance (the implementation of one CORBA Hello object) – HelloImpl helloImpl = new HelloImpl();  Obtain a reference for the desired object and register it with ORB – By creating a tie with the servant being the delegate(Tie model) – By a naming context (Inheritance model)  "Stringify" the reference – String ior = orb.object_to_string(hello);  Waits for invocations of the new object from the client – orb.run(); – Thread.currentThread().join();
  • 32. Step 4: implement the server  Note: to use a CORBA object, you must posses a valid reference to it. An object reference may be obtained in one of three ways: – CORBA::ORB::resolve_initial_references( <class-name> ) returns a reference to the specified class if the ORB can find it – Invoking a "factory" method on an object whose reference you already have (a "factory" creates other objects) – Converting a "stringified" reference to a real reference  the preferred way to obtain an object reference is the latter 32
  • 33. Step 5: write a client 33  Creates and initializes an ORB instance – ORB orb = ORB.init(args, null);  Obtain a reference for the desired object from IOR. – read stringified object from IOR – resolve the Object Reference(by HelloHelper.narrow() method)  "Invokes the object's sayHello() operations and prints the result
  • 34. Step 6: run the application  Compile the .java files, including the stubs and skeletons – javac *.java HelloApp/*.java  Start orbd – orbd -ORBInitialPort 1050 -ORBInitialHost localhost&  Start the Hello server – java HelloServer -ORBInitialPort 1050 -ORBInitialHost localhost&  Run the client application – java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost 34
  • 35. 35 Advantages of CORBA  Object Location Transparency  Server Transparency  Language Transparency  Implementation Transparency  Architecture Transparency  Operating System Transparency  Protocol Transparency
  • 36. References  Java IDL: The "Hello World" Example With The ImplBase Server-Side Model (old version)  Java IDL: The "Hello World" Example  Java IDL: The "Hello World" Example With The ImplBase Server-Side Model  CORBA Tutorial  Locating CORBA objects using Java IDL 36

Editor's Notes

  • #12: IDL generates ‘stubs’ and ‘skeleton’ programs for each interface ‘Stub’ acts like a local function call, providing interface to ORB ‘Skeleton’ is server side implementation of IDL interface Skeletons and stubs return the results and error messages