Finding Objects in a Distributed System

General Remarks

CS applications often require to act on other objects. Using one node, it is sufficient to know the name of this. But to interact with objects running on another node it is necessesary to know also the nodename. On the cost of flexibility, one could decide to start each object on a dedicated node only. More convenient is to get the nodename (or even the information whether the wanted object is alive) in an automated way. This is possible by the "in use Flag Method" introduced in detail in the context of Singleton Functionality.

Tutorial how to find Objects

In the directory ...\CSClass\CSCommon\TagTools the CS.get node by in use flag.vi can be found which is foreseen to get the node where the object to act on is running.

  1. The object to be found must have implemented the "in use Flag Method" explained in Singleton Functionality. Therefore its hostname is written to the memory tag.
  2. Put the CS.get node by in use flag.vi into the constructor (or where ever it is needed). Connect DSCIntProc and the name of the flag tag you are interested in. The string written to the tag is returned. In case of N/A being returned, "instance not in use" is false. You know by that that the object is not instaciated. Otherwise this boolean turns to true. If nothing (or explicitely "N/A") is connected to "Flag Tag", "instance not in use" is false.

Tutorial how to find Objects

  1. Add the node to the instance name to act on the required objects (e.g. sending messages).
  2. Using the naming convention introduced in Singleton Functionality, you still need the name of the object to connect to; just append "in_use_Flag" to it to get the memory tag name.
  3. If you store the flag tag name in the data base, you can circumvent even this part of the "in use Flag Method" as described.
  4. There might be no Queue/Caller connection to the node where the object of interest is running. Image you want to register to this object or sending a command; this will not be successful due to the fact that at least the first message is lost until the connection is established. For this you can use the PH_Common.connect to Nodes.vi you can find at ...\CSClass\CSPhelix\PH_Common: Empty entries at "Nodes to connect to" and own host are kicked out; for the rest a connection is established. This takes some time, be patient.

-- StefanGoette - 14 Sep 2005
Topic revision: r1 - 2005-09-14, StefanGoette - This page was cached on 2024-04-17 - 00:43.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)