diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-03-08 18:43:54 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-03-08 18:43:54 +0000 |
commit | a3f118b02528a9cfbde19db14752734a21d90833 (patch) | |
tree | 9f6e0af3bcd27fb862ced79acd093234e5060034 /TAO/examples/Simple | |
parent | 19b2fef01a6d6b2df7e39d48aac2379804724a78 (diff) | |
download | ATCD-a3f118b02528a9cfbde19db14752734a21d90833.tar.gz |
ChangeLogTag: Thu Mar 8 12:39:21 2001 Balachandran Natarajan <bala@cs.wustl.edu>
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; } |