This section describes the interfaces you can use to locate object instances on a network of Smart Agents. For more information on the Location Service, see “Using the Location Service” in the VisiBroker for C++ Developer's Guide.class Agent : public CORBA::ObjectYou should include the locate_c.hh file when you use this class.ObjLocation::HostnameSeq_ptr all_agent_locations();
struct Desc {
Object ref;
IIOP::ProfileBody iiop_locator;
string repository_id;
string instance_name;
boolean activable;
string agent_hostname;
};
. . .
};Object refIIOP::ProfileBody iiop_locatorCORBA::String_var repository_idCORBA::String_var instance_nameCORBA::Boolean activableSet to TRUE to indicate that this object is registered with the Object Activation Daemon. It is set to FALSE to indicate that the object was started manually and is registered with the osagent.CORBA::String_var agent_hostnameclass Fail : public CORBA::UserExceptionThis exception class may be thrown by the Agent class to indicate various errors. The data member FailReason is used to indicate the nature of the failure.FailReason reasonstruct TriggerDescThis structure contains information you use to describe the characteristics of one or more objects for which you wish to register a TriggerHandler, described in “TriggerHandler”.The host_name and instance_name members may be set to NULL to monitor the widest possible set of objects. The more information specified, the smaller the set of objects is.ORBA::String_var repository_idThe repository identifiers of the objects to be monitored by the TriggerHandler. May be set to NULL to include all possible repository identifiers.CORBA::String_var instance_nameThe instance name of the object to be monitored by the TriggerHandler. May be set to NULL to include all possible instance names.CORBA::String_var host_name;The host name where the object or objects monitored by the TriggerHandler are located. May be set to NULL to include all hosts in the network.You use this base class to derive your own callback object to be invoked every time an object becomes available or unavailable. You specify the criteria for the object or objects in which you are interested. You register your TriggerHandler object using the Agent::reg_trigger method, described in “TriggerHandler”.You should include the locate_c.hh file when you use this class.This method is invoked by the Location Service when an object instance matching the criteria specified in desc becomes accessible.