2 Replies Latest reply on Mar 21, 2004 7:42 PM by Brian Wallis

    CorbaNamingService IOR at Runtime

    lemmy-k Newbie

      Hello,

      can anyone tell me if it's possible to obtain the CORBANamingService IOR at runtime and how I do this?

        • 1. Re: CorbaNamingService IOR at Runtime
          Scott Stark Master

          No. Its printed out as an INFO level message, but we should be maing it available via JMX.

          12:35:25,541 INFO [CorbaNamingService] Naming: [IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E30000000000002000000000000006C000102000000000F36342E3233382E3230372E31333000000DC80000000000114A426F73732F4E616D696E672F726F6F74000000000000020000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000010000002C0000000000000001000000010000001C00000000000100010000000105010001000101090000000105010001]

          • 2. Re: CorbaNamingService IOR at Runtime
            Brian Wallis Master

            Wouldn't it be possible to use a corbaloc IOR? I think that jacorb supports
            these but I haven't actually tried it. I've used them with mico and jacorb
            clients to an Orbix 2000 server.

            All you need is the hostname and port number for the server ORB (The port
            number is set in your jacorb.properties file, find OAPort), ie: for your
            example of the naming service, assuming your hostname is fred.cat.com
            and using the default IIOP port number you can use an IOR like the
            following to get an object reference to the NameService:

            corbaloc:iiop:1.2@fred.cat.com:3528/NameService

            so you just string_to_object and narrow from this.

            String nsior = "corbaloc:iiop:1.2@fred.cat.com:3528/NameService";
            org.omg.CORBA.ORB orb = ORB.init(args, props);
            org.omg.CORBA.Object obj = orb.string_to_object(nsior);
            NamingContextExt ns = NamingContextExtHelper.narrow(obj);

            If you are then just going to look up a name and narrow it to the real object
            you want, you can use a corbaname IOR instead, so to lookup "myobject" in
            the "mycontext" naming context you can use:

            corbaname:iiop:1.2@fred.cat.com:3528/NameService#mycontext/myobject

            and do it all in one go.

            There is a good article on these IORs at:
            http://www.iona.com/devcenter/corba/corbaloc.pdf

            brian wallis...