diff options
Diffstat (limited to 'TAO/examples/Simple')
-rw-r--r-- | TAO/examples/Simple/Simple_util.cpp | 59 | ||||
-rw-r--r-- | TAO/examples/Simple/echo/Echo_i.cpp | 18 |
2 files changed, 48 insertions, 29 deletions
diff --git a/TAO/examples/Simple/Simple_util.cpp b/TAO/examples/Simple/Simple_util.cpp index ef3f2fdab7e..b0d60aca70f 100644 --- a/TAO/examples/Simple/Simple_util.cpp +++ b/TAO/examples/Simple/Simple_util.cpp @@ -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,24 +81,33 @@ 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 ())); - - - CORBA::Object_var table_object = - orb->resolve_initial_references ("IORTable"); + "Adding (KEY:IOR) %s:%s\n", + this->ins_, + ior.in ())); - IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in ()); - if (CORBA::is_nil (adapter.in ())) + ACE_NEW_TRY_ENV { - ACE_ERROR ((LM_ERROR, "Nil IORTable\n")); + 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 ()); + + adapter->bind (this->ins_, ior.in ()); } - else + ACE_CATCHANY { - adapter->bind (this->ins_, ior.in ()); + if (CORBA::is_nil (adapter.in ())) + { + ACE_ERROR ((LM_ERROR, "Nil IORTable\n")); + } + } + ACE_ENDTRY; + + return 0; } @@ -167,18 +176,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 diff --git a/TAO/examples/Simple/echo/Echo_i.cpp b/TAO/examples/Simple/echo/Echo_i.cpp index 4ccb450bbfe..2cb23214cbb 100644 --- a/TAO/examples/Simple/echo/Echo_i.cpp +++ b/TAO/examples/Simple/echo/Echo_i.cpp @@ -34,7 +34,7 @@ Echo_i::orb (CORBA::ORB_ptr o) Echo::List * Echo_i::echo_list (const char *message, - CORBA::Environment &) + CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_UNUSED_ARG (message); @@ -48,9 +48,19 @@ Echo_i::echo_list (const char *message, list->length (3); // Just do something to get a list of object references. - (*list)[0] = orb_->resolve_initial_references ("NameService"); - (*list)[1] = orb_->resolve_initial_references ("NameService");; - (*list)[2] = orb_->resolve_initial_references ("NameService");; + (*list)[0] = + orb_->resolve_initial_references ("NameService", + ACE_TRY_ENV); + ACE_CHECK; + + (*list)[1] = + orb_->resolve_initial_references ("NameService", + ACE_TRY_ENV);; + ACE_CHECK; + (*list)[2] = + orb_->resolve_initial_references ("NameService", + ACE_TRY_ENV); + ACE_CHECK; return list; } |