Organizational%20Communications%20and%20Distributed%20Object%20Technologies - PowerPoint PPT Presentation

About This Presentation
Title:

Organizational%20Communications%20and%20Distributed%20Object%20Technologies

Description:

OMG Introduced the Object Request Broker (ORB) ... cancellations. 8. 95-702 OCT. Master of Information System Management. CORBA Services ... – PowerPoint PPT presentation

Number of Views:47
Avg rating:3.0/5.0

less

Transcript and Presenter's Notes

Title: Organizational%20Communications%20and%20Distributed%20Object%20Technologies


1
Organizational Communications and Distributed
Object Technologies
  • Lecture 11 CORBA

2
CORBA
  • Chapter 20 Coulouris text

3
Todays Topics
  • CORBA History and goals
  • CORBA RMI
  • CORBA services
  • The Distributed Whiteboard Revisited

4
CORBA History and Goals
  • Object Management Group Formed in 1989
  • Goals
  • -- OOP on distributed systems
  • -- heterogeneous hardware
  • -- heterogeneous OS
  • -- different programming
  • languages

5
History and Goals
  • OMG Introduced the Object Request Broker (ORB)
  • The role of the ORB is to help a client find an
    object, activate the object if necessary, and
    call a method on the object.
  • Common Object Request Broker Architecture (CORBA)
    agreed to by a group of companies in 1991
  • CORBA 2.0 specification released in 1996

6
History and Goals
  • CORBA 2.0 specification defined standards for
    different implementations of CORBA to communicate
    with one another
  • These standards are called the General Inter-ORB
    protocol (GIOP) and may run over various
    transports
  • GIOP over TCP/IP is called the Internet Inter-ORB
    Protocol

7
CORBA RMI
  • Main components
  • -- An Interface Definition language (IDL) that
    promotes
  • the use of different programming languages,
    stubs are
  • generated in the clients language and
    skeletons are
  • generated in the servers language
  • -- An architecture
  • -- GIOP defines an external data
    representation
  • (CDR) as well as message formats and
    message
  • types
  • -- Message types include request and reply as
  • well as location requests, errors, and
    request
  • cancellations

8
CORBA Services
  • A set of generic services that can be used
  • for distributed application
  • -- Naming Service (location by name)
  • -- Trading Service (location by attribute -
  • directory service)
  • -- Event Service
  • -- Security Service (authentication, ACLs,
    auditing, non-
  • repudiation)
  • -- Transaction Service (begin, commit,
    rollback a
  • series of RMI calls )
  • -- Persistent Object Service (POS)

9
The Distributed Whiteboard Example in CORBA
10
IDL interfaces Shape and ShapeList
struct Rectangle // no class in IDL 1 long
width long height long x long y
struct GraphicalObject 2 string type
Rectangle enclosing boolean isFilled
interface Shape 3 long getVersion()
GraphicalObject getAllState() // returns
state of the GraphicalObject
typedef sequence ltShape, 100gt All
// All is a 100 element
array 4 interface ShapeList 5 exception
FullException 6 Shape newShape(in
GraphicalObject g) raises (FullException) 7 All
allShapes() // returns sequence of remote
object references 8 long getVersion()
// parameters
are in, out, or both

// parameters may be primitive, struct or array
and
// are passed
by value
//
parameters whose type is an IDL interface

// is passed by remote
reference
11
idltojava
  • Run idltojava on the above interface
  • The command idlj is found in
  • j2sdk1.4.2\bin
  • The Java 2 Platform, Standard Edition, v1.4,
    provides an Object Request Broker (ORB) runtime
    component
  • The JDK documentation states that its Java ORB
    has not been tested with ORBs written in other
    languages
  • JDK 1.4 provides an Orb class with a pluggable
    architecture

12
From the JDK Doc
OMG specifies a mapping from IDL to several
different programming languages, including Java,
C, C, Lisp, Python, Smalltalk, COBOL, and Ada.
When mapped, each statement in OMG IDL is
translated to a corresponding statement in the
programming language of choice.
13
Java interface ShapeList generated by idltojava
from CORBA interface ShapeList
public interface ShapeList extends
org.omg.CORBA.Object Shape newShape(GraphicalOb
ject g) throws ShapeListPackage.FullException Sh
ape allShapes() int getVersion()
14
ShapeListServant class from CORBA interface
ShapeList
import org.omg.CORBA. class ShapeListServant
extends _ShapeListImplBase ORB
theOrb private Shape theList private int
version private static int n0 public
ShapeListServant(ORB orb) theOrb orb
// initialize the other instance
variables public Shape newShape(GraphicalObjec
t g) throws ShapeListPackage.FullException
1 version Shape s new
ShapeServant( g, version) if(n gt100)
throw new ShapeListPackage.FullException()
theListn s 2 theOrb.connect(s)
return s public
Shape allShapes() ... public int
getVersion() ...
15
Java class ShapeListServer
import org.omg.CosNaming. import
org.omg.CosNaming.NamingContextPackage. import
org.omg.CORBA. public class ShapeListServer
public static void main(String args)
try ORB orb ORB.init(args, null) 1

ShapeListServant shapeRef new
ShapeListServant(orb) 2 orb.connect(shape
Ref) 3
org.omg.CORBA.Object objRef
orb.resolve_initial_references("NameService")
4 NamingContext ncRef
NamingContextHelper.narrow(objRef) NameCompone
nt nc new NameComponent("ShapeList",
"") 5 NameComponent path
nc 6 ncRef.rebind(path, shapeRef)
7
java.lang.Object sync new
java.lang.Object() synchronized (sync)
sync.wait() catch (Exception e) ...
16
Java client program for CORBA interfaces Shape
and ShapeList
import org.omg.CosNaming. import
org.omg.CosNaming.NamingContextPackage. import
org.omg.CORBA. public class ShapeListClient pu
blic static void main(String args)
try ORB orb ORB.init(args, null)
1 org.omg.CORBA.Object objRef
orb.resolve_initial_references("NameService")
NamingContext ncRef NamingContextHelper.nar
row(objRef) NameComponent nc new
NameComponent("ShapeList", "") NameComponent
path nc ShapeList shapeListRef
ShapeListHelper.narrow(ncRef.resolve(path))
2 Shape sList shapeListRef.allShapes() 3
GraphicalObject g sList0.getAllState() 4
catch(org.omg.CORBA.SystemException e) ...

17
The main components of the CORBA architecture
18
Naming graph in CORBA Naming Service
initial naming context
initial naming context
initial naming context
XX
B
ShapeList
V
P
C
T
D
E
S
R
Q
U
Write a Comment
User Comments (0)
About PowerShow.com