Next: , Previous: Setup of the application, Up: Ada Mapping Rules


7.3 Node positioning

Node (process) location is done via a native mechanism of PolyORB. By overloading the abstract function Get_Conf of PolyORB.Parameters, we can assign a specific location to a node.

For each process, Ocarina will generate a package PolyORB.Parameters.Partition which will contains a static array and a Get_Conf function definition linking the current node location to PolyORB local data. When PolyORB will Initialize itself, this function will be called as it's registered in the Initialize hierarchy.

Example :

     
     
     system implementation position.impl
     subcomponents
       proc : process sender_node.simple {ARAO::port_number => 3200;};
       proc_1 : processor a_processor {ARAO::location => "127.0.0.1"};
     properties
       actual_processor_binding => reference proc_1 applies to proc;
     end position.impl;
     
     
     
     package body PolyORB.Parameters.Partition is
     
        type Parameter_Entry is
           record
              Key : PolyORB.Utils.Strings.String_Ptr;
              Val : PolyORB.Utils.Strings.String_Ptr;
           end record;
     
        Conf_Table : constant array (1 .. 2)
          of Parameter_Entry :=
          ((new Standard.String'
             ("polyorb.protocols.iiop.default_addr"),
           new Standard.String'
             ("127.0.0.1")),
           (new Standard.String'
             ("polyorb.protocols.iiop.default_port"),
           new Standard.String'
             ("3200")));
     
        type Partition_Source is
          new PolyORB.Parameters.Parameters_Source with null record;
     
        The_Partition_Source : aliased Partition_Source;
     
        function Get_Conf
          (Source : access Partition_Source;
           Section : Standard.String;
           Key : Standard.String)
          return Standard.String;
        --  Called by PolyORB Initialization
        --  return the configuration data as in the Conf_Table array
     
        procedure Initialize;
        --  Initialize PolyORB by registerering Get_Conf function
     
     end PolyORB.Parameters.Partition;