Archived
This forum has been archived. Please start a new discussion on GitHub.
How to know what default things are?
Hello,
Is it somehow possible to see, during runtime, what the "default" stuff (for example: protocol and host) of a communicator are?
I searched a lot and the most obvious way:
I noticed that all properties are gone from the communicator. Listing the whole property set gives me just the following:
I feel I could create a dummy proxy then convert it to a string and parse that string, but this is a gigantic hack and requires the proxy to connect successfully!
Is there really no way?
PS: My application inherits from Ice::Application
Is it somehow possible to see, during runtime, what the "default" stuff (for example: protocol and host) of a communicator are?
I searched a lot and the most obvious way:
communicator()->getProperties()->getProperty("Ice.Default.Protocol");does not work, too bad!
I noticed that all properties are gone from the communicator. Listing the whole property set gives me just the following:
Ice.Config= Ice.ProgramName=./clientThat is not much information at all!
I feel I could create a dummy proxy then convert it to a string and parse that string, but this is a gigantic hack and requires the proxy to connect successfully!
Is there really no way?
PS: My application inherits from Ice::Application
0
Comments
-
You can call getPropertiesForPrefix with an empty string as the argument and then iterate over the returned dictionary to see all the properties.
Cheers,
Michi.0 -
Michi, it still looks like there are some values with the logic:
if ""==properties.getProperty("Ice.Default.Protocol",""): useDefault()
rather than having those defaults assigned to the properties instance on initialization:$ python Python 2.5.4 (r254:67916, Jun 24 2009, 20:23:29) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Ice ic = I>>> ic = Ice.initialize() >>> m = ic.getProperties().getPropertiesForPrefix("") >>> m {'Ice.Default.CollocationOptimized': '0', 'Ice.Config': ''} >>>
~J.0 -
By doing this, I noticed that nearly all properties of the communicator are gone after the initialization (I'm sure they are set before!). That's what I meant by this:I noticed that all properties are gone from the communicator. Listing the whole property set gives me just the following:
Ice.Config= Ice.ProgramName=./client
within the run() method of my overwritten service class, all the properties I give to main() (by command line or programmatically) are gone.0 -
Properties do not get cleared after communicator initialization. Perhaps you should post the (small/complete/compilable) code you are using to test this so we can take a closer look.0
-
Things are getting clearer. While building a minimalistic example to demonstrate my problem, the problem has gone away. I'll look more into this later, now I have to go learn0
-
Hello,
just to inform you that (as suspected in my last post) the problem was, of course, on my side. I wasn't giving the correct argument vector to the main method of the ice application object. Thanks for the help.0