CORBA Framework Elements i Object Request Broker ORB
CORBA Framework Elements i Object Request Broker (ORB) 4 This is the object manager in CORBA i Mechanisms for specifying interfaces 4 Interface Definition Language (IDL) - for static interface definitions 4 Dynamic Invocation Interface (DII) - lets clients access interfaces as first-class objects at run-time from an Interface Repository. i Internet Inter-Orb Protocol (IIOP) 4 A binary protocol for communication between ORBs. 4 Was added in CORBA 2. 0 CORBA Framework Eelements 1
Object Request Broker (ORB) Object Implementation Client Dynamic Invocation Client Stubs ORB Interface Implementation Skeletons Object Adapter ORB Core One standardised interface One interface per object operation One interface per object adapter ORB-dependent interface There can be more than one object adapters CORBA Framework Eelements 2
Object Request Broker (ORB) i The Object Manager in CORBA i Both on the client side and the server side (allows agents to act as both clients and servers of remote objects) i On client side the ORB is responsible for 4 accepting requests for a remote object 4 finding implementation of the object 4 accepting client-side reference to the remote object(converted to a language specific form, e. g. , a Java stub object) 4 routing client method calls through the object reference to the object implementation i On server side the ORB 4 lets object servers register new objects 4 receives requests from the client ORB 4 uses object’s skeleton interface to invoke object’s activation method 4 creates reference for new object and sends it back to client CORBA Framework Eelements 3
Internet Inter-Orb Protocol (IIOP) i CORBA specification is neutral with respect to network protocols 4 the CORBA standard specifies what is known as the General Inter-ORB Protocol (GIOP) 4 GIOP is a high-level standard protocol for communication between ORBs 4 not used directly; instead, it is specialized by a particular protocol that would then be used directly i Internet Inter-ORB Protocol (IIOP) 4 IIOP is the GIOP-based protocol for TCP/IP networks 4 As of the 2. 0 version of the CORBA specification, vendors are required to implement the IIOP protocol i CORBA Networking Model 4 CORBA applications are built on top of GIOP-derived protocols such as IIOP 4 these protocols, in turn, rest on top of TCP/IP, DCE, or other underlying transport protocol the network uses 4 an application architecture can be designed to use a bridge that would interconnect, for instance, DCE-based application components with IIOP-based ones. CORBA Framework Eelements 4
Internet Inter-Orb Protocol (IIOP) Component Component OLE ORB ORB RPC Bridge CORBA Framework Eelements 5
Passing Objects by Reference i In a distributed application, there are two possible methods for an application component to obtain access to an object in another process: 4 When an object is passed by reference, the object itself remains "in place" while an object reference for that object is passed. Operations on the object through the object reference are actually processed by the object itself. 4 When an object is passed by value, the object's state is copied and passed to its destination (via object serialization), where a new copy of the object is instantiated. Operations on that object's copy are processed by the copy, not by the original object. 4 Note: in CORBA, objects are only passed by reference (however, the new CORBA specifications include facilities for passing objects by value). CORBA Framework Eelements 6
Object References i An Object Reference is the information needed to specify an object within an ORB. 4 The representation of an object reference handed to a client is only valid for the lifetime of that client. 4 The language mapping also provides additional ways to access object references in a typed way for the convenience of the programmer. 4 There is a distinguished object reference, the null reference, guaranteed to be different from all object references, that denotes no object. In Java, this is a Java null. i To invoke a CORBA object, you need a reference for the object. There are two ways to get a reference for a CORBA object: 4 from another object, such as a factory or a name service 4 from a string that was specially created from an object reference i Interoperable Object References 4 CORBA uses IOR as a “pointer” to a specific instance of a class in a distributed environment 4 encodes host, port, object identity 4 may be externalized (using object_to_string) CORBA Framework Eelements 7
Object References i Lifecycle and Longevity of Object Reference 4 Object Reference can be created without instantiating any servant object 4 Object Reference outlives the CORBA object to which it refers. (CORBA: : OBJECT_NOT_EXIST meaning the object has been permanently deleted. ) i Factory Objects 4 Create objects on remote servers (Example: a customer at a bank needs to create an Account object when opening a new account. ) 4 ‘remote constructor’ 4 Factory design pattern 4 IDL definition: … Interface Account{ … }; Interface Account. Factory { Account create (in string name, in long initial. Balance); Account find (in string name); }; … CORBA Framework Eelements 8
Object References i Interoperable Object Reference 4 Structure of an IOR Repository. Id “ID: : : Foo: 1. 0” Profiles n profile 1 … Profile n h. Repository id identifies the type of object h. Number indicate the version of the ID interface, and usually is 1. 0 h. Each profile is specific to a particular transport protocol and contains complete details about the location of an object and how to open a connection to the object – Make the same object accessible via different protocol – Multiple profiles can be used as a way of implementing fault tolerance. CORBA Framework Eelements 9
Object References i IIOP Tag IIOP Version 0 1. 2 host port CORBA Framework Eelements object_key Optional components 10
CORBA Components i Client stub 4 Each stub represents (it is a proxy) an object operation (a possible request) which a client invokes in a language-dependent manner (e. g. , by calling a subroutine which represents the operation). 4 The stubs make calls on the rest of the ORB using interfaces that are private to Java. IDL. 4 Alternatively, a client may dynamically construct and invoke request objects which can represent any object operation. i Implementation Skeleton 4 Each skeleton provides the interface through which a method receives a request (dynamic and static skeletons) i Object Adapter 4 Purpose is to interface an object's implementation with its ORB 4 Each object adapter provides access to those services of an ORB (such as activation, deactivation, object creation, object reference management) used by a particular type of object implementation. i ORB Interface 4 The interface to the small set of ORB operations common to all objects, e. g. , the operation which returns an object's interface type. CORBA Framework Eelements 11
ORB and Object Interface i ORB Interface module CORBA { interface ORB {// PIDL string object_to_string(in Object obj); Object string_to_object(in string obj); Object resolve_initial_references(in Object. Id identifier); … …. }; interface Object { interface. Def get_interface(); boolean is_nil(); Object duplicate(); void release(); boolean is_a (in string logical_type_id); boolean non_existent(); boolean is_equivalent(in Object other_object) … }; ORB_init(); }; CORBA Framework Eelements 12
Duplicate() and release() Text book Chapter 2: figure 2. 8 – 2. 11 CORBA Framework Eelements 13
The Portable Object Adapter (POA) i. The POA defines standard interfaces to do the following: 4 Map an obj ref to a servant that implements that object 4 Allow transparent activation of objects 4 Associate policy information with objects 4 Make a CORBA object persistent over several server process lifetimes 4 POA interface is locality constrained interface (i. e. , references to the POA cannot be passed outside of a server’s address space). 4 Main functionality: dispatch incoming invocation requests to the correct servant 4 There can be multiple POAs active in a particular server 4 There is always a root POA from which all of the other POAs are created 4 Relative name to the parent POA CORBA Framework Eelements 14
The Portable Object Adapter (POA) i. Related concept 4 Servant 4 Object ID 4 Active Object Map 4 Incarnate 4 Etherealize 4 Default Servant IOR Location Details Object_Key Server details Host, port (for client to Locate the server process) Used by server POA name POA instance CORBA Framework Eelements Object. ID Not necessarily 1 -1 manages Servant Object 15
POA Architecture Text book: figure 2. 12 CORBA Framework Eelements 16
Object and Servant Lifetimes i. Servant object is associated with server process i. Incarnation: binding the servant object to CORBA object i. Etherealization: break the binding Text book: figure 2. 13 CORBA Framework Eelements 17
CORBA Components Object Implementation Client Dynamic Invocation Client Stubs ORB Interface Implementation Skeletons Object Adapter ORB Core standard interface Proprietary ORB interface One interface per object adaptor Normal call interface Up call interface One interface per object operation CORBA Framework Eelements 18
Client Side Clients perform requests using object references. Clients may issue requests through object interface stubs (static) or dynamic invocation interface. Client Dynamic Invocation Client Stubs ORB Interface CORBA Framework Eelements Clients may access general ORB services: • Interface Repository. • Context Management. • List Management. • Request Management. 19
Implementation Side Implementations receive requests through skeletons (without knowledge of invocation approach). Object Implementation ORB Interface Implementation Skeletons Object Adapter The Object Adapter provides for: • management of references; • method invocation; • authentication; • implementation registration; • activation/deactivation. CORBA Framework Eelements 20
Static v. Dynamic Invocation i Static Invocation 4 Static interfaces are generated in form of client stubs by the IDL (pre-) compiler. 4 This means that the structure of the object has to be known before hand (at compile time). 4 Allows for better type checking; less runtime overhead; self-documentation. i Dynamic Invocation 4 Dynamic Invocation Interface (DII) allows clients to invoke operations on remote objects without having access to object stubs (another way to do this without dynamic invocation is to download static client stubs via a Java applet). 4 Clients must discover interface-related information at runtime (e. g. , using the interface repository) 4 Servers can offer new services anytime without the need for recompilation on the client side. CORBA Framework Eelements 21
Dynamic Requests i The Dynamic Invocation Interface (DII) allows clients to dynamically: 4 4 4 discover objects; discover objects’ interfaces; create requests; invoke requests; receive responses. i Major features of Dynamic Invocation Interface: 4 requests appear as objects themselves; 4 requests are reusable; 4 invocation may be synchronous or asynchronous; 4 requests may be generated dynamically, statically or in combination approach. CORBA Framework Eelements 22
CORBA Interface Repository i The Interface Repository is a service that provides persistent objects that represent the IDL information in a form available at runtime. 4 Note: The Java. IDL runtime does not include an implementation of an Interface Repository and one is not generally required by clients at runtime. 4 Using the IR, it is possible for a program to encounter an object whose interface was not known at compile time, yet be able to determine what operations are valid on the object and make invocation on it. i Interface Repository provides: 4 Dynamic client access to interface definitions to construct a request. 4 Dynamic type-checking of request signatures. 4 Traversal of inheritance graphs. 4 ORB-to-ORB interoperability. CORBA Framework Eelements 23
CORBA Implementation Repository i The Implementation Repository contains information that allows the ORB to locate and activate implementations of objects. i Ordinarily, installation of implementations and control of policies related to the activation and execution of object implementations is done through operations on the Implementation Repository. i In addition to its role in the functioning of the ORB, the Implementation Repository is a common place to store additional information associated with implementations of ORB objects. (e. g. , debugging information, administrative control, resource allocation, security, etc) i The Implementation Repository supports the implementation of object servers. It is not needed by clients in order to access servers. CORBA Framework Eelements 24
Summary of CORBA Interfaces Implementation Installation IDL Interface Definitions Interface Repository Accesses Client Stubs Includes Client Implementation Skeletons Implementation Repository Includes Describes Object Implementation 4 All objects are defined in IDL by specifying their interfaces. 4 Object definitions (interfaces) are manifested as objects in the Interface Repository, as client stubs, and as implementation skeletons. 4 Descriptions of object implementations are maintained as objects in the Implementation Repository. CORBA Framework Eelements 25
Summary: CORBA Remote Method Invocation i Clients use “object interfaces” through language mapping 4 Java clients should work on any ORB that supports the Java language bindings. 4 Clients can call any object instance remotely, so long as the object instance implements the interface. i Clients can call remote objects statically or dynamically 4 The server cannot tell whether the client is using static or dynamic invocation. i Objects are identified using a unique id: Interoperable Object Reference (IOR) 4 CORBA normally passes objects by reference 4 IOR was Introduced in CORBA 2. 0 4 Object references can be converted to strings and back to “live” objects via ORB interface functions. CORBA Framework Eelements 26
- Slides: 26