CORBA - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

CORBA

Description:

creating, activating & de-activating objects, generating and managing object ... e.g. Support for activating and freeing objects after use. Transaction Services ... – PowerPoint PPT presentation

Number of Views:104
Avg rating:3.0/5.0
Slides: 30
Provided by: chris520
Category:
Tags: corba | activating

less

Transcript and Presenter's Notes

Title: CORBA


1
CORBA
  • Revision of
  • Remote Method Invocation
  • Interfaces
  • If you understand this, you will be able to
  • Explain the purpose of CORBA
  • Explain how remote objects are found and used
  • Compare CORBA and RMI
  • What is an ORB?
  • What does resolve mean?

2
Key Terms
  • Heterogeneous peer-to-peer computing
  • Interface Definition Language (IDL)
  • Naming Service
  • Common Facilities

3
The Problem
  • Allowing interaction between components
  • Different manufacturers
  • Different languages (language transparency)
  • Distributed computing
  • (client-server/peer to peer)
  • Location (location transparency)
  • Communicating information

4
The Solution
  • Put an intermediary between the objects
  • Hide location of objects from client

Caller
Caller
Interconnection Network
Stub
Skeleton
Callee
Callee
5
CORBA
  • Common Object Request Broker Architecture
  • Standardised
  • Object Management Group
  • Collection of companies HP, DEC, SUN, ... (400)
  • Manages the CORBA standards

6
Essence of CORBA
  • An object can be
  • Created in an application on one machine
  • Used by another application
  • Written in a different language
  • On a different machine
  • With a completely different architecture
  • CORBA architecture defines interfaces.
  • Implementation left to manufacturers

7
CORBA
  • A framework and specification for object
    collaboration and sharing across a heterogeneous
    (what?) distributed network of machines and
    applications.
  • What does CORBA do?
  • Hides communication complexities
  • Allow interaction between different languages
  • Provides commonly useful services

8
CORBA Concepts
  • Objects
  • any entity in the system
  • e.g. document, folder, application, window
    manager
  • OID
  • a unique identifier, constant during the objects
    life
  • Operations
  • methods or services that an object provides
  • Operation Semantics
  • operation behaviour under errors
  • At most once
  • Best Effort

9
CORBA Concepts
  • Type (class)
  • an object is an instance of a type
  • Interface
  • a description of what an object provides,
  • not how it should be implemented.
  • Object Request Broker
  • manages links between objects.
  • Common Facilities
  • Support for data presentation, retrieval and
    storage
  • Object Services
  • extend the capabilities of an ORB

10
Object Request Brokers
  • Purpose
  • Allows objects to call methods of any other
    CORBA-compliant object without knowing how it is
    implemented.
  • A request is similar to
  • A SOAP request
  • RMI marshalling of a method call

11
A Request
  • An request contains
  • Target object
  • Method
  • Parameters
  • Request context

12
Types of ORB
  • Client- or server-resident
  • ORB implemented as libraries (routines) resident
    in the clients and the implementations (the
    servers)
  • Server-based
  • ORB is implemented as a server (separate process)
    that manages requests between client and
    implementation processes
  • System-based
  • ORB is part of the operating system.

13
CORBA Components
14
CORBA Components
  • Object Adapter
  • Provides services for managing objects
  • creating, activating de-activating objects,
  • generating and managing object references,
  • routing requests to appropriate server methods,
  • broadcasting the presence of object servers.
  • Dynamic Invocation
  • Construct and use a request at run-time.
  • ORB Interface
  • The set of ORB operations common to all objects
    (e.g. returning an object's interface type).

15
Interface Definition Language
  • Allows an object to publish its interface
  • telling ORB clients how to obtain its services
  • Language-independent specification language
  • Looks like C/Java declarations.
  • modules,
  • constants, exceptions,
  • interfaces, methods, properties
  • Mappings provided for many compilers
  • i.e. translate IDL into C or Java
  • Used to generate stubs, skeletons
  • Supports static and dynamic requests.

16
CORBA Example
  • Using the application

The server publishes a CORBA object with an
addText Method
The client gets the remote object on
Connect Calls its addText method on Send
17
CORBA Example
  • The Interface
  • module corbachatOps
  • interface ICorbaChatOne
  • void addText( in string s )
  • Written in IDL
  • What is an in parameter?
  • What is a module?
  • What is the equivalent in Java?

18
Remote Object (receiver)
  • class CChatImpl extends _ICChatImplBase
  • // _ICChatImplBase generated from the IDL
  • public CChatImpl()
  • //Display the frame, etc.
  •  
  • public void addText (String s)
  • frame.displayText(s)

19
The Server 1
  • public class ChatOneServer
  • public static void main(String args)
  • try
  • ORB orb ORB.init(args, null) 
  • // register the CORBA component
  • CChatOpsImpl corbaComp new
    CChatOpsImpl()
  • orb.connect( corbaComp )
  • // set up the naming service
  • org.omg.CORBA.Object objRef
  • orb.resolve_initial_references("NameSe
    rvice")
  • // checked cast to make sure objRef is of
    right type
  • NamingContext ncRef NamingContextHelper.n
    arrow(objRef)

20
The Server 2
  •   // Bind the object reference in the
    naming service
  • NameComponent cc new NameComponent(
    "CChat", "" )
  • NameComponent path cc
  • ncRef.rebind( path, corbaComp )
  •  
  • // wait for clients
  • java.lang.Object lock new
    java.lang.Object()
  • synchronized( lock )
  • lock.wait() // wait for a
    notify which will mark end
  • catch( Exception e ) System.err.println(
    e )

21
Client 1 getting an ORB
  • ORB orb
  •  
  • public SenderFrame(String args)
  • ltsnipgt
  • try
  • // initialize the ORB using a static
    factory method
  • orb ORB.init( args, null )
  • jbInit() // Set up user interface
  • ltsnipgt

22
 Client 2 Connecting
  • void connectBtn_actionPerformed(ActionEvent e)
  • try
  • ltsnipgt
  • // get the root naming context
  • org.omg.CORBA.Object objRef
  • orb.resolve_initial_references(
    "NameService" )
  • // What is this doing?
  • NamingContext ncRef
  • NamingContextHelper.narrow( objRef )
  •  

23
Client 3 Getting the object
  • // resolve name in the naming context
  • NameComponent nc new NameComponent(
    "CChat", "" )
  • NameComponent path nc
  • org.omg.CORBA.Object obj
    ncRef.resolve(path)
  •  
  • // Cast the object to the correct type, with
    checking
  • comp ICChatHelper.narrow(obj)
  •  
  • if (comp ! null)
  • status.setText("Connected")
  • else
  • status.setText("")
  • catch(Exception ex) ltsnip handle errorgt

24
 Client 4 Using the Object
  • void sendBtn_actionPerformed(ActionEvent e)
  • if (comp ! null)
  • comp.addText(jTextArea1.getText())
  • else
  • status.setText("")

25
Services 1
  • Object Services
  • Services to extend the capabilities of an ORB
  • Event Notification Services
  • Permit objects to register and deliver events
  • Persistence Services
  • Support for storing objects in different ways
  • e.g. relational databases
  • Life-Cycle Management Services
  • e.g. Support for activating and freeing objects
    after use
  • Transaction Services
  • Provide a two-phase commit protocol
  • Nested transactions are supported

26
Services 2
  • Concurrency Control Services
  • Provide lock management for transactions or
    threads
  • Relationships Services
  • Provide general services for creating and
    managing links between objects
  • e.g. to manage referential integrity constraints
  • Externalisation Services
  • Provide an object stream interface to transfer
    data into and out of an object
  • Other services
  • e.g. security, time and licensing

27
Common Facilities
  • General - purpose components
  • Dealing with
  • presentation of data
  • retrieval and storage of information.

28
Common Facilities
  • Horizontal
  • Services across a layer of the 'virtual machine'
  • Common to range of application areas
  • e.g. mobile agents, printing, internationalisation
  • Vertical
  • Services concerned with a specific application,
    potentially at different levels
  • e.g. health, financial, legal, manufacturing,e-com
    merce

29
Summary
  • CORBA is like RMI in purpose operation
  • Interfaces
  • Automatically generate Stubs
  • CORBA can be used with any language
  • Define interfaces in IDL
  • Language mapping generates interfaces stubs
  • CORBA provides a wider range of services
Write a Comment
User Comments (0)
About PowerShow.com