How does Visibroker 3.4 client get a reference to the naming service of server implemented on jdk1.4 based ORB??
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   GEORGE_THOMAS
Posted On:   Tuesday, October 1, 2002 03:18 PM

We are trying to integrate to legacy system. The server at our side has to be revamped and in this process, we are also moving from Visibroker's ORB to java ORB(jdk1.4). The object is bound to the NameService. Now how does the client (on legacy side) get a reference to the object?? I read that the first step is to get a reference to the NameService. But how to do that using Visibroker ORB??

Thanks!

Re: How does Visibroker 3.4 client get a reference to the naming service of server implemented on jdk1.4 based ORB??

Posted By:   Mike_Friedrich  
Posted On:   Wednesday, October 2, 2002 04:06 PM

For the java-ORB on client side you can use something like this:

Properties props = new Properties();
props.add("org.omg.CORBA.ORBInitialPort","900");
props.add("org.omg.CORBA.ORBInitialHost","myhos.mydomain");

But for Visibroker's ORB see the manuals for the right properie-keynames.


With standard orbs, you should this get to work:


// you change the defaults through arguments or properties
ORB orb = ORB.init(args, props);

// Get the root naming context from InitRef-Service (default init-service is at localhost:900)
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);

// Construct the naming path
NameComponent nc1 = new NameComponent("my", "");
NameComponent nc2 = new NameComponent("path", "");
NameComponent path[] = {nc1,nc2};

// Resolve the object reference from nameservice (default name-service is at localhost:910)
SomeObject SomeObjectRef = SomeObjectHelper.narrow(ncRef.resolve(path));


... hope this helps


Regards, Mike

About | Sitemap | Contact