[omniORB] How to use the NamingService from Visibroker (3.4)

A.A.Gerritsen a.a.gerritsen@phys.uu.nl
Mon, 17 Jan 2000 14:40:14 +0100


>I guess this is a FAQ but I can not find the answer in any of the
>omniORB docs nor in the Visibroker docs.
>
>I want to use the omniORB NamingService in a Visibroker server and a
>client but I can not find a way to overrule the smartagent.
>
>In other words: Is there a Visibroker equivalent to ORBInitialHost and
>ORBInitialPort?

Well, I do this:

     // Initialize the ORB and BOA
      org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(argv, null);
      org.omg.CORBA.BOA boa = orb.BOA_init();
      
      // Get the object reference of the Name server
      BufferedReader fin =
        new BufferedReader(new FileReader("nameserver.ior"));
      String strRef = fin.readLine();
      fin.close();
      NamingContext rootctxt =
        NamingContextHelper.narrow(orb.string_to_object(strRef));
      if( null==rootctxt )
      {
       System.err.println("Oops! Invalid nameserver object reference.") ;
       System.exit(1) ;
      }

     //now you have a root-context with which you can do what you want.

If this is what you mean.

Armin