diff options
Diffstat (limited to 'TAO/examples')
-rw-r--r-- | TAO/examples/Simple/Simple_util.cpp | 59 | ||||
-rw-r--r-- | TAO/examples/Simple/echo/Echo_i.cpp | 18 | ||||
-rw-r--r-- | TAO/examples/Simulator/Event_Supplier/DOVE_Supplier.cpp | 11 | ||||
-rw-r--r-- | TAO/examples/Simulator/Event_Supplier/DualEC_Sup.cpp | 8 | ||||
-rw-r--r-- | TAO/examples/Simulator/Event_Supplier/Event_Con.cpp | 8 |
5 files changed, 68 insertions, 36 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; } diff --git a/TAO/examples/Simulator/Event_Supplier/DOVE_Supplier.cpp b/TAO/examples/Simulator/Event_Supplier/DOVE_Supplier.cpp index 7a97e9438eb..a37a13b0388 100644 --- a/TAO/examples/Simulator/Event_Supplier/DOVE_Supplier.cpp +++ b/TAO/examples/Simulator/Event_Supplier/DOVE_Supplier.cpp @@ -70,7 +70,9 @@ DOVE_Supplier::init (void) { // Connect to the RootPOA. CORBA::Object_var poaObject_var = - TAO_ORB_Core_instance()->orb()->resolve_initial_references("RootPOA"); + TAO_ORB_Core_instance()->orb()->resolve_initial_references("RootPOA", + ACE_TRY_ENV); + ACE_TRY_CHECK; if (CORBA::is_nil (poaObject_var.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -87,7 +89,10 @@ DOVE_Supplier::init (void) // Get the Naming Service object reference. CORBA::Object_var namingObj_var = - TAO_ORB_Core_instance()->orb()->resolve_initial_references ("NameService"); + TAO_ORB_Core_instance()->orb()->resolve_initial_references ( + "NameService", + ACE_TRY_ENV); + ACE_TRY_CHECK; if (CORBA::is_nil (namingObj_var.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -414,7 +419,7 @@ DOVE_Supplier::connect_Supplier () this->current_connection_params_->scheduler_var_-> set (this->current_connection_params_->rt_info_, ACE_static_cast (RtecScheduler::Criticality_t, - this->current_connection_params_->pod_rt_info_.criticality), + this->current_connection_params_->pod_rt_info_.criticality), this->current_connection_params_->pod_rt_info_.worst_case_execution_time, this->current_connection_params_->pod_rt_info_.typical_execution_time, this->current_connection_params_->pod_rt_info_.cached_execution_time, diff --git a/TAO/examples/Simulator/Event_Supplier/DualEC_Sup.cpp b/TAO/examples/Simulator/Event_Supplier/DualEC_Sup.cpp index 9f964d23df8..aea34f9bdd3 100644 --- a/TAO/examples/Simulator/Event_Supplier/DualEC_Sup.cpp +++ b/TAO/examples/Simulator/Event_Supplier/DualEC_Sup.cpp @@ -179,7 +179,8 @@ DualEC_Supplier::init () { // Connect to the RootPOA. CORBA::Object_var poaObject_var = - TAO_ORB_Core_instance()->orb()->resolve_initial_references("RootPOA"); + TAO_ORB_Core_instance()->orb()->resolve_initial_references("RootPOA", ACE_TRY_ENV); + ACE_TRY_CHECK; if (CORBA::is_nil (poaObject_var.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -199,7 +200,10 @@ DualEC_Supplier::init () // Get the Naming Service object reference. CORBA::Object_var namingObj_var = - TAO_ORB_Core_instance()->orb()->resolve_initial_references ("NameService"); + TAO_ORB_Core_instance()->orb()->resolve_initial_references ( + "NameService", + ACE_TRY_ENV); + ACE_TRY_CHECK; if (CORBA::is_nil (namingObj_var.in ())) ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp b/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp index 14766b7a4ea..0d56c1a5aaf 100644 --- a/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp +++ b/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp @@ -286,7 +286,9 @@ main (int argc, char *argv []) ACE_TRY_CHECK; CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA"); + orb->resolve_initial_references("RootPOA", + ACE_TRY_ENV); + ACE_TRY_CHECK; if (CORBA::is_nil (poa_object.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -302,7 +304,9 @@ main (int argc, char *argv []) ACE_TRY_CHECK; CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService"); + orb->resolve_initial_references ("NameService", + ACE_TRY_ENV); + ACE_TRY_CHECK; if (CORBA::is_nil (naming_obj.in ())) ACE_ERROR_RETURN ((LM_ERROR, |