diff options
Diffstat (limited to 'TAO/examples/Simple/Simple_util.cpp')
-rw-r--r-- | TAO/examples/Simple/Simple_util.cpp | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/TAO/examples/Simple/Simple_util.cpp b/TAO/examples/Simple/Simple_util.cpp index dad0b35f293..ef3f2fdab7e 100644 --- a/TAO/examples/Simple/Simple_util.cpp +++ b/TAO/examples/Simple/Simple_util.cpp @@ -1,4 +1,4 @@ -// $Id$ +//$Id$ #ifndef SIMPLE_UTIL_C #define SIMPLE_UTIL_C @@ -50,8 +50,8 @@ Server<Servant>::parse_args (void) this->naming_ = 1; break; case 'i': // For Testing the InterOperable Naming Service. - this->ins_ = CORBA::string_dup (get_opts.optarg); - break; + this->ins_ = CORBA::string_dup (get_opts.optarg); + break; case 'h': // display help for use of the server. default: ACE_ERROR_RETURN ((LM_ERROR, @@ -81,35 +81,24 @@ Server<Servant>::test_for_ins (CORBA::String_var ior) if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "Adding (KEY:IOR) %s:%s\n", - this->ins_, - ior.in ())); + "Adding (KEY:IOR) %s:%s\n", + this->ins_, + ior.in ())); - ACE_DECLARE_NEW_CORBA_ENV; + + CORBA::Object_var table_object = + orb->resolve_initial_references ("IORTable"); - ACE_TRY + IORTable::Table_var adapter = + IORTable::Table::_narrow (table_object.in ()); + if (CORBA::is_nil (adapter.in ())) { - CORBA::Object_var table_object = - orb->resolve_initial_references ("IORTable", - ACE_TRY_ENV); - ACE_TRY_CHECK; - - IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in (), - ACE_TRY_ENV); - ACE_TRY_CHECK; - if (CORBA::is_nil (adapter.in ())) - { - ACE_ERROR ((LM_ERROR, "Nil IORTable\n")); - } - - adapter->bind (this->ins_, ior.in (), ACE_TRY_ENV); - ACE_TRY_CHECK; + ACE_ERROR ((LM_ERROR, "Nil IORTable\n")); } - ACE_CATCHANY + else { + adapter->bind (this->ins_, ior.in ()); } - ACE_ENDTRY; return 0; } @@ -178,18 +167,18 @@ Server<Servant>::init (const char *servant_name, str.in ())); if (this->ins_) - if (this->test_for_ins (str) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "test_for_ins (): failed\n"), - -1); + if (this->test_for_ins (str) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "test_for_ins (): failed\n"), + -1); if (this->ior_output_file_) - { - ACE_OS::fprintf (this->ior_output_file_, - "%s", - str.in ()); - ACE_OS::fclose (this->ior_output_file_); - } + { + ACE_OS::fprintf (this->ior_output_file_, + "%s", + str.in ()); + ACE_OS::fclose (this->ior_output_file_); + } } ACE_CATCHANY |