[omniORB] newbie quick queries
Eric Damphousse
ericdamphousse at darwingroup.net
Mon Jun 30 14:27:40 BST 2003
Hi all,
First thing first, thank you all for your help.. it definitely helps and
answers quite a few questions that I may have. I might have been unclear
on my little test I previously describe and will try again with
something more specific and hopefully clearer.
Let say I wrote a simple servant object that can set the clock of the
machine it currently runs on. I have many machines, running different
OSs, all of them having that servant object up and running.
I have 1 client sitting on a box somewhere where its purpose is to set
the clock of any machines that have the servant object available. For
example, a user would enter a clock value in the client, press enter
then all clocks on all machine would be set to that value, or close to it.
The important part for me is to write a single object that can be
distributed to many machines, then accessed/controlled by one client.
I have this now working, but needed to cheat. What I have done to make
this work is to modify the servant object for each machine it runs on as
such:
Object_impl myobj;
OWWObject_var myObjectVar = myobj._this();
try
{
// bind object to name service
CosNaming::Name_var name =
rootContextExt_var->to_name("Hillsboro.Newton/TestObject");
bindObjectPath(rootContextExt_var.in(), name.in(), myObjectVar.in());
}
catch stuff not written here....
All code within the servant object is the same except the
"Hillsboro.Newton/TestObject" naming service stuff. The way this is
currently setup is mytown.mymachine/servant_object. For each machine it
runs on, I modify the mymachine to be the machine in question.
The client loops through the different mytown.mymachine/servant_object
and it works just fine.
My question is that the right way of doing such a thing. I don't see the
need to modify the servant object's naming stuff. I could potentially
read this from a file, but I have a feeling there is a better way of
doing this.
Any clues?
Eric
More information about the omniORB-list
mailing list