Title: CS556: Distributed Systems
1CS-556 Distributed Systems
CORBA MOM
- Manolis Marazakis
- maraz_at_csd.uoc.gr
2Middleware styles
- Distributed objects
- Object Request Broker (ORB) services
- OMG CORBA, MS DCOM
- Messaging
- Message brokers channels
- Queues for loosely coupled communication
- IBM MQSeries, TIBCO Rendezvous
3References
- OMG CORBA
- http//www.omg.org
- IBM MQSeries
- http//www.software.ibm.com/ts/mqseries/
- TIBCO Rendezvous
- http//www.tibco.com/products/rv/index.html
4CORBA - Integration Technology
- Common Request Broker Architecture
- Integration technology
- Object Request Broker (object bus)
- IDL Interface Definition Language
- ISO 14750
- GIOP General Inter-ORB Protocol
- IIOP Internet Inter-ORB Protocol
- CORBAservices, CORBAfacilities, Domain Interfaces
5CORBA Essentials
6OMG (I)
- Object Management Group
- industrial consortium, founded in 1989
- issues detailed object management specifications
- aims to establish industry guidelines
- common framework for app. development
- Goal
- OS- language-independent distributed software
- Challenges
- heterogeneous platforms
- multiple programming languages
- legacy systems
7OMG (II)
- Rationale
- Conformance to specifications will make it
possible to develop a heterogeneous computing
environment across all major hardware platforms
and operating systems - Develop an integration technology
- glue to bind together disparate programming
technologies
8OMA (I)
- Object Management Architecture
- reference model for a distributed environment
- Objects, operations, types, subtyping
- Common semantics for the specifying the
externally visible characteristics of objects - 3 perspectives
- Application
- solution-specific components / closest to
end-user - Systems
- infrastructure aspects of distributed object
computing management - Vertical Market
- application frameworks for a variety of industries
9OMA (II)
- Segments of the OMA reference model
- Application
- interfaces, common facilities
- Systems
- ORB, Object Services
- Vertical Markets
- Domain Interfaces
10OMA Outline
11CORBA (I)
- Object Request Broker
- allows apps to communicate with one another, no
matter where they reside on the network - Interface Definition Language
- describes operations their parameters,
precisely unambiguously - The code that manages encoding, passing, and
decoding parameters is automatically generated - Interfaces enforce type safety
- GIOP abstract interoperability protocol
- CDR Common Data Representation
- data formatting rules for IDL types
- Support for ORB semantics
12CORBA (II)
13IDL constructed types (I)
14IDL constructed types (II)
15CORBA Features (I)
- Client IDL stub / Server IDL skeleton
- local proxy for a (remote) server-side object
- From the clients perspective, the invocation of
a method on a stub is a local procedure call - marshalling
- automatically generated by IDL compiler
- language-to-IDL binding rules
- Dynamic Invocation Interface (DII)
- support for looking up metadata that describe
server interfaces, constructing request messages,
and issuing requests - useful for applications that support run-time
discovery of available services
16CORBA Features (II)
- Interface Repository
- machine-readable metadata describing object
interfaces, generated from IDL specification - Dynamic Skeleton Interface (DSI)
- support for servers that need to handle incoming
requests without access to IDL-based compiled
skeletons - useful for implementing bridges'' between
protocols and scripting tools - ORB Interface
- facilities supporting DII, DSI and object
reference management
17CORBA Features (III)
- Object Adapter
- accepts incoming requests on behalf on
server-instantiated objects - run-time environment for instantiating server
objects, passing requests to them, assigning them
object references - Each ORB must support at least the
- Basic Object Adapter (BOA)
- to be replaced by the Portable Object Adapter
(POA) - Implementation Repository
- administrative information about objects that may
be invoked by object adapters - information about instantiated objects
18Interoperable Object Reference (IOR)
IIOP Profile
GIOP TCP/IP IIOP
19Using IORs
import org.omg.CORBA. ..........................
......... try org.omg.CORBA.Object
srv_ior ... MySrv srvRef
MySrvHelper.narrow(srv_ior) String s
srvRef.srv_method_1(arg1, arg2)
catch(Exception e) System.err.println("Exc
eption raised by invocation of srv_method_1() "
e) e.printStackTrace(System.err)
- How to obtain IORs ?
- From persistent storage
- From Naming service
- From Trader service
20CORBA Development Cycle (I)
- Development of interfaces in IDL
- independent of the programming language
Generation of stubs skeletons for the selected
language
module BenchmarkModule interface PingPong
....................
PingPong.java PingPongHelper.java PingPongHolder.j
ava _PingPongImplBase.java _PingPongStub.java
idltojava
21CORBA Development Cycle (II)
- Development of implementations, using the
selected languages - independently for the client- server-side
Server-side
import BenchmarkModule. public class PingPong
extends BenchmarkModule._PingPongImplBase
PingPong svc new PingPongImpl(...) //
export object reference - eg register in naming
service // block current thread, waiting for
incoming calls
import BenchmarkModule. public class
PingPongClient svcObj ... // obtain object
reference for server instance
BenchmarkModule.PingPong svc
BenchmarkModule.PingPongHelper.narrow(svcObj)
ItemHolder itH new ItemHolder() svc.ping(it,
itH) System.err.println("ping in" it "
--gt out " itH.value)
Client-side
22CORBA services
- System-level services that augment the ORB's
functionality - IDL-defined interfaces
- accessible via ORB methods
- resolve_initial_references()
- list_initial_references()
- Wide range of functionality
- naming, events, transactions, security, time,
properties - collections, properties, query, trader,
concurrency control, relationships - life cycle, persistence, licensing
23CORBA facilities
- Collections of IDL-defined frameworks that
provide services of direct use to applications - Horizontal
- workflow, firewall, internationalization,
business object framework
(BOF) - Vertical domain-specific frameworks
- telecommunications, medical care, manufacturing,
finance, commerce - Well-defined interfaces and dependencies to
support collaboration bet. business components - A view of software that transcends tools,
applications, databases, and other system
components
24OMG Naming Service (I)
- Tree-like directory for object references
- name binding object reference-name pair
- naming context a name binding that contains a
set of name bindings - Example usage (for JavaIDL)
- tnameserv -ORBInitialPort 1234
- import org.omg.CORBA.
- import org.omg.CosNaming.
25OMG Naming Service (II)
- ORB orb org.omg.CORBA.ORB.init()
- NamingContext initial_ctx NamingContextHelper.na
rrow( - orb.resolve_initial_references("NameService"))
- NameComponent nc1 new NameComponent("myName",
"myKind") - NameComponent name1 nc1
- ctx.rebind(name1, objref)
- NameComponent nc2 new NameComponent("Personal",
"directory") - NameComponent name2 nc2
- NamingContext ctx2 ctx.bind_new_context(name2)
- .........................................
- NameComponent nc new NameComponent("myName",
"myKind") - NameComponent path nc
- MyInterfaceType ref MyInterfaceTypeHelper.narrow
(ncRef.resolve(path))
26DII (I)
- org.omg.CORBA.Request
- name of the operation to be invoked
- NVList containing NamedValue arguments
- argument name
- argument value, of type org.omg.CORBA.Any
- argument mode flag
- ARG_IN.value, ARG_OUT.value, ARG_INOUT.value
- 0 for Context property
- Context list of NamedValue properties
- Info. about client, environment, or
circumstances of a request - org.omg.CORBA.Context ctx orb.get\_default\_cont
ext()
27DII (II)
- invoke() method for synchronous invocation
- send_deferred() for asynchronous invocation
- get_response(), poll_response() methods for
accessing response to deferred invocation - result() method to retrieve NamedValue result
- send_oneway() method for one-way'' requests
- (no response expected usually
implemented as UDP datagrams) -
- A Request can be created from an object
reference - Request r objRef._create_request(ctx, op,
argList, result)
28Naming graph
29CORBA Naming Service - IDL
struct NameComponent string id string kind
typedef sequence ltNameComponentgt
Name interface NamingContext void bind (in
Name n, in Object obj) binds the given name
and remote object reference in my context. void
unbind (in Name n) removes an existing binding
with the given name. void bind_new_context(in
Name n) creates a new naming context and binds
it to a given name in my context. Object resolve
(in Name n) looks up the name in my context and
returns its remote object reference. void list
(in unsigned long how_many, out BindingList bl,
out BindingIterator bi) returns the names in the
bindings in my context.
30Message-Passing Interface (MPI)
31Message-Queuing Model (1)
32Message-Queuing Model (2)
33Architecture of a Message-Queuing System (I)
34Architecture of a Message-Queuing System (II)
35Message Brokers
36IBM MQSeries (I)
37IBM MQSeries (II)
38MQSeries Programming (I)
- Connect to a queue manager
- obtain connection handle
- Only one connection handle is valid at a time
- Open queue
- obtain queue object handle
- for GET and/or PUT operations
- Generate messages
- message type tag, destination spec., data
- message descriptor added by MQSeries
39MQSeries Programming (II)
- Transactional integrity
- Operations on messages can be grouped into units
of work - A unit of work is either committed in its
entirety, or backed-out, so that its as if none
of the operations took place - Coordinate units of messaging work with other
transactional work (eg DBMS updates) - Relies on external transaction processing monitor
- Ensure that message data and database data remain
completely in-sync at all times
40MQSeries Programming (III)
- Channel security
- MQSeries supports exit points into which to link
security modules. - When two queue managers initiate communications ,
each can verify the identity of the other - During message transmission, data can be
encrypted - Applications can identify themselves
- both by platform and application, and by user ID
- This information is propagated with the message
- Only privileged applications can change it.
41MQSeries Programming (IV)
- Triggering
- automatic notification when a condition is met
- message to an initiation queue
- processed by trigger monitor
- A single trigger monitor can initiate many app.
Processes to handle messages arriving on
different queues - asynchronous processing
- Applications are idle for periods of time when
there are no messages to process.
42Channels
43Message Transfer
44The MQI API