140 likes | 302 Views
Outline. CORBA Programming Elements Server & Client Basics IDL Compiler CORBA Naming Service Utilities Demo. CORBA Programming Elements. Object Request Broker (ORB) Interoperable Object Reference (IOR) Object Adapters Client Servant (Implementation). Conceptual view of ORB.
E N D
Outline • CORBA Programming Elements • Server & Client Basics • IDL Compiler • CORBA Naming Service • Utilities • Demo
CORBA Programming Elements • Object Request Broker (ORB) • Interoperable Object Reference (IOR) • Object Adapters • Client • Servant (Implementation)
Object Request Broker • provides all the communication infrastructure needed to identify and locate objects • lookup and instantiate objects on remote machines • handle connection management • deliver data and request communication • invoke methods on a remote object
Interoperable Object Reference • Global identifier string • identifies the machine on which its associated object is located • the interface that the object supports • Examples IOR:000000000000001c49444c3a42616e6b2f4163636f756e744d616e616765723a312e3000000000010000000000000050000102000000000f3133372e3138392e38382e3137330000809b00000000002b00504d43000000040000000f2f62616e6b5f706f727461626c6500200000000b42616e6b4d616e616765720000000000
Object Adapters • provides an interface between the ORB and the object implementation • Registration of server object implementations with the Implementation Repository • Mapping of object references to their implementations
Server Basics • Steps for setting up server • Initialize the ORB • Create and Setup the POA • Activate the POA Manager • Creating and activating the objects • Wait for client requests
Client Basics • Steps for setting up client • Initializing the ORB • Binding to objects • Invoking operations on an object
IDL compiler • Examples IDL (Bank.idl): module Bank { interface Account { float balance(); }; interface AccountManager { Account open(in string name); }; }; • Usage : • idl2java Bank.idl
Implementation • AccountImpl.java public class AccountImpl extends Bank.AccountPOA { public AccountImpl(float balance) { _balance = balance; } public float balance() { return _balance; } private float _balance; }
Naming Service • bind a name to one of its objects • associate one or more logical names with an object reference • store logical names in a namespace • obtain an object reference by using the logical name assigned to that object
Utilities • idl2java • osagent • nameserv • vbj • vbjc
Run Sample • Starting Smart Agent if no osagent • osagent • Starting Naming Service • nameserv DEMO • Running Server • vbj -DSVCnameroot=DEMO Server • Running Client • vbj -DSVCnameroot=DEMO Client