diff options
Diffstat (limited to 'TAO/tao/PortableServer/Object_Adapter.cpp')
-rw-r--r-- | TAO/tao/PortableServer/Object_Adapter.cpp | 155 |
1 files changed, 46 insertions, 109 deletions
diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 8c854b27170..32b5513fe66 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -342,8 +342,7 @@ TAO_Object_Adapter::create_lock (int enable_locking, int TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key, TAO_ServerRequest &req, - CORBA::Object_out forward_to - ) + CORBA::Object_out forward_to) { ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START); @@ -354,11 +353,7 @@ TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key, // Set up state in the POA et al (including the POA Current), so // that we know that this servant is currently in an upcall. const char *operation = req.operation (); - int result = - servant_upcall.prepare_for_upcall (key, - operation, - forward_to - ); + int result = servant_upcall.prepare_for_upcall (key, operation, forward_to); if (result != TAO_Adapter::DS_OK) return result; @@ -366,13 +361,11 @@ TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key, // Preprocess request. if (req.collocated ()) { - servant_upcall.pre_invoke_collocated_request ( - ); + servant_upcall.pre_invoke_collocated_request (); } else { - servant_upcall.pre_invoke_remote_request (req - ); + servant_upcall.pre_invoke_remote_request (req); } // Servant dispatch. @@ -401,8 +394,7 @@ TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key, void TAO_Object_Adapter::locate_poa (const TAO::ObjectKey &key, PortableServer::ObjectId &system_id, - TAO_Root_POA *&poa - ) + TAO_Root_POA *&poa) { TAO_Object_Adapter::poa_name poa_system_name; CORBA::Boolean is_root = false; @@ -434,8 +426,7 @@ TAO_Object_Adapter::locate_poa (const TAO::ObjectKey &key, is_persistent, is_root, poa_creation_time, - poa - ); + poa); } if (result != 0) @@ -444,8 +435,7 @@ TAO_Object_Adapter::locate_poa (const TAO::ObjectKey &key, int TAO_Object_Adapter::activate_poa (const poa_name &folded_name, - TAO_Root_POA *&poa - ) + TAO_Root_POA *&poa) { int result = -1; @@ -457,8 +447,7 @@ TAO_Object_Adapter::activate_poa (const poa_name &folded_name, TAO_Root_POA *parent = this->root_; if (parent == 0 || parent->name () != *iterator) - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - -1); + throw ::CORBA::OBJ_ADAPTER (); else ++iterator; @@ -470,9 +459,7 @@ TAO_Object_Adapter::activate_poa (const poa_name &folded_name, try { - current = parent->find_POA_i (*iterator, - 1 - ); + current = parent->find_POA_i (*iterator, 1); } catch (const PortableServer::POA::AdapterNonExistent&) { @@ -496,8 +483,7 @@ int TAO_Object_Adapter::find_transient_poa (const poa_name &system_name, CORBA::Boolean root, const TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time, - TAO_Root_POA *&poa - ) + TAO_Root_POA *&poa) { int result = 0; @@ -507,8 +493,7 @@ TAO_Object_Adapter::find_transient_poa (const poa_name &system_name, } else { - result = this->transient_poa_map_->find (system_name, - poa); + result = this->transient_poa_map_->find (system_name, poa); } if (poa == 0 @@ -524,12 +509,9 @@ TAO_Object_Adapter::bind_poa (const poa_name &folded_name, poa_name_out system_name) { if (poa->persistent ()) - return this->bind_persistent_poa (folded_name, - poa, - system_name); + return this->bind_persistent_poa (folded_name, poa, system_name); else - return this->bind_transient_poa (poa, - system_name); + return this->bind_transient_poa (poa, system_name); } int @@ -538,31 +520,24 @@ TAO_Object_Adapter::unbind_poa (TAO_Root_POA *poa, const poa_name &system_name) { if (poa->persistent ()) - return this->unbind_persistent_poa (folded_name, - system_name); + return this->unbind_persistent_poa (folded_name, system_name); else return this->unbind_transient_poa (system_name); } int -TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key - ) +TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key) { ACE_FUNCTION_TIMEPROBE (TAO_POA_LOCATE_SERVANT_START); PortableServer::ObjectId id; TAO_Root_POA *poa = 0; - this->locate_poa (key, - id, - poa - ); + this->locate_poa (key, id, poa); PortableServer::Servant servant = 0; TAO_SERVANT_LOCATION servant_location = - poa->locate_servant_i (id, - servant - ); + poa->locate_servant_i (id, servant); switch (servant_location) { @@ -586,14 +561,9 @@ TAO_Object_Adapter::find_servant_i (const TAO::ObjectKey &key, PortableServer::ObjectId id; TAO_Root_POA *poa = 0; - this->locate_poa (key, - id, - poa); - - TAO_SERVANT_LOCATION servant_location = poa->locate_servant_i (id, - servant); + this->locate_poa (key, id, poa); - return servant_location; + return poa->locate_servant_i (id, servant); } void @@ -618,8 +588,7 @@ TAO_Object_Adapter::open (void) ::CORBA::PolicyList policy; PortableServer::POAManager_var poa_manager = poa_manager_factory_->create_POAManager (TAO_DEFAULT_ROOTPOAMANAGER_NAME, - policy - ); + policy); #else PortableServer::POAManager_ptr poa_manager_ptr; ::CORBA::PolicyList policy_list; @@ -655,8 +624,7 @@ TAO_Object_Adapter::open (void) #endif /* TAO_HAS_MINIMUM_POA == 0 */ // Merge policies from the ORB level. - this->validator ().merge_policies (policies.policies () - ); + this->validator ().merge_policies (policies.policies ()); // If any of the policy objects specified are not valid for the ORB // implementation, if conflicting policy objects are specified, or @@ -664,9 +632,7 @@ TAO_Object_Adapter::open (void) // administrative action that has not been performed, an // InvalidPolicy exception is raised containing the index in the // policies parameter value of the first offending policy object. - policies.validate_policies (this->validator (), - this->orb_core_ - ); + policies.validate_policies (this->validator (), this->orb_core_); // Construct a new POA TAO_Root_POA::String root_poa_name (TAO_DEFAULT_ROOTPOA_NAME); @@ -677,8 +643,7 @@ TAO_Object_Adapter::open (void) this->lock (), this->thread_lock (), this->orb_core_, - this - ); + this); // The Object_Adapter will keep a reference to the Root POA so that // on its destruction, it can check whether the Root POA has been @@ -695,8 +660,7 @@ TAO_Object_Adapter::open (void) } void -TAO_Object_Adapter::close (int wait_for_completion - ) +TAO_Object_Adapter::close (int wait_for_completion) { this->check_close (wait_for_completion); @@ -726,10 +690,8 @@ TAO_Object_Adapter::close (int wait_for_completion this->poa_manager_factory_ = 0; #endif } - CORBA::Boolean etherealize_objects = 1; - root->destroy (etherealize_objects, - wait_for_completion - ); + CORBA::Boolean etherealize_objects = true; + root->destroy (etherealize_objects, wait_for_completion); ::CORBA::release (root); #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) release_poa_manager_factory (factory); @@ -737,12 +699,10 @@ TAO_Object_Adapter::close (int wait_for_completion } void -TAO_Object_Adapter::check_close (int wait_for_completion - ) +TAO_Object_Adapter::check_close (int wait_for_completion) { TAO_Root_POA::check_for_valid_wait_for_completions (this->orb_core (), - wait_for_completion - ); + wait_for_completion); } int @@ -754,8 +714,7 @@ TAO_Object_Adapter::priority (void) const int TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, TAO_ServerRequest &request, - CORBA::Object_out forward_to - ) + CORBA::Object_out forward_to) { if (key.length() < TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE || ACE_OS::memcmp (key.get_buffer (), @@ -783,8 +742,7 @@ TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, 0, // servant_upcall 0, // exceptions 0, // nexceptions - ocs.out () - ); + ocs.out ()); /// If we have a cached result, just go ahead and send the reply /// and let us return @@ -814,8 +772,7 @@ TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, 0, // nargs 0, // servant_upcall 0, // exceptions - 0 // nexceptions - ); + 0); // nexceptions // If a PortableInterceptor::ForwardRequest exception was // thrown, then set the forward_to object reference and return @@ -828,10 +785,7 @@ TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, } #endif /* TAO_HAS_INTERCEPTORS == 1 */ - result = this->dispatch_servant (key, - request, - forward_to - ); + result = this->dispatch_servant (key, request, forward_to); #if TAO_HAS_INTERCEPTORS == 1 @@ -868,11 +822,9 @@ TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, 0, // nargs 0, // servant_upcall 0, // exceptions - 0 // nexceptions - ); + 0); // nexceptions - status = - request.reply_status (); + status = request.reply_status (); } // Only re-throw the exception if it hasn't been transformed by @@ -983,11 +935,9 @@ TAO_Object_Adapter::get_collocated_servant (const TAO_MProfile &mp) try { - this->find_servant (objkey.in (), - servant - ); + this->find_servant (objkey.in (), servant); } - catch ( ::CORBA::Exception&) + catch (const ::CORBA::Exception&) { } @@ -1021,8 +971,7 @@ TAO_Object_Adapter::Active_Hint_Strategy::~Active_Hint_Strategy (void) int TAO_Object_Adapter::Active_Hint_Strategy::find_persistent_poa ( const poa_name &system_name, - TAO_Root_POA *&poa - ) + TAO_Root_POA *&poa) { poa_name folded_name; int result = this->persistent_poa_system_map_.recover_key (system_name, @@ -1030,8 +979,7 @@ TAO_Object_Adapter::Active_Hint_Strategy::find_persistent_poa ( if (result == 0) { - result = this->persistent_poa_system_map_.find (system_name, - poa); + result = this->persistent_poa_system_map_.find (system_name, poa); if (result != 0 || folded_name != poa->folded_name ()) { @@ -1040,10 +988,7 @@ TAO_Object_Adapter::Active_Hint_Strategy::find_persistent_poa ( poa); if (result != 0) { - result = - this->object_adapter_->activate_poa (folded_name, - poa - ); + result = this->object_adapter_->activate_poa (folded_name, poa); } } } @@ -1099,8 +1044,7 @@ TAO_Object_Adapter::No_Hint_Strategy::~No_Hint_Strategy (void) int TAO_Object_Adapter::No_Hint_Strategy::find_persistent_poa ( const poa_name &system_name, - TAO_Root_POA *&poa - ) + TAO_Root_POA *&poa) { int result = this->object_adapter_->persistent_poa_name_map_->find (system_name, @@ -1108,9 +1052,7 @@ TAO_Object_Adapter::No_Hint_Strategy::find_persistent_poa ( if (result != 0) { result = - this->object_adapter_->activate_poa (system_name, - poa - ); + this->object_adapter_->activate_poa (system_name, poa); } return result; @@ -1123,8 +1065,7 @@ TAO_Object_Adapter::No_Hint_Strategy::bind_persistent_poa ( poa_name_out system_name) { int result = - this->object_adapter_->persistent_poa_name_map_->bind (folded_name, - poa); + this->object_adapter_->persistent_poa_name_map_->bind (folded_name, poa); if (result == 0) ACE_NEW_RETURN (system_name, poa_name (folded_name), @@ -1240,8 +1181,7 @@ TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete (void) ACE_OS::thr_self ())) { // If so wait... - int result = - this->non_servant_upcall_condition_.wait (); + int const result = this->non_servant_upcall_condition_.wait (); if (result == -1) throw ::CORBA::OBJ_ADAPTER (); } @@ -1255,7 +1195,7 @@ TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete_no_throw (void) { this->wait_for_non_servant_upcalls_to_complete (); } - catch ( ::CORBA::Exception&) + catch (const ::CORBA::Exception&) { ACE_ERROR ((LM_ERROR, "TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete " @@ -1274,12 +1214,9 @@ TAO_Object_Adapter::servant_dispatcher (TAO_Servant_Dispatcher *dispatcher) void TAO_Object_Adapter::do_dispatch (TAO_ServerRequest& req, - TAO::Portable_Server::Servant_Upcall& upcall - ) + TAO::Portable_Server::Servant_Upcall& upcall) { - upcall.servant ()->_dispatch(req, - &upcall - ); + upcall.servant ()->_dispatch(req, &upcall); } TAO_END_VERSIONED_NAMESPACE_DECL |