using multiple naming services from one program

using multiple naming services from one program

Post by pasis.. » Thu, 19 Jun 2003 00:42:24



ACE VERSION: 5.2
HOST MACHINE and OPERATING SYSTEM: win2000
COMPILER NAME AND VERSION (AND PATCHLEVEL): MSDEV 6.0

Could somebody explain me an elegant solution for following problem:

I'm developing a software that is going to act as a link between several
other sw-modules and subsystems. My link software has several CORBA
connections that are described in several IDLs. What I'm supposed to do
is to advertise my servants in several naming services, one naming
service per
IDL. Naming services are alive when my program starts.

I have studied examples and litterature (advanced CORBA with C++) but
all examples limit to one naming service per process. So what to do? Are
any example codes available to show how to advertise servants to several
naming services from one program.

Pasi.

 
 
 

using multiple naming services from one program

Post by Douglas C. Schmid » Thu, 19 Jun 2003 01:16:22


Hi Pasi,

        Thanks for using the PRF.

Quote:>> ACE VERSION: 5.2

I recommend upgrading to a newer version of TAO, such as the 1.3.3
version that's available from

http://deuce.doc.wustl.edu/Download.html

Quote:>> I'm developing a software that is going to act as a link between several
>> other sw-modules and subsystems. My link software has several CORBA
>> connections that are described in several IDLs. What I'm supposed to do
>> is to advertise my servants

BTW, you never advertise servants in CORBA - only objects via their
object references.

Quote:>> in several naming services, one naming service per IDL.

That seems rather "clunky".  Why can't you simply use one naming
service and use the "type" field of the names to indicate which
versoin of the IDL you want?

Quote:>> I have studied examples and litterature (advanced CORBA with C++)
>> but all examples limit to one naming service per process. So what
>> to do? Are any example codes available to show how to advertise
>> servants to several naming services from one program.

I don't see why there should be any real difference at all between
advertising objects to multiple naming services rather than one
naming service.  You simply need to keep track of the different object
references used to bind() and resolve() the objects.

Take care,

        Doug
--
Dr. Douglas C. Schmidt, Professor           TEL: (615) 343-8197
Electrical Engineering and Computer Science FAX: (615) 343-7440
Vanderbilt University                       WEB: www.cs.wustl.edu/~schmidt/


 
 
 

using multiple naming services from one program

Post by sosnovsky, sta » Thu, 19 Jun 2003 01:43:03


Hi Pasi,

Try using

CORBA::ORB::string_to_object("corbaloc::host1:someport1/NameService");
CORBA::ORB::string_to_object("corbaloc::host2:someport2/NameService");

Instead of ORB::resolve_initial_references ("NameService");

Cheers,
StanS

> -----Original Message-----

> Sent: Tuesday, June 17, 2003 12:15 PM

> Subject: Re: [tao-users] using multiple naming services from one program

> Hi Pasi,

>         Thanks for using the PRF.

> >> ACE VERSION: 5.2

> I recommend upgrading to a newer version of TAO, such as the 1.3.3
> version that's available from

> http://deuce.doc.wustl.edu/Download.html

> >> I'm developing a software that is going to act as a link between
> several
> >> other sw-modules and subsystems. My link software has several CORBA
> >> connections that are described in several IDLs. What I'm supposed to do
> >> is to advertise my servants

> BTW, you never advertise servants in CORBA - only objects via their
> object references.

> >> in several naming services, one naming service per IDL.

> That seems rather "clunky".  Why can't you simply use one naming
> service and use the "type" field of the names to indicate which
> versoin of the IDL you want?

> >> I have studied examples and litterature (advanced CORBA with C++)
> >> but all examples limit to one naming service per process. So what
> >> to do? Are any example codes available to show how to advertise
> >> servants to several naming services from one program.

> I don't see why there should be any real difference at all between
> advertising objects to multiple naming services rather than one
> naming service.  You simply need to keep track of the different object
> references used to bind() and resolve() the objects.

> Take care,

>         Doug
> --
> Dr. Douglas C. Schmidt, Professor           TEL: (615) 343-8197
> Electrical Engineering and Computer Science FAX: (615) 343-7440
> Vanderbilt University                       WEB:
> www.cs.wustl.edu/~schmidt/

> server.isis.vanderbilt.edu

 
 
 

using multiple naming services from one program

Post by Steve Totte » Thu, 19 Jun 2003 02:02:05



> Try using

> CORBA::ORB::string_to_object("corbaloc::host1:someport1/NameService");
> CORBA::ORB::string_to_object("corbaloc::host2:someport2/NameService");

> Instead of ORB::resolve_initial_references ("NameService");

Another option is to pass multiple -ORBInitRef options
via argc/argv to CORBA::ORB_init(), like this:

-ORBInitRef NameService1=corbaloc::host1:someport1/NameService
-ORBInitRef NameService2=corbaloc::host2:someport2/NameService

then, in your code, use:

CORBA::Object_var ns1_obj =
   orb->resolve_initial_references("NameService1");
CORBA::Object_var ns2_obj =
   orb->resolve_initial_references("NameService2");

Steve
--
----------------------------------------------------------------
  Steve Totten, Principal Software Engineer
  Object Computing, Inc. (OCI)
  http://www.ociweb.com/  http://www.theaceorb.com/
----------------------------------------------------------------

 
 
 

using multiple naming services from one program

Post by Pasi Niemel » Thu, 19 Jun 2003 18:02:34


Thanks Steve!

Solution you suggested was the trick I was looking for. I made some quick
trials and it seems to work ok. Solution seems to be so simple that I feel a
little bit stupid...


>That seems rather "clunky".  Why can't you simply use one naming
>service and use the "type" field of the names to indicate which
>versoin of the IDL you want?

One task of my software is to hide our XYZsystems internal CORBA structure
from external CORBA link. So this is why I need to use two naming services
one for the external CORBA link and the other for internal communications.

Pasi.

----- Original Message -----

> Another option is to pass multiple -ORBInitRef options
> via argc/argv to CORBA::ORB_init(), like this:

> -ORBInitRef NameService1=corbaloc::host1:someport1/NameService
> -ORBInitRef NameService2=corbaloc::host2:someport2/NameService

> then, in your code, use:

> CORBA::Object_var ns1_obj =
>    orb->resolve_initial_references("NameService1");
> CORBA::Object_var ns2_obj =
>    orb->resolve_initial_references("NameService2");

> Steve
> --
> ----------------------------------------------------------------
>   Steve Totten, Principal Software Engineer
>   Object Computing, Inc. (OCI)
>   http://www.ociweb.com/  http://www.theaceorb.com/
> ----------------------------------------------------------------

 
 
 

1. using multiple naming services

ACE VERSION: 5.2
HOST MACHINE and OPERATING SYSTEM: win2000
COMPILER NAME AND VERSION (AND PATCHLEVEL): MSDEV 6.0

Could somebody explain me an elegant solution for following problem:

I'm developing a software that is going to act as a link between several
other sw-modules and subsystems. My link software has several CORBA
connections that are described in several IDLs. What I'm supposed to do is
to advertise my servants in several naming services, one naming service per
IDL. Naming services are alive when my program starts.

I have studied examples and litterature (advanced CORBA with C++) but all
examples limit to one naming service per process. So what to do? Are any
example codes available to show how to advertise servants to several naming
services from one program.

Pasi.

2. ISDN to non-ISDN Conn

3. Naming Service: Binding compound names using a DLL_ORB

4. Best 3D app

5. Naming service resolve crashed both application and naming service on Redhat 8.0

6. vs.net and server exporer

7. Is there a method to find the multiple naming services automatically in TAO?

8. C4 & NT 4.0

9. Naming Service Error Message on First Invocation

10. [TAO-Corba]: [Conecting client to server on different machine using 'Naming Service']

11. : [Conecting client to server on different machine using 'Naming Service']

12. Problem using TAO Naming Service with TAO Implementation Repository