diff options
author | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-05-01 21:00:46 +0000 |
---|---|---|
committer | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-05-01 21:00:46 +0000 |
commit | 001a3d6818022ca13c3389d330a1df64a7d1e82f (patch) | |
tree | 9928bec0d50af5f29de8504206b1144f2f56a8a0 | |
parent | 23a919ce7d8204c1dfe54e8702b63bb54999e978 (diff) | |
download | ATCD-001a3d6818022ca13c3389d330a1df64a7d1e82f.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp | 115 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h | 4 |
3 files changed, 54 insertions, 74 deletions
diff --git a/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp index 0f18a7bcec5..cc20c12f645 100644 --- a/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp @@ -106,14 +106,11 @@ TAO_NS_EventChannel_Command::create_colocated_ecf (ACE_ENV_SINGLE_ARG_DECL) PortableServer::POA_var poa; CosNaming::NamingContextExt_var naming; - LOOKUP_MANAGER->resolve (orb ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + LOOKUP_MANAGER->resolve (orb); - LOOKUP_MANAGER->resolve (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + LOOKUP_MANAGER->resolve (poa); - LOOKUP_MANAGER->resolve (naming ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + LOOKUP_MANAGER->resolve (naming); notify_service->init (orb.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp index 549ba61e21f..ea69a58065d 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp @@ -194,21 +194,9 @@ TAO_NS_Periodic_Supplier::activate (ACE_Barrier* barrier) return 0; } -int -TAO_NS_Periodic_Supplier::svc (void) +void +TAO_NS_Periodic_Supplier::handle_svc (ACE_ENV_SINGLE_ARG_DECL) { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Thread_Task (%t) - wait\n")); - - // First, wait for other threads. - this->barrier_->wait (); - - // first thread here inits the Base_Time. - stats_.base_time (BASE_TIME::instance ()->base_time_); - - // now wait till the phase_ period expires. - ACE_OS::sleep (ACE_Time_Value (0, phase_)); - // populate event. // send the base time and max count. TimeBase::TimeT base_time; @@ -222,29 +210,11 @@ TAO_NS_Periodic_Supplier::svc (void) buffer <<= this->iter_; zeroth_event.opt_header ("MaxCount", buffer); - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "(%P, %t) Supplier (%s) sending event 0th event\n")); + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "(%P, %t) Supplier (%s) sending event 0th event\n")); - this->send_event (zeroth_event.event () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::UserException, ue) - { - ACE_PRINT_EXCEPTION (ue, - "Periodic supplier: error sending event. "); - break; - } - ACE_CATCH (CORBA::SystemException, se) - { - ACE_PRINT_EXCEPTION (se, - "Periodic supplier: error sending event. "); - break; - } - ACE_ENDTRY; + this->send_event (zeroth_event.event () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); @@ -264,46 +234,22 @@ TAO_NS_Periodic_Supplier::svc (void) this->event_.payload (buffer); - if (this->run_time_ != 0 && ACE_OS::gettimeofday () > run_time) + if (this->run_time_ != 0 && ACE_OS::gettimeofday () > run_time) { // Time up, send a "Stop" event. CORBA::Any buffer; - buffer <<= (long) 1; + buffer <<= (CORBA::Long) 1; this->event_.opt_header ("Stop", buffer); - i = iter_; // Load the iter so that the loop exits. + i = iter_; // Load the iter so that the loop exits. } - ACE_TRY - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "(%P, %t) Supplier (%s) sending event #%d\n", - this->proxy_name_.c_str (), i)); - - this->send_event (this->event_.event () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::UserException, ue) - { - ACE_PRINT_EXCEPTION (ue, - "Periodic supplier: error sending event. "); - break; - } - ACE_CATCH (CORBA::SystemException, se) - { - ACE_PRINT_EXCEPTION (se, - "Periodic supplier: error sending event. "); - break; - } - ACE_ENDTRY; + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "(%P, %t) Supplier (%s) sending event #%d\n", + this->proxy_name_.c_str (), i)); - /*ACE_CATCHANY - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Periodic supplier: error sending event %s\n")); - break; - } - ACE_ENDTRY;*/ + this->send_event (this->event_.event () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; after = ACE_OS::gethrtime (); @@ -347,6 +293,39 @@ TAO_NS_Periodic_Supplier::svc (void) if (this->client_) this->client_->done (this); +} + +int +TAO_NS_Periodic_Supplier::svc (void) +{ + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "Thread_Task (%t) - wait\n")); + + // First, wait for other threads. + this->barrier_->wait (); + + // first thread here inits the Base_Time. + stats_.base_time (BASE_TIME::instance ()->base_time_); + + // now wait till the phase_ period expires. + ACE_OS::sleep (ACE_Time_Value (0, phase_)); + + ACE_TRY_NEW_ENV + { + this->handle_svc (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::UserException, ue) + { + ACE_PRINT_EXCEPTION (ue, + "Periodic supplier: error sending event. "); + } + ACE_CATCH (CORBA::SystemException, se) + { + ACE_PRINT_EXCEPTION (se, + "Periodic supplier: error sending event. "); + } + ACE_ENDTRY; return 0; } diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h index d7b81071b02..febb384a070 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h +++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h @@ -71,6 +71,10 @@ public: const char* proxy_name (void); protected: + + /// svc method. + void handle_svc (ACE_ENV_SINGLE_ARG_DECL); + /// The name of the proxy we connect to. ACE_CString proxy_name_; |