Home Help Center

in service get info about icebox

JinnJinn Member Victor LebedevOrganization: BFUProject: monitoring server ✭✭
Hi all! Please help me.

My question is next:

For example:

Something configure in Icegrid:
    <node name="node1">

      <icebox id="IceBox" activation="on-demand" exe="iceboxnet.exe">

        <service name="Service" entry="services.dll:ServiceI">
               ...
        </service>

      </icebox>
    </node>



I have node1 that run IceBox, IceBox run Service -> use method service:
   start(string name, Ice.Communicator communicator, string[] args)  
   {
        // ... Do something 
   } 

But how in body of this method(see above) get info about icebox and node? For example info such as: name node, name IceBox that corresponding to names in IceGrid config.

Cheers,
Jinn.

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    You can retrieve the server identifier by getting the Ice.ProgramName property. For other values, the easiest is to set properties with the information you need. For example for the node name:
        <node name="node1">
          <icebox id="IceBox" activation="on-demand" exe="iceboxnet.exe">
            <service name="Service" entry="services.dll:ServiceI">
              <properties>  
                <property name="Node" value="${node}"/>
              </properties>  
            </service>
          </icebox>
        </node>
    

    You can then retrieve the property value in the code:
    void
    start(string name, Ice.Communicator communicator, string[] args)  
    {
         Ice.Properties properties = communicator.getProperties();
         string serverId = properties.getProperty("Ice.ProgramName");
         string node = properties.getProperty("Node");
         ...
    }
    

    Cheers,
    Benoit.
  • JinnJinn Member Victor LebedevOrganization: BFUProject: monitoring server ✭✭
    Thank you very much for your response! :)

    Cheers,
    Jinn.
Sign In or Register to comment.