0% found this document useful (0 votes)
38 views2 pages

Corba Steps

This document outlines the steps to create a basic CORBA client-server application. It includes defining the IDL interface, generating stub and skeleton classes from the IDL, implementing the server object class, starting the naming service, binding the server object, and having the client look up and invoke methods on the server object. The key steps are: defining the IDL, generating code from the IDL, implementing the server class, starting the naming service, binding the server object, having the client look up and call methods on the server object.

Uploaded by

dnadar881
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Corba Steps

This document outlines the steps to create a basic CORBA client-server application. It includes defining the IDL interface, generating stub and skeleton classes from the IDL, implementing the server object class, starting the naming service, binding the server object, and having the client look up and invoke methods on the server object. The key steps are: defining the IDL, generating code from the IDL, implementing the server class, starting the naming service, binding the server object, having the client look up and call methods on the server object.

Uploaded by

dnadar881
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Corba Steps

 Idl file
1. interface myinf
{
Attribute aname;
Void method1();
Datatype method2(in para1);
};

 Idlj –fall –oldImplBase file.idl

 Server Object
1. class serverobject extends _myinfImplBase
{
Method1();
Method2();
}
 Server
1. import org.omg.CORBA.*;
2. import org.omg.CosNaming.*;
3. class Server
{
Public static void main(String args[])
{
ORB orb = ORB.init(args,null);

Org.omg.CORBA.Obejct contextObj =
orb.resolve_initial_references(“NameService”);

NamingContext rootContext =
NamingContextHelper.narrow(contextObject);

ServerObj s = new ServerObj();

NameComponent name = new NameComponent(“Name”,””);


NameComponent path[]={name};

rootContext.rebind(path,s);

java.lang.Object obj = new java.lang.Object();


synchronized(obj){ obj.wait(); }
}
}
 Client
1. import org.omg.CORBA.*;
2. import org.omg.CosNaming.*;
3. class Client
{
Public static void main(String args[])
{
ORB orb = ORB.init(args,null);
Org.omg.CORBA.Object contextObj =
orb.resolve_initial_references(“NameService”);

NamingContext rootContext =
NamingContextHelper.narrow(contextObj);

NameComponent name = new NameComponent(“name”,””);


NameCompnent path[]= {name};

Org.omg.CORBA.Object obj = rootContext.resolve(path);

Myinf mobj = (myinf)myinfHelper.narrow(obj);

Mobj.method1();
Mobj.method2();

Mobj._release();
}
}

 Steps to be followed
1. tnameserv –ORBInitialPort <portno>
2. java server
3. java client

You might also like