diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-11-04 14:23:05 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-11-04 14:23:05 +0000 |
commit | 5de054ce3092c1b10a2e95c616e66ed090b49066 (patch) | |
tree | 79597393c7dd80b999ab40e0c5bf4277348cafe9 | |
parent | 59d971e152bc3f57b61ef5a93ee0556a1ef3695b (diff) | |
download | ATCD-5de054ce3092c1b10a2e95c616e66ed090b49066.tar.gz |
ChangeLogTag: Thu Nov 04 08:20:55 1999 Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
-rw-r--r-- | TAO/ChangeLog-99c | 27 | ||||
-rw-r--r-- | TAO/utils/nslist/README | 13 | ||||
-rw-r--r-- | TAO/utils/nslist/nslist.cpp | 97 |
3 files changed, 115 insertions, 22 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 8fac664b9ae..7e4551f401b 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,8 @@ +Thu Nov 04 08:20:55 1999 Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov> + + * utils/nslist/nslist.cpp,README: added support for + --ior and --nsior options. + Tue Nov 2 21:19:42 1999 Darrell Brunsch <brunsch@cs.wustl.edu> * tao/ORB.h: @@ -12,21 +17,21 @@ Tue Nov 2 21:19:42 1999 Darrell Brunsch <brunsch@cs.wustl.edu> * orbsvcs/ImplRepo_Service/ImplRepo_i.cpp: Also, there was the possiblity of the IR starting up a server more than once, if its information was updated - during a startup. Thanks to Karl Proese + during a startup. Thanks to Karl Proese <karl.proese@mchp.siemens.de> for reporting this and a fix. [Bug 368] - + * orbsvcs/tests/ImplRepo/airplane_server_i.cpp: * orbsvcs/tests/ImplRepo/airplane_server_i.h: * orbsvcs/tests/ImplRepo/nestea_server_i.cpp: * orbsvcs/tests/ImplRepo/nestea_server_i.h: Based on a request from David Dunn <dunn@tripos.com>, the code for the POA names and server names usage in the tests were made - more detailed. [Bug 362]. While I was there, I also removed + more detailed. [Bug 362]. While I was there, I also removed the usage of TAO's ORB Manager and replaced with native calls. * orbsvcs/tests/ImplRepo/run_test.pl: - The server names changed somewhat, so the test needed to be + The server names changed somewhat, so the test needed to be changed to accomodate that. Also, it seems that the both_ir option was broken since it was using the wrong name for the nestea server. @@ -37,17 +42,17 @@ Tue Nov 2 21:19:42 1999 Darrell Brunsch <brunsch@cs.wustl.edu> * tao/params.h: * tao/params.i: * docs/Options.html: - Added a new option to the ORB, -ORBMulticast 0/1 which allows - someone to turn off the use of multicast in resolve_init_refs (). - This will be more important once the IR is integrated into the + Added a new option to the ORB, -ORBMulticast 0/1 which allows + someone to turn off the use of multicast in resolve_init_refs (). + This will be more important once the IR is integrated into the POA. Mon Nov 1 16:19:21 1999 Jeff Parsons <parsons@cs.wustl.edu> - * docs/releasenotes/TODO.html: - Moved item about IDL compiler adding extra value to - force enums to be 32 bits wide to the 'Tasks - Completed' list. + * docs/releasenotes/TODO.html: + Moved item about IDL compiler adding extra value to + force enums to be 32 bits wide to the 'Tasks + Completed' list. Mon Nov 01 14:30:19 1999 David L. Levine <levine@cs.wustl.edu> diff --git a/TAO/utils/nslist/README b/TAO/utils/nslist/README index f005fda5784..77264b7b4c0 100644 --- a/TAO/utils/nslist/README +++ b/TAO/utils/nslist/README @@ -3,7 +3,7 @@ $Id$ This utility lists the current entries in the Naming Service in a nicely formatted manner. To run it, just type -% nslist +% nslist [ --ior | --nsior ] and it'll print the contents of the default "NameService" returned by resolve_initial_references(). You can select the IOR of this @@ -11,3 +11,14 @@ NameService via the options described in $TAO_ROOT/docs/Options.html +nslist accepts two other options: + +% nslist --ior + +will print the contents of the NameService, including the IOR of each +reference entry and the IOR of the NameService itself. + +% nslist --nsior + +will print *only* the IOR of the NameService itself, with no other text. +This can be used to locate the TAO NameService for non-TAO applications. diff --git a/TAO/utils/nslist/nslist.cpp b/TAO/utils/nslist/nslist.cpp index 8fec1c122a4..935c5d3b070 100644 --- a/TAO/utils/nslist/nslist.cpp +++ b/TAO/utils/nslist/nslist.cpp @@ -19,6 +19,10 @@ #include "tao/TAO.h" #include "orbsvcs/CosNamingC.h" +CORBA::ORB_var orb; +int showIOR = 0; +int showNSonly = 0; + static void list_context (CosNaming::NamingContext_ptr nc, int level); // Display NS entries from a finite list. @@ -28,6 +32,8 @@ show_chunk (CosNaming::NamingContext_ptr nc, const CosNaming::BindingList &bl, int level) { + ACE_DECLARE_NEW_CORBA_ENV; + for (CORBA::ULong i = 0; i < bl.length (); i++) @@ -43,6 +49,13 @@ show_chunk (CosNaming::NamingContext_ptr nc, "(%s)", bl[i].binding_name[0].kind.in ())); + CosNaming::Name Name; + Name.length (1); + Name[0].id = + CORBA::string_dup (bl[i].binding_name[0].id); + + CORBA::Object_var obj = nc->resolve (Name); + // If this is a context node, follow it down to the next // level... if (bl[i].binding_type == CosNaming::ncontext) @@ -65,9 +78,23 @@ show_chunk (CosNaming::NamingContext_ptr nc, } // Mark this node as a reference else - // The next version should resolve and show the IOR... - ACE_DEBUG ((LM_DEBUG, - ": reference\n")); + { + if (showIOR) + { + CORBA::Object_var obj = nc->resolve (Name); + CORBA::String_var str = + orb->object_to_string (obj.in (), + ACE_TRY_ENV); + ACE_DEBUG ((LM_DEBUG, + ": <%s>\n", + str.in ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, + ": reference\n")); + } + } } } @@ -100,12 +127,45 @@ list_context (CosNaming::NamingContext_ptr nc, int main (int argc, char *argv[]) { + showIOR = 0; + showNSonly = 0; + ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); + orb = CORBA::ORB_init (argc, argv); + + char *pname = argv[0]; + + while (argc > 0) + { + if (strcmp(*argv, "--ior") == 0) + { + if (showNSonly) + { + ACE_DEBUG ((LM_DEBUG, "Error: --nsior and --ior are both specified\n")); + return 1; + } + showIOR = 1; + } + else if (strcmp(*argv, "--nsior") == 0) + { + if (showIOR) + { + ACE_DEBUG ((LM_DEBUG, "Error: --nsior and --ior are both specified\n")); + return 1; + } + showNSonly = 1; + } + else if (strncmp(*argv, "--", 2) == 0) + { + ACE_DEBUG ((LM_DEBUG, "Usage: %s [ --ior | --nsior ]\n", pname)); + return 1; + } + argc--; + argv++; + } CORBA::Object_var obj; obj = orb->resolve_initial_references ("NameService"); @@ -125,11 +185,28 @@ main (int argc, char *argv[]) "Naming Service not found"), -1); - ACE_DEBUG ((LM_DEBUG, - "Naming Service: <%s> ---------\n", - str.in ())); - - list_context (root_nc.in (), 1); + if (showNSonly) + { + // ACE_DEBUG ((LM_DEBUG, "%s", str.in ())); + printf( "%s", str.in()); + } + else + { + if (showIOR) + { + ACE_DEBUG ((LM_DEBUG, + "Naming Service: <%s>\n---------\n", + str.in ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, + "Naming Service:\n---------\n")); + } + + list_context (root_nc.in (), 1); + ACE_TRY_CHECK; + } } ACE_CATCHANY { |