LocationService all_instances_descs() question

LocationService all_instances_descs() question

Post by Nikolay Arbuzo » Wed, 07 Aug 2002 11:56:30



Hello,

We just moved to version 5 of Visibroker and also moving all
code to POA. My job is writing monitoring tools for our applications.
So I don't know much about CORBA.
In old version I used `osfind' and was prety happy with it. In the
new version it's a Java class which can't be used in my environment for some reasons. So I need to have something similar in C++.

Problem I having is that my program (follow bellow) not finding all the registred objects while `osfind' is working fine. Does sombody had similar
problem and know solution to it? Please see output below. objects
that my programm missing are `/lucent_server' and `/cisco_server'.

Instead of using all_instances_descs I tried all_replica_descs and it
actually working if full object name is specified. But this is
not exactly what I want.

Thanks.

#include "corba.h"
#include "locate_c.hh"

USE_STD_NS

int main(int argc, char **argv) {
    try {
        CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
        CORBA::Object_var obj = orb->resolve_initial_references("LocationService
");

        if (CORBA::is_nil(obj)) {
            cout << "Unable to locate LocationService " << endl;
            return 1;
        }

    ObjLocation::Agent_var the_agent = ObjLocation::Agent::_narrow(obj);

    ObjLocation::DescSeq_var descriptors;

    ObjLocation::HostnameSeq_var HostsRunningAgents = the_agent->all_agent_locat
ions();
    for (CORBA::ULong k=0; k<HostsRunningAgents->length(); k++) {
        cout << (const char *) HostsRunningAgents[k] << endl;
    }
    cout << endl;
    ObjLocation::RepositoryIdSeq_var repIds = the_agent->all_repository_ids();
    for (CORBA::ULong i=0; i < repIds->length(); i++) {
        descriptors = the_agent->all_instances_descs(repIds[i]);
 //     descriptors = the_agent->all_replica_descs(repIds[i], "/lucent_server");
        cout << "REPOSITORY ID: " << (const char *) (repIds[i])
             << " num " <<  descriptors->length() << endl;
        for (CORBA::ULong j=0; j < descriptors->length(); j++) {
            cout << "OBJECT: " << descriptors[j].instance_name << endl;
        }
    }
    } catch (const CORBA::Exception& e) {
        cout << "CORBA exception: " << e << endl;
        return 1;
    }
    return 0;

Quote:}

----------------------------------------------------------------------
and result is:


192.168.0.193
flounder
tst28

REPOSITORY ID: IDL:visigenic.com/Activation/OAD:1.0 num 1
OBJECT: 135.16.154.6
REPOSITORY ID: * num 0                                    <<< Should be 2 objects here
REPOSITORY ID: IDL:PortConfig/AutoConfig:1.0 num 1
OBJECT: PORTCONFIGBO
REPOSITORY ID: IDL:Clibsvr/Clib:1.0 num 1
OBJECT: CLIBBO

and osfind

osfind: Found 3 agents at port 35200
        HOST: flounder-hsp
        HOST: 192.168.0.193
        HOST: tst28

osfind: Found 1 OADs in your domain
        HOST: flounder

osfind: Following are the list of Implementations registered with OADs.
        HOST: flounder

                REPOSITORY ID: IDL:PortConfig/AutoConfig:1.0
                        OBJECT NAME: PORTCONFIGBO

                REPOSITORY ID: IDL:Clibsvr/Clib:1.0
                        OBJECT NAME: CLIBBO

osfind: Following are the list of Implementations started manually.
        HOST: tst28

                REPOSITORY ID: *
                        POA NAME: /cisco_server       <<< missing in my
                        POA NAME: /lucent_server      <<< program
        HOST: flounder

                REPOSITORY ID: IDL:visigenic.com/Activation/OAD:1.0
                        OBJECT NAME: 135.16.154.6

 
 
 

1. VB console hangs when running LocationService

Hi,

We have an envirnonment with two Solaris 8 hosts each running osagent on the
same subnet. When I try to run the VB 4.5 C++  console on my (or any other)
workstation on the same subnet it will hang when trying to resolving the
LocationService ObjectInstance display. It shows the SmartAgent instances
correctly, but are not able to show the list of available object instances.

I have specified localaddr files on the two hosts running the osagent, but
this seems to make no difference, and according to the documentation use of
localaddr is not necessary on multihomed hosts when using UNIX.

Any ideas?

Regards,
Bjarte

2. Settings Manager > Scale

3. LocationService-VBroker

4. Algun correo con macros?

5. Funny behavior w/ VisiBroker LocationService

6. cannot create file "d:\inetpub\wwwroot\xxx\"

7. Questions, questions, questions

8. Problems building DBD::Informix on Solaris

9. Questions, questions, questions...

10. Questions Questions

11. questions....questions

12. Hook up question...dumb question cuz I'm an idiot.

13. Questions about OS4/Intel Re: Questions about OS4/Intel