SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Distributed Object Programming course 2003
CORBA
Common
Object Request Broker
Architecture
Distributed Object Programming course 2003
What is CORBA?
●
Specifications, not products
●
Vision is portability (between vendors)
– Rely on supporting OS/platform?
– Standards do not cover all needs (extensions)
– Standards and products evolve at different
rates
●
Not all vendors support every option
●
http://www.omg.org
Distributed Object Programming course 2003
Versions
●
CORBA – simple remote object model
●
CORBA 2 – interoperability, common
server programming model, transactions, 

●
CORBA 2.2, 2.3, 

●
CORBA 3 – load balancing, components, 

Distributed Object Programming course 2003
Model
●
Focus is on objects
– Create remote objects and call their methods
●
Used like local objects
●
Contain state like normal objects
●
Creation mechanism is different
●
Uses ‘stubs’ and ‘skeletons’
– Multi-language
●
Bindings for C, C++, Java, Ada, 

●
Available methods defined through IDL
Distributed Object Programming course 2003
Model (2)
●
Remote stateful objects
– Real objects, possibly shared and persistent
●
Rich API set
– Programmers directly control security,
transactions, finding object/servers by calling
methods
●
Quite far from stateless components
– External state, container properties
Distributed Object Programming course 2003
Model (3)
One standardised interface
One interface per object operation
ORB-dependent interface
One interface per object adapter
DynamicDynamic
InvocationInvocation
Client
Stubs
ORB
InterfaceInterface
Implementation
Skeletons
Client Object Implementation
ORB Core
Object
Adapter
Distributed Object Programming course 2003
Interface and Services
●
Interface repository
●
Implementation repository
●
Services:
– Collection
– Query
– Concurrency control
– Transactions
Distributed Object Programming course 2003
More Services
●
Services
– Event
– Notification
– Externalization
– Life cycle
– Licensing
– Naming
●
Finding servers and load balancing
Distributed Object Programming course 2003
Services (3)
●
Services:
– Property
– Trading
– Persistence
– Relationship
– Security
●
Common to use SSL for lightweight authentication
and encryption
●
CORBA standard security service
– Time
Distributed Object Programming course 2003
Communications
●
Object invocations
– Synchronous
– One way
– Deferred synchronous
●
Events
– Consumer and Supplier
– Push model vs Pull model
Distributed Object Programming course 2003
CORBA Processes
●
Clients
– Simple to program
– IDL compiler creates a proxy implementation
– Interceptors: intercept request between
client and server.
– Request level – between client and proxy
– Message level – between ORB and network
Distributed Object Programming course 2003
Interceptors
Client application
Client
proxy
Client ORB
Local OS
Request Level
Interceptors
Message Level
Interceptors
Invocation
request
Distributed Object Programming course 2003
Portable Object Adapter
●
Provides a consistent image of the object
●
(also called wrapper)
●
Makes server side code appears as CORBA
objects
●
Use a “servant” - implement client
methods
●
Maps object Ids (references) to servants.
Distributed Object Programming course 2003
Naming
●
How do you find object or servers?
– Using a name server
– Directory of available objects
●
Server processes call name server when
they come up
– Advertising their services/objects
●
How do you find the name server?
– Call resolve_initial_references
– And local ORB ‘knows’ location of NS
Distributed Object Programming course 2003
Naming (2)
●
Clients call name server to find the
location of a factory/object/server
– Up to the name server to match clients to
servers/objects
– Returns object reference (IOR?)
●
Includes location of server
●
Client calls server process (via ORB) to
access or create objects
Distributed Object Programming course 2003
Scaling
●
NS can support load balancing
– Multiple servers/processors register the
same service/object (object groups)
– Name server spreads out requests across
available objects
– Proprietary until CORBA 3
●
Extends IOR to IOGR.
Distributed Object Programming course 2003
Where is the IDL?
Client object
IDL stub (obj)
ORB
Network
services
Server object
IDL skel (obj)
ORB/POA
Network
services
Request
Request data
IIOP protocol
Distributed Object Programming course 2003
IDL Language
It’s a declarative language to define client object/server object
interface. It’s somehow a simplified object definition; no
implementation is defined. An example

module Bank {
struct Customer {
string name;
string address;
string id;
}
interface Account {
void debit( in unsigned long ammount );
void withdraw( in unsigned long ammount );
long balance();
}
interface AccountMgr {
Account getAccountByCustomer( Customer c );
}
}
Distributed Object Programming course 2003
Example
module Bank {
struct Customer {
string name;
string address;
string id;
}
interface Account {
void debit( in unsigned long ammount );
void withdraw( in unsigned long ammount );
long balance();
}
interface AccountMgr {
Account getAccountByCustomer( Customer c );
}
}
Core concept: 2 kinds of programming types:
Objects (interfaces) and non-objects (types)
Interfaces
Types
Distributed Object Programming course 2003
Language (2)
‱ Operations in interfaces define callable methods.
Operations can have parameters, but not
implementation
‱ Each parameter definition must say if it is an in ,
out or inout parameter and has a type and name
‱ There are also support for: exception handling,
sequence templates, arrays; inheritance; abstract
interfaces and so on
Distributed Object Programming course 2003
Language (3)
‱ Basic types: long, short, unsigned long, unsigned
short, float, double, boolean, octet (fits anything, as
sequence), any (really anything)
‱ Constructed types: There are constructed types: struct,
union, enumeration type.
‱ The any type.
Struct <identifier> { <declaration>; 
 }
union <identifier> switch (<switch-type>) {
case <constant>: <declaration>;


}
enum <identifier> { <identifier>, 
 }
Distributed Object Programming course 2003
IDL Mapping
‱ They must define the means of expressing in the language all
CORBA IDL constructs.
‱ A complete language mapping will allow a programmer to
have access to all ORB functionality in a way that is
convenient for the particular programming language.
‱ To support source portability, all ORB implementations
must support the same mapping for a particular language
(mapping specification).
Distributed Object Programming course 2003
IDL Mapping
Objects specification in IDL
Client code Server code
compiler
ïź Ada, C, C++, COBOL, Smalltalk, and Java, Lisp,
CORBA scripting language
ïź Java to IDL
Distributed Object Programming course 2003
IDL Mapping
interface myObj {
long op1 (in long arg1 );
}
typedef CORBA_Object myObj;
extern CORBA_long myObj_op1(
example1 o,
CORBA_long arg1,
CORBA_Environment *ev
);
class myObjOperations extends
org.omg.CORBA.IDLEntity {
void op1( 
 );

};
class myObj extends MyObjOperations { 
 }


class myObj : virtual public
CORBA::Object { 

public: 

virtual void op1( 
 );
}
C
Java
C++
Distributed Object Programming course 2003
IDL Mapping
public interface myInt {
...
}
abstract interface myInt {
... }
package M;module M { ... }
public interface myObjOperations {
... }
public interface myObj extends myObjOperations ... {
}
interface myObj { ... }
JavaCORBA
Distributed Object Programming course 2003
IDL Mapping
Op1 correspond to method op1 in object interface.
in parameters are passed by value.
out and inout parameters are passed through
holder classes. For inout parameters, client must
initialise the holder class with a value before calling
the method.
As interfaces are mapped to java interfaces,
method and object’s signatures are maintained.
operations and parameter
passing:
op1(in Ob1 x,
out Ob2 y,
inout Ob3 z)
JavaCORBA
Distributed Object Programming course 2003
IDL Mapping
IDL TYPE JAVA TYPE EXCEPTIONS
boolean boolean
Char char CORBA::DATA_CONVERSION
wchar char CORBA::DATA_CONVERSION
octec byte
String Java.lang.String CORBA::MARSHAL
CORBA::DATA_CONVERSION
wstring Java.lang.String CORBA::MARSHAL
CORBA::DATA_CONVERSION
short short
Unsigned short short
Long int
Unsigned long int
Long long long
Unsigned long long long
float float
double double
fixed Java.math.BidDecimal CORBA::DATA_CONVERSION
Distributed Object Programming course 2003
IDL Mapping
see specificationunion, sequence, arrays,
constants, etc.
final public class myStruct ... IDLEntity {
public int field1;
public String field2;
public myStruct() { } // empty!
public myStruct(int f1, String f2) { ... }
}
struct myStruct {
long field1;
string field2;
}
JavaCORBA
Distributed Object Programming course 2003
IDL Example
module Bank {
struct StructType{
long initbalance;
string acctname;
};
interface Account {
float balance();
string getCalendar();
};
interface AccountManager {
Account open(in StructType st);
};
};
Distributed Object Programming course 2003
IDL Example
●
AccountManagerStub.java--Stub code for the AccountManager object on the
client side.
●
AccountStub.java--Stub code for the Account object on the client side.
●
ccount.java--The Account interface declaration.
●
AccountHelper.java--Declares the AccountHelper class, which defines helpful
utility methods.
●
AccountHolder.java--Declares the AccountHolder class, which provides a
holder for passing Account objects.
●
AccountManager.java--The AccountManager interface declaration.
●
AccountManagerHelper.java--Declares the AccountManagerHelper class,
which defines helpful utility methods.
●
AccountManagerHolder.java--Declares the AccountManagerHolder class,
which provides a holder for passing AccountManager objects.
Distributed Object Programming course 2003
IDL Example
●
AccountManagerOperation.java--This interface provides declares the method
signatures defined in the AccountManager interface in the Bank.idl file.
●
AccountManagerPOA.java--POA servant code (implementation base code) for the
AccountManager object implementation on the server side.
●
AccountManagerPOATie.java--Class used to implement the AccountManager
object on the server side using the tie mechanism,
●
AccountOperations.java--This interface provides declares the method signatures
defined in the Account interface in the Bank.idl file
●
AccountPOA.java--POA servant code (implementation base code) for the Account
object implementation on the server side.
●
AccountPOATie.java--Class used to implement the Account object on the server
side using the tie mechanism
●
StructType.java--Declares the StrucType class, which is used both by Client and
Server classes.
Distributed Object Programming course 2003
IDL Example
●
StructTypeHelper.java--Declares the StructTypeHelper class, which defines
helpful utitly methods.
●
StructTypeHolder.java--Declares the StructTypeHolder class, which provides a
holder for passing StructType objects.
Distributed Object Programming course 2003
Server Example
●
Steps for server setup
– Initialize ORB
– Create and setup POA
– Activate the POA Manager
– Activate objects
– Wait for client requests
Distributed Object Programming course 2003
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
// get a reference to the root POA
POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
// Create policies for our persistent POA
org.omg.CORBA.Policy[] policies = {
rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT)
};
// Create myPOA with the right policies
POA myPOA = rootPOA.create_POA( "bank_agent_poa", rootPOA.the_POAManager(),
policies );
// Create the servant
AccountManagerImpl managerServant = new AccountManagerImpl();
Distributed Object Programming course 2003
Code Example (cont)
// Decide on the ID for the servant
byte[] managerId = "BankManager".getBytes();
// Activate the servant with the ID on myPOA
myPOA.activate_object_with_id(managerId, managerServant);
// Activate the POA manager
rootPOA.the_POAManager().activate();
System.out.println(myPOA.servant_to_reference(managerServant) +
" is ready.");
// Wait for incoming requests
orb.run();
Distributed Object Programming course 2003
Client Example
●
Steps for client setup
– Initialize ORB
– Locate Server using location service (smart
agent)
– Obtains the balance of the Account using the
object reference returned by bind().
Distributed Object Programming course 2003
Client Example
Org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
// Get the manager Id
byte[] managerId = "BankManager".getBytes();
// Locate an account manager. Give the full POA name and
// the servant ID.
Bank.AccountManager manager = Bank.AccountManagerHelper.bind(orb,
"/bank_agent_poa", managerId);
// use args[0] as the account name, or a default.
// String name = args.length > 0 ? args[0] :
// "default account";
String name=args[0];
Integer initbalance=new Integer(args[1]);
Distributed Object Programming course 2003
Client Example (cont)
Bank.StructType stname= new Bank.StructType(initbalance.intValue(),name);
// Request the account manager to open a named account.
System.out.println(stname);
Bank.Account account = manager.open(stname);
// Get the balance of the account.
float balance = account.balance();
String strtime= account.getCalendar();
// Print out the balance.
System.out.println ("The balance in " + name +
"'s account is $" + balance +
"and time is "+ strtime);

Weitere Àhnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Corba
CorbaCorba
Corba
 
Chapter10
Chapter10Chapter10
Chapter10
 
Unit iv
Unit ivUnit iv
Unit iv
 
CORBA - Introduction and Details
CORBA - Introduction and DetailsCORBA - Introduction and Details
CORBA - Introduction and Details
 
Common Object Request Broker Architecture
Common Object Request Broker ArchitectureCommon Object Request Broker Architecture
Common Object Request Broker Architecture
 
Corba in power system
Corba in power systemCorba in power system
Corba in power system
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Corba by Example
Corba by ExampleCorba by Example
Corba by Example
 
CORBA & RMI in java
CORBA & RMI in javaCORBA & RMI in java
CORBA & RMI in java
 
Corba
CorbaCorba
Corba
 
C O R B A Unit 4
C O R B A    Unit 4C O R B A    Unit 4
C O R B A Unit 4
 
Corba
CorbaCorba
Corba
 
19.cobra
19.cobra19.cobra
19.cobra
 
Rmi, corba and java beans
Rmi, corba and java beansRmi, corba and java beans
Rmi, corba and java beans
 
CORBA
CORBACORBA
CORBA
 
Corba
CorbaCorba
Corba
 
RMI and CORBA Why both are valuable tools
RMI and CORBA Why both are valuable toolsRMI and CORBA Why both are valuable tools
RMI and CORBA Why both are valuable tools
 
CORBA
CORBACORBA
CORBA
 
CORBA Component Model
CORBA Component Model CORBA Component Model
CORBA Component Model
 
82159587 case-study-on-corba
82159587 case-study-on-corba82159587 case-study-on-corba
82159587 case-study-on-corba
 

Andere mochten auch

Component based software development
Component based software developmentComponent based software development
Component based software developmentEmmanuel Fuchs
 
Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11koolkampus
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed applicationRishikese MR
 
Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server Architecturesuks_87
 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)udamale
 

Andere mochten auch (6)

Ch12
Ch12Ch12
Ch12
 
Component based software development
Component based software developmentComponent based software development
Component based software development
 
Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
 
Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server Architecture
 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)
 

Ähnlich wie Lecture4 corba

85305524 i-t-case-study
85305524 i-t-case-study85305524 i-t-case-study
85305524 i-t-case-studyhomeworkping3
 
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxAasimAbdul
 
Ch-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptxCh-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptxdagilema
 
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connectionMohammedAkramMohiudd
 
Distributing computing.pptx
Distributing computing.pptxDistributing computing.pptx
Distributing computing.pptxKaviya452563
 
corbaintroductionandexample-140703005744-phpapp02.pdf
corbaintroductionandexample-140703005744-phpapp02.pdfcorbaintroductionandexample-140703005744-phpapp02.pdf
corbaintroductionandexample-140703005744-phpapp02.pdfBesAli1
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECHmuthahar.sk
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptxVijalJain3
 
02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipelineGirish Ghate
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdprat0ham
 
Oslo.versioned objects - Deep Dive
Oslo.versioned objects - Deep DiveOslo.versioned objects - Deep Dive
Oslo.versioned objects - Deep Divedavanum
 
internet
internetinternet
internetjocker0080
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript Corley S.r.l.
 
core_java.ppt
core_java.pptcore_java.ppt
core_java.pptYashikaDave
 

Ähnlich wie Lecture4 corba (20)

85305524 i-t-case-study
85305524 i-t-case-study85305524 i-t-case-study
85305524 i-t-case-study
 
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptx
 
Ch-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptxCh-4 Middleware Architectures.pptx
Ch-4 Middleware Architectures.pptx
 
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connection
 
009693652.pdf
009693652.pdf009693652.pdf
009693652.pdf
 
CORBA.ppt
CORBA.pptCORBA.ppt
CORBA.ppt
 
Distributing computing.pptx
Distributing computing.pptxDistributing computing.pptx
Distributing computing.pptx
 
corbaintroductionandexample-140703005744-phpapp02.pdf
corbaintroductionandexample-140703005744-phpapp02.pdfcorbaintroductionandexample-140703005744-phpapp02.pdf
corbaintroductionandexample-140703005744-phpapp02.pdf
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECH
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipeline
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
 
Oslo.versioned objects - Deep Dive
Oslo.versioned objects - Deep DiveOslo.versioned objects - Deep Dive
Oslo.versioned objects - Deep Dive
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
 
internet
internetinternet
internet
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
005281271.pdf
005281271.pdf005281271.pdf
005281271.pdf
 
core_java.ppt
core_java.pptcore_java.ppt
core_java.ppt
 

KĂŒrzlich hochgeladen

call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...Nguyen Thanh Tu Collection
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

KĂŒrzlich hochgeladen (20)

call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Kamla Market (DELHI) 🔝 >àŒ’9953330565🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
HỌC TỐT TIáșŸNG ANH 11 THEO CHÆŻÆ NG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIáșŸT - Cáșą NĂ...
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

Lecture4 corba

  • 1. Distributed Object Programming course 2003 CORBA Common Object Request Broker Architecture
  • 2. Distributed Object Programming course 2003 What is CORBA? ● Specifications, not products ● Vision is portability (between vendors) – Rely on supporting OS/platform? – Standards do not cover all needs (extensions) – Standards and products evolve at different rates ● Not all vendors support every option ● http://www.omg.org
  • 3. Distributed Object Programming course 2003 Versions ● CORBA – simple remote object model ● CORBA 2 – interoperability, common server programming model, transactions, 
 ● CORBA 2.2, 2.3, 
 ● CORBA 3 – load balancing, components, 

  • 4. Distributed Object Programming course 2003 Model ● Focus is on objects – Create remote objects and call their methods ● Used like local objects ● Contain state like normal objects ● Creation mechanism is different ● Uses ‘stubs’ and ‘skeletons’ – Multi-language ● Bindings for C, C++, Java, Ada, 
 ● Available methods defined through IDL
  • 5. Distributed Object Programming course 2003 Model (2) ● Remote stateful objects – Real objects, possibly shared and persistent ● Rich API set – Programmers directly control security, transactions, finding object/servers by calling methods ● Quite far from stateless components – External state, container properties
  • 6. Distributed Object Programming course 2003 Model (3) One standardised interface One interface per object operation ORB-dependent interface One interface per object adapter DynamicDynamic InvocationInvocation Client Stubs ORB InterfaceInterface Implementation Skeletons Client Object Implementation ORB Core Object Adapter
  • 7. Distributed Object Programming course 2003 Interface and Services ● Interface repository ● Implementation repository ● Services: – Collection – Query – Concurrency control – Transactions
  • 8. Distributed Object Programming course 2003 More Services ● Services – Event – Notification – Externalization – Life cycle – Licensing – Naming ● Finding servers and load balancing
  • 9. Distributed Object Programming course 2003 Services (3) ● Services: – Property – Trading – Persistence – Relationship – Security ● Common to use SSL for lightweight authentication and encryption ● CORBA standard security service – Time
  • 10. Distributed Object Programming course 2003 Communications ● Object invocations – Synchronous – One way – Deferred synchronous ● Events – Consumer and Supplier – Push model vs Pull model
  • 11. Distributed Object Programming course 2003 CORBA Processes ● Clients – Simple to program – IDL compiler creates a proxy implementation – Interceptors: intercept request between client and server. – Request level – between client and proxy – Message level – between ORB and network
  • 12. Distributed Object Programming course 2003 Interceptors Client application Client proxy Client ORB Local OS Request Level Interceptors Message Level Interceptors Invocation request
  • 13. Distributed Object Programming course 2003 Portable Object Adapter ● Provides a consistent image of the object ● (also called wrapper) ● Makes server side code appears as CORBA objects ● Use a “servant” - implement client methods ● Maps object Ids (references) to servants.
  • 14. Distributed Object Programming course 2003 Naming ● How do you find object or servers? – Using a name server – Directory of available objects ● Server processes call name server when they come up – Advertising their services/objects ● How do you find the name server? – Call resolve_initial_references – And local ORB ‘knows’ location of NS
  • 15. Distributed Object Programming course 2003 Naming (2) ● Clients call name server to find the location of a factory/object/server – Up to the name server to match clients to servers/objects – Returns object reference (IOR?) ● Includes location of server ● Client calls server process (via ORB) to access or create objects
  • 16. Distributed Object Programming course 2003 Scaling ● NS can support load balancing – Multiple servers/processors register the same service/object (object groups) – Name server spreads out requests across available objects – Proprietary until CORBA 3 ● Extends IOR to IOGR.
  • 17. Distributed Object Programming course 2003 Where is the IDL? Client object IDL stub (obj) ORB Network services Server object IDL skel (obj) ORB/POA Network services Request Request data IIOP protocol
  • 18. Distributed Object Programming course 2003 IDL Language It’s a declarative language to define client object/server object interface. It’s somehow a simplified object definition; no implementation is defined. An example
 module Bank { struct Customer { string name; string address; string id; } interface Account { void debit( in unsigned long ammount ); void withdraw( in unsigned long ammount ); long balance(); } interface AccountMgr { Account getAccountByCustomer( Customer c ); } }
  • 19. Distributed Object Programming course 2003 Example module Bank { struct Customer { string name; string address; string id; } interface Account { void debit( in unsigned long ammount ); void withdraw( in unsigned long ammount ); long balance(); } interface AccountMgr { Account getAccountByCustomer( Customer c ); } } Core concept: 2 kinds of programming types: Objects (interfaces) and non-objects (types) Interfaces Types
  • 20. Distributed Object Programming course 2003 Language (2) ‱ Operations in interfaces define callable methods. Operations can have parameters, but not implementation ‱ Each parameter definition must say if it is an in , out or inout parameter and has a type and name ‱ There are also support for: exception handling, sequence templates, arrays; inheritance; abstract interfaces and so on
  • 21. Distributed Object Programming course 2003 Language (3) ‱ Basic types: long, short, unsigned long, unsigned short, float, double, boolean, octet (fits anything, as sequence), any (really anything) ‱ Constructed types: There are constructed types: struct, union, enumeration type. ‱ The any type. Struct <identifier> { <declaration>; 
 } union <identifier> switch (<switch-type>) { case <constant>: <declaration>; 
 } enum <identifier> { <identifier>, 
 }
  • 22. Distributed Object Programming course 2003 IDL Mapping ‱ They must define the means of expressing in the language all CORBA IDL constructs. ‱ A complete language mapping will allow a programmer to have access to all ORB functionality in a way that is convenient for the particular programming language. ‱ To support source portability, all ORB implementations must support the same mapping for a particular language (mapping specification).
  • 23. Distributed Object Programming course 2003 IDL Mapping Objects specification in IDL Client code Server code compiler ïź Ada, C, C++, COBOL, Smalltalk, and Java, Lisp, CORBA scripting language ïź Java to IDL
  • 24. Distributed Object Programming course 2003 IDL Mapping interface myObj { long op1 (in long arg1 ); } typedef CORBA_Object myObj; extern CORBA_long myObj_op1( example1 o, CORBA_long arg1, CORBA_Environment *ev ); class myObjOperations extends org.omg.CORBA.IDLEntity { void op1( 
 ); 
}; class myObj extends MyObjOperations { 
 } 
 class myObj : virtual public CORBA::Object { 
 public: 
 virtual void op1( 
 ); } C Java C++
  • 25. Distributed Object Programming course 2003 IDL Mapping public interface myInt { ... } abstract interface myInt { ... } package M;module M { ... } public interface myObjOperations { ... } public interface myObj extends myObjOperations ... { } interface myObj { ... } JavaCORBA
  • 26. Distributed Object Programming course 2003 IDL Mapping Op1 correspond to method op1 in object interface. in parameters are passed by value. out and inout parameters are passed through holder classes. For inout parameters, client must initialise the holder class with a value before calling the method. As interfaces are mapped to java interfaces, method and object’s signatures are maintained. operations and parameter passing: op1(in Ob1 x, out Ob2 y, inout Ob3 z) JavaCORBA
  • 27. Distributed Object Programming course 2003 IDL Mapping IDL TYPE JAVA TYPE EXCEPTIONS boolean boolean Char char CORBA::DATA_CONVERSION wchar char CORBA::DATA_CONVERSION octec byte String Java.lang.String CORBA::MARSHAL CORBA::DATA_CONVERSION wstring Java.lang.String CORBA::MARSHAL CORBA::DATA_CONVERSION short short Unsigned short short Long int Unsigned long int Long long long Unsigned long long long float float double double fixed Java.math.BidDecimal CORBA::DATA_CONVERSION
  • 28. Distributed Object Programming course 2003 IDL Mapping see specificationunion, sequence, arrays, constants, etc. final public class myStruct ... IDLEntity { public int field1; public String field2; public myStruct() { } // empty! public myStruct(int f1, String f2) { ... } } struct myStruct { long field1; string field2; } JavaCORBA
  • 29. Distributed Object Programming course 2003 IDL Example module Bank { struct StructType{ long initbalance; string acctname; }; interface Account { float balance(); string getCalendar(); }; interface AccountManager { Account open(in StructType st); }; };
  • 30. Distributed Object Programming course 2003 IDL Example ● AccountManagerStub.java--Stub code for the AccountManager object on the client side. ● AccountStub.java--Stub code for the Account object on the client side. ● ccount.java--The Account interface declaration. ● AccountHelper.java--Declares the AccountHelper class, which defines helpful utility methods. ● AccountHolder.java--Declares the AccountHolder class, which provides a holder for passing Account objects. ● AccountManager.java--The AccountManager interface declaration. ● AccountManagerHelper.java--Declares the AccountManagerHelper class, which defines helpful utility methods. ● AccountManagerHolder.java--Declares the AccountManagerHolder class, which provides a holder for passing AccountManager objects.
  • 31. Distributed Object Programming course 2003 IDL Example ● AccountManagerOperation.java--This interface provides declares the method signatures defined in the AccountManager interface in the Bank.idl file. ● AccountManagerPOA.java--POA servant code (implementation base code) for the AccountManager object implementation on the server side. ● AccountManagerPOATie.java--Class used to implement the AccountManager object on the server side using the tie mechanism, ● AccountOperations.java--This interface provides declares the method signatures defined in the Account interface in the Bank.idl file ● AccountPOA.java--POA servant code (implementation base code) for the Account object implementation on the server side. ● AccountPOATie.java--Class used to implement the Account object on the server side using the tie mechanism ● StructType.java--Declares the StrucType class, which is used both by Client and Server classes.
  • 32. Distributed Object Programming course 2003 IDL Example ● StructTypeHelper.java--Declares the StructTypeHelper class, which defines helpful utitly methods. ● StructTypeHolder.java--Declares the StructTypeHolder class, which provides a holder for passing StructType objects.
  • 33. Distributed Object Programming course 2003 Server Example ● Steps for server setup – Initialize ORB – Create and setup POA – Activate the POA Manager – Activate objects – Wait for client requests
  • 34. Distributed Object Programming course 2003 org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null); // get a reference to the root POA POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); // Create policies for our persistent POA org.omg.CORBA.Policy[] policies = { rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT) }; // Create myPOA with the right policies POA myPOA = rootPOA.create_POA( "bank_agent_poa", rootPOA.the_POAManager(), policies ); // Create the servant AccountManagerImpl managerServant = new AccountManagerImpl();
  • 35. Distributed Object Programming course 2003 Code Example (cont) // Decide on the ID for the servant byte[] managerId = "BankManager".getBytes(); // Activate the servant with the ID on myPOA myPOA.activate_object_with_id(managerId, managerServant); // Activate the POA manager rootPOA.the_POAManager().activate(); System.out.println(myPOA.servant_to_reference(managerServant) + " is ready."); // Wait for incoming requests orb.run();
  • 36. Distributed Object Programming course 2003 Client Example ● Steps for client setup – Initialize ORB – Locate Server using location service (smart agent) – Obtains the balance of the Account using the object reference returned by bind().
  • 37. Distributed Object Programming course 2003 Client Example Org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null); // Get the manager Id byte[] managerId = "BankManager".getBytes(); // Locate an account manager. Give the full POA name and // the servant ID. Bank.AccountManager manager = Bank.AccountManagerHelper.bind(orb, "/bank_agent_poa", managerId); // use args[0] as the account name, or a default. // String name = args.length > 0 ? args[0] : // "default account"; String name=args[0]; Integer initbalance=new Integer(args[1]);
  • 38. Distributed Object Programming course 2003 Client Example (cont) Bank.StructType stname= new Bank.StructType(initbalance.intValue(),name); // Request the account manager to open a named account. System.out.println(stname); Bank.Account account = manager.open(stname); // Get the balance of the account. float balance = account.balance(); String strtime= account.getCalendar(); // Print out the balance. System.out.println ("The balance in " + name + "'s account is $" + balance + "and time is "+ strtime);

Hinweis der Redaktion

  1. CORBA IDL – Interface Definition Language DII – Dynamic Invocation Interface The ORB has very few services itself, most communication is performed by the stub/skeletons between clients and objects (servers)
  2. Interface repository allows a process to find out during runtime to investigate how an interface looks like. Implementation repository provides all is needed to implement and activate objects. Collection – allows creating groups of object into lists, stacks, queues, sets, etc ... Query – constructs collections of object that can be investigated by a query language (adds to the collection service) Concurrency control – locking Transactions – allow objects to support transactions
  3. Events – allows clients and objects to be interrupted Notification provides an advance asynchronous communications. Externalization – marshaling objects to be stored on disk or network. Life cycle – create/destroy/copy and move objects licensing – right of clients Naming – computer ids to human readable names.
  4. Property service allows clients to associate attributes and values with objects, they describe the object not its state. Trading service – allows object to advertise their interfaces and clients to perform lookups. Persistence – storing information on disk transparently. Relationship – support organizing objects into schemes (like in databases).
  5. Synchronous – at most once one way – best effort (no wait at all) deferred synchronous – at most once – can later block or check for reply. Event channel between consumer and supplier No mechanism to filter events, no persistent events. Filtering was added in the notification service.
  6. IOR – Interoperable Object Reference – allows passing an object reference between processes.