outline
DESCRIPTION
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. - PowerPoint PPT PresentationTRANSCRIPT
OutlineOutline
CORBA Programming ElementsCORBA Programming Elements Server & Client BasicsServer & Client Basics IDL CompilerIDL Compiler CORBA Naming ServiceCORBA Naming Service UtilitiesUtilities DemoDemo
CORBA Programming CORBA Programming ElementsElements
Object Request Broker (ORB)Object Request Broker (ORB) Interoperable Object Reference Interoperable Object Reference
(IOR)(IOR) Object AdaptersObject Adapters ClientClient Servant (Implementation)Servant (Implementation)
Conceptual view of ORBConceptual view of ORB
Object Request BrokerObject Request Broker
provides all the communication provides all the communication infrastructure needed to identify and infrastructure needed to identify and locate objectslocate objects lookup and instantiate objects on lookup and instantiate objects on
remote machines remote machines handle connection managementhandle connection management deliver data and request communicationdeliver data and request communication invoke methods on a remote object invoke methods on a remote object
Interoperable Object Interoperable Object ReferenceReference
Global identifier stringGlobal identifier string identifies the machine on which its identifies the machine on which its
associated object is located associated object is located the interface that the object supportsthe interface that the object supports ExamplesExamplesIOR:000000000000001c49444c3a42616e6b2f4163636f756e744d616e61IOR:000000000000001c49444c3a42616e6b2f4163636f756e744d616e61
6765723a312e3000000000010000000000000050000102000000000f6765723a312e3000000000010000000000000050000102000000000f3133372e3138392e38382e3137330000809b00000000002b00504d433133372e3138392e38382e3137330000809b00000000002b00504d43000000040000000f2f62616e6b5f706f727461626c6500200000000b42000000040000000f2f62616e6b5f706f727461626c6500200000000b42616e6b4d616e616765720000000000616e6b4d616e616765720000000000
Object AdaptersObject Adapters
provides an interface between the provides an interface between the ORB and the object implementationORB and the object implementation Registration of server object Registration of server object
implementations with the implementations with the Implementation Repository Implementation Repository
Mapping of object references to their Mapping of object references to their implementations implementations
Server BasicsServer Basics
Steps for setting up serverSteps for setting up server1.1. Initialize the ORBInitialize the ORB
2.2. Create and Setup the POACreate and Setup the POA
3.3. Activate the POA ManagerActivate the POA Manager
4.4. Creating and activating the objectsCreating and activating the objects
5.5. Wait for client requestsWait for client requests
Client BasicsClient Basics
Steps for setting up clientSteps for setting up client1.1. Initializing the ORBInitializing the ORB
2.2. Binding to objectsBinding to objects
3.3. Invoking operations on an objectInvoking operations on an object
IDL compilerIDL compiler
Examples IDL (Bank.idl):Examples IDL (Bank.idl):module Bank {module Bank {
interface Account {interface Account {float balance();float balance();
};};interface AccountManager {interface AccountManager {
Account open(in string name);Account open(in string name);};};
};}; Usage : Usage :
idl2java Bank.idlidl2java Bank.idl
ImplementationImplementation AccountImpl.javaAccountImpl.java
public class AccountImpl extends Bank.AccountPOA {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;}}
Naming ServiceNaming Service
bind bind a name to one of its objectsa name to one of its objects associate one or more associate one or more logical logical names names
with an object reference with an object reference store logical names in a store logical names in a namespacenamespace
obtain an object reference by using obtain an object reference by using the logical name assigned to that the logical name assigned to that objectobject
UtilitiesUtilities
idl2javaidl2java osagentosagent nameservnameserv vbjvbj vbjcvbjc
Run SampleRun Sample
Starting Smart Agent if no osagentStarting Smart Agent if no osagent osagent osagent
Starting Naming ServiceStarting Naming Service nameserv DEMOnameserv DEMO
Running Server Running Server vbj -DSVCnameroot=DEMO Servervbj -DSVCnameroot=DEMO Server
Running ClientRunning Client vbj -DSVCnameroot=DEMO Clientvbj -DSVCnameroot=DEMO Client
DemoDemo