Академический Документы
Профессиональный Документы
Культура Документы
Enterprise Computing
Corporation have similar computing environments:
mixed set of HW platforms a mixed set of SW components programmers with very different skill sets need to maintain legacy code desire to avoid vendor lock-in
What is CORBA
CORBA (Common Object Request Broker Architecture) cross-platform, cross-language, vendorindependent specification for object-based distributed computing Introduced by the Object Management Group (OMG) in 1989
OMG
The OMG is a consortium that comprises over 700 companies and organizations
almost all the major vendors and developers of distributed object technology
platforms databases software tools
CORBA
CORBA can be thought as a languageindependent version of RMI
similar lifecycle including definition of interfaces, generation of stubs and skeletons
CORBA Architecture
Client Invokes methods implemented by the server Server
Network
Stub Marshalls invocation and sends data to skeleton Skeleton Un-marshalls data and invokes method on server
CORBA Components
Interface Definition Language (IDL) Wire Protocol (IIOP) Language Mappings
CORBA Architecture
Client Invokes methods generated from IDL (implemented by the server) Server
Stub
Marshalls invocation and sends data to skeleton Automatically generated from IDL
Skeleton
Un-marshalls data and invokes method on server Automatically generated from IDL
ORB
IIOP
ORB
ORB
The ORB is the distributed service that implements the request to the remote object.
It locates the remote object on the network communicates the request to the object waits for the results and when available communicates those results back to the client.
CORBA Products
ORB
Java 2 ORB VisisBroker for Java
Description
comes with Sun's Java 2 SDK A popular Java ORB from Inprise Corporation. VisiBroker is also embedded in other products
A popular Java ORB from Iona Technologies A popular application server with an ORB from IBM has a version of VisiBroker embedded in it Available from various websites
clients only depend on the interface IDL interfaces are programming language neutral
Bindings
IDL defines language bindings for many different programming languages
OMG has standardized on language bindings for: C, C++, Java, Ada, COBOL, Smalltalk, Objective C, and Lisp
Developers can choose the appropriate programming language for the object implementation and a possibly different programming language for the client. IDL declarations are compiled with an IDL compiler and converted to their associated representations in the target programming languages according to the standard language binding
IDL
module interface
Java
package interface
C++
namespace abstract class
operation
attribute exception
method
pair of methods exception
member function
pair of methods exception
HelloWorld Example
Hello Client
Object Reference sayHello Hello World!
Hello Server
Hello Servant sayHello
Stub
ORB IIOP TCP/IP (network)
Skeleton
ORB
{
string sayHello(); oneway void shutdown(); }; };
Generated Files
Hello.java
This interface contains the Java version of our IDL interface. The Hello.java interface extends org.omg.CORBA.Object, providing standard CORBA object functionality.
HelloPOA.java
This abstract class is the stream-based server skeleton provides basic CORBA functionality for the server The server class, HelloServant, extends HelloPOA.
_HelloStub.java
This class is the client stub, providing CORBA functionality for the client. Implements the Hello.java interface.
Generated Files
HelloOperations.java
contains the methods sayHello() and shutdown(). The IDL-to-Java mapping puts all of the operations defined on the IDL interface into this file, which is shared by both the stubs and skeletons
HelloHelper.java
This class provides auxiliary functionality. responsible for reading and writing the data types to CORBA streams
HelloHolder.java
its a subclass of HelloPOA, which is generated by the idlj compiler from the example IDL.
Servant methods are just like ordinary Java methods; the extra code to deal with the ORB, with marshaling arguments and results, and so on, is provided by the skeleton
Naming Services
The two options for Naming Services shipped with J2SE 1.5 are: orbd, which includes both a Transient Naming Service and a Persistent Naming Service. tnameserv - a Transient Naming Service.
The example uses orbd.
RMI/IIOP
JRMP the native protocol of RMI is replaced with IIOP, the CORBA protocol
RMI/IIOP Applications
Steps
1. Remote interface like in RMI
extends Remote
methods throw RemoteException
2. Server extends PortableRemoteObject instead of UnicatsRemoteObject 3. stubs and scheleton are generated using rmic with the iiop flag 4. CORBA naming service used instead of RMI registry 5. IDL can be generated from Step 1 and used to develop non-Java components