Download presentation
Presentation is loading. Please wait.
1
Outline CORBA Programming Elements CORBA Programming Elements Server & Client Basics Server & Client Basics IDL Compiler IDL Compiler CORBA Naming Service CORBA Naming Service Utilities Utilities Demo Demo
2
CORBA Programming Elements Object Request Broker (ORB) Object Request Broker (ORB) Interoperable Object Reference (IOR) Interoperable Object Reference (IOR) Object Adapters Object Adapters Client Client Servant (Implementation) Servant (Implementation)
3
Conceptual view of ORB
4
Object Request Broker provides all the communication infrastructure needed to identify and locate objects provides all the communication infrastructure needed to identify and locate objects lookup and instantiate objects on remote machines lookup and instantiate objects on remote machines handle connection management handle connection management deliver data and request communication deliver data and request communication invoke methods on a remote object invoke methods on a remote object
5
Interoperable Object Reference Global identifier string Global identifier string identifies the machine on which its associated object is located identifies the machine on which its associated object is located the interface that the object supports the interface that the object supports Examples Examples IOR:000000000000001c49444c3a42616e6b2f4163636f756e744d616e616765723a312e30000000 00010000000000000050000102000000000f3133372e3138392e38382e3137330000809b00000 000002b00504d43000000040000000f2f62616e6b5f706f727461626c6500200000000b42616e 6b4d616e616765720000000000
6
Object Adapters provides an interface between the ORB and the object implementation provides an interface between the ORB and the object implementation Registration of server object implementations with the Implementation Repository Registration of server object implementations with the Implementation Repository Mapping of object references to their implementations Mapping of object references to their implementations
7
Server Basics Steps for setting up server Steps for setting up server 1. Initialize the ORB 2. Create and Setup the POA 3. Activate the POA Manager Creating and activating the objects 5. Wait for client requests
8
Client Basics Steps for setting up client Steps for setting up client Initializing the ORB Binding to objects Invoking operations on an object
9
IDL compiler Examples IDL (Bank.idl): Examples IDL (Bank.idl): module Bank { interface Account { float balance(); }; interface AccountManager { Account open(in string name); };}; Usage : Usage : idl2java Bank.idl idl2java Bank.idl
10
Implementation AccountImpl.java AccountImpl.java public class AccountImpl extends Bank.AccountPOA { public AccountImpl(float balance) { public AccountImpl(float balance) { _balance = balance; _balance = balance; } public float balance() { public float balance() { return _balance; return _balance; } private float _balance; private float _balance;}
11
Naming Service bind a name to one of its objects bind a name to one of its objects associate one or more logical names with an object reference associate one or more logical names with an object reference store logical names in a namespace store logical names in a namespace obtain an object reference by using the logical name assigned to that object obtain an object reference by using the logical name assigned to that object
12
Utilities idl2java idl2java osagent osagent nameserv nameserv vbj vbj vbjc vbjc
13
Run Sample Starting Smart Agent if no osagent Starting Smart Agent if no osagent osagent osagent Starting Naming Service Starting Naming Service nameserv DEMO nameserv DEMO Running Server Running Server vbj -DSVCnameroot=DEMO Server vbj -DSVCnameroot=DEMO Server Running Client Running Client vbj -DSVCnameroot=DEMO Client vbj -DSVCnameroot=DEMO Client
14
Demo
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.