#include <Root_POA.h>
Inheritance diagram for TAO_Root_POA:
Implementation of the PortableServer::POA interface.
Definition at line 114 of file Root_POA.h.
typedef ACE_Hash_Map_Manager_Ex< ACE_CString, TAO_Root_POA *, ACE_Hash<ACE_CString>, ACE_Equal_To<ACE_CString>, ACE_Null_Mutex > TAO_Root_POA::CHILDREN [protected] |
Definition at line 736 of file Root_POA.h.
typedef ACE_CString TAO_Root_POA::String |
Definition at line 127 of file Root_POA.h.
anonymous enum |
TAO_Root_POA::TAO_Root_POA | ( | const String & | name, | |
PortableServer::POAManager_ptr | poa_manager, | |||
const TAO_POA_Policy_Set & | policies, | |||
TAO_Root_POA * | parent, | |||
ACE_Lock & | lock, | |||
TAO_SYNCH_MUTEX & | thread_lock, | |||
TAO_ORB_Core & | orb_core, | |||
TAO_Object_Adapter * | object_adapter | |||
) |
Definition at line 186 of file Root_POA.cpp.
References TAO::Portable_Server::Active_Policy_Strategies_Cleanup_Guard::_retn(), TAO_Objref_Var_T< T >::_retn(), active_policy_strategies_, TAO_Object_Adapter::bind_poa(), cached_policies_, filter_factory_, TAO::Portable_Server::Cached_Policies::implicit_activation(), ACE_Dynamic_Service< TYPE >::instance(), TAO::Portable_Server::Active_Policy_Strategies::lifespan_strategy(), network_priority_hook_, object_adapter(), poa_manager_, TAO_POA_Manager::register_poa(), TAO_POA_Manager::remove_poa(), set_folded_name(), set_id(), ACE_OS::strcmp(), TAO_DEFAULT_ROOTPOA_NAME, TAO_Object_Adapter::unbind_poa(), TAO::Portable_Server::Active_Policy_Strategies::update(), TAO::Portable_Server::Cached_Policies::update(), and TAO_Network_Priority_Hook::update_network_priority().
00194 : name_ (name), 00195 poa_manager_ (* (dynamic_cast <TAO_POA_Manager*> (poa_manager))), 00196 00197 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) 00198 poa_manager_factory_ (* (object_adapter->poa_manager_factory_)), 00199 #endif 00200 00201 tagged_component_ (), 00202 tagged_component_id_ (), 00203 profile_id_array_ (0), 00204 policies_ (policies), 00205 ort_adapter_ (0), 00206 adapter_state_ (PortableInterceptor::HOLDING), 00207 network_priority_hook_ (0), 00208 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) 00209 adapter_activator_ (), 00210 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00211 children_ (), 00212 lock_ (lock), 00213 orb_core_ (orb_core), 00214 object_adapter_ (object_adapter), 00215 cleanup_in_progress_ (false), 00216 outstanding_requests_ (0), 00217 outstanding_requests_condition_ (thread_lock), 00218 wait_for_completion_pending_ (0), 00219 waiting_destruction_ (false), 00220 servant_deactivation_condition_ (thread_lock), 00221 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) 00222 filter_factory_ (0), 00223 #endif 00224 caller_key_to_object_ (0), 00225 servant_for_key_to_object_ (0) 00226 { 00227 // Since we are keeping a reference to a POAManager, we need to 00228 // increment the reference count but we do this safely. 00229 PortableServer::POAManager_var pm_guard ( 00230 PortableServer::POAManager::_duplicate(&this->poa_manager_)); 00231 00232 // Parse the policies that are used in the critical path in 00233 // a cache. 00234 this->cached_policies_.update (this->policies_); 00235 00236 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) 00237 this->filter_factory_ 00238 = ACE_Dynamic_Service<TAO_Acceptor_Filter_Factory>::instance ( 00239 "TAO_Acceptor_Filter_Factory"); 00240 #endif 00241 00242 this->network_priority_hook_ 00243 = ACE_Dynamic_Service<TAO_Network_Priority_Hook>::instance ( 00244 "TAO_Network_Priority_Hook"); 00245 00246 if (this->network_priority_hook_ != 0) 00247 { 00248 this->network_priority_hook_->update_network_priority ( 00249 *this, this->policies_); 00250 } 00251 00252 #if (TAO_HAS_MINIMUM_POA == 1) 00253 // If this is the RootPOA, set the value of the ImplicitActivationPolicy 00254 // to IMPLICIT_ACTIVATION since it is impossible to pass the policy 00255 // as it is not compiled into the library. 00256 // 00257 // If the ImplicitActivationPolicy policy is ever compiled in the 00258 // minimum POA builds, remove this code and remove the guards 00259 // in Object_Adapter.cpp when changing the default policy for the 00260 // RootPOA. 00261 if (ACE_OS::strcmp (this->name_.c_str (), 00262 TAO_DEFAULT_ROOTPOA_NAME) == 0) 00263 { 00264 this->cached_policies_.implicit_activation 00265 (PortableServer::IMPLICIT_ACTIVATION); 00266 } 00267 #endif /* TAO_HAS_MINIMUM_POA == 1 */ 00268 00269 // Set the active strategies to be used by this POA 00270 this->active_policy_strategies_.update (this->cached_policies_, 00271 this); 00272 TAO::Portable_Server::Active_Policy_Strategies_Cleanup_Guard aps_cleanup_guard ( 00273 &this->active_policy_strategies_); 00274 00275 // Set the folded name of this POA. 00276 this->set_folded_name (parent); 00277 00278 // Register self with manager. 00279 int result = this->poa_manager_.register_poa (this); 00280 if (result != 0) 00281 { 00282 throw ::CORBA::OBJ_ADAPTER (); 00283 } 00284 00285 // Add self to Object Adapter class. 00286 result = 00287 this->object_adapter ().bind_poa (this->folded_name_, 00288 this, 00289 this->system_name_.out ()); 00290 if (result != 0) 00291 { 00292 // Remove from POA Manager in case of errors. No checks of 00293 // further errors... 00294 this->poa_manager_.remove_poa (this); 00295 00296 throw ::CORBA::OBJ_ADAPTER (); 00297 } 00298 00299 // Set the id for this POA. 00300 this->set_id (parent); 00301 00302 // Notify the Lifespan strategy of our startup 00303 try 00304 { 00305 this->active_policy_strategies_.lifespan_strategy()->notify_startup (); 00306 } 00307 catch (const ::CORBA::Exception&) 00308 { 00309 this->poa_manager_.remove_poa (this); 00310 this->object_adapter ().unbind_poa (this, 00311 this->folded_name_, 00312 this->system_name_.in ()); 00313 throw; 00314 } 00315 00316 // Now when everything is fine we can release the quards. 00317 pm_guard._retn (); 00318 aps_cleanup_guard._retn (); 00319 }
TAO_Root_POA::~TAO_Root_POA | ( | void | ) | [virtual] |
Definition at line 321 of file Root_POA.cpp.
References CORBA::Object::_remove_ref(), and poa_manager_.
00322 { 00323 this->poa_manager_._remove_ref(); 00324 }
CORBA::ORB_ptr TAO_Root_POA::_get_orb | ( | void | ) | [virtual] |
Reimplemented from CORBA::LocalObject.
Definition at line 2670 of file Root_POA.cpp.
References CORBA::ORB::_duplicate().
02671 { 02672 return CORBA::ORB::_duplicate (this->orb_core_.orb ()); 02673 }
PortableServer::ObjectId * TAO_Root_POA::activate_object | ( | PortableServer::Servant | p_servant | ) |
Definition at line 1134 of file Root_POA.cpp.
References activate_object_i(), and TAO_POA_GUARD_RETURN.
Referenced by activate_object_i().
01135 { 01136 while (1) 01137 { 01138 bool wait_occurred_restart_call = false; 01139 01140 // Lock access for the duration of this transaction. 01141 TAO_POA_GUARD_RETURN (0); 01142 01143 PortableServer::ObjectId *result = 01144 this->activate_object_i (servant, 01145 this->server_priority (), 01146 wait_occurred_restart_call); 01147 01148 // If we ended up waiting on a condition variable, the POA state 01149 // may have changed while we are waiting. Therefore, we need to 01150 // restart this call. 01151 if (wait_occurred_restart_call) 01152 continue; 01153 else 01154 return result; 01155 } 01156 }
PortableServer::ObjectId * TAO_Root_POA::activate_object_i | ( | PortableServer::Servant | p_servant, | |
CORBA::Short | priority, | |||
bool & | wait_occurred_restart_call | |||
) |
Definition at line 1123 of file Root_POA.cpp.
References activate_object(), active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by activate_object().
01126 { 01127 return this->active_policy_strategies_.servant_retention_strategy()-> 01128 activate_object (servant, 01129 priority, 01130 wait_occurred_restart_call); 01131 }
void TAO_Root_POA::activate_object_with_id | ( | const PortableServer::ObjectId & | id, | |
PortableServer::Servant | p_servant | |||
) |
Definition at line 1160 of file Root_POA.cpp.
References activate_object_with_id_i(), and TAO_POA_GUARD.
Referenced by activate_object_with_id_i().
01162 { 01163 while (1) 01164 { 01165 bool wait_occurred_restart_call = false; 01166 01167 // Lock access for the duration of this transaction. 01168 TAO_POA_GUARD; 01169 01170 this->activate_object_with_id_i (id, 01171 servant, 01172 this->server_priority (), 01173 wait_occurred_restart_call); 01174 01175 // If we ended up waiting on a condition variable, the POA state 01176 // may have changed while we are waiting. Therefore, we need to 01177 // restart this call. 01178 if (wait_occurred_restart_call) 01179 continue; 01180 else 01181 return; 01182 } 01183 }
void TAO_Root_POA::activate_object_with_id_i | ( | const PortableServer::ObjectId & | id, | |
PortableServer::Servant | p_servant, | |||
CORBA::Short | priority, | |||
bool & | wait_occurred_restart_call | |||
) | [protected] |
Definition at line 1188 of file Root_POA.cpp.
References activate_object_with_id(), active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by activate_object_with_id().
01192 { 01193 this->active_policy_strategies_.servant_retention_strategy()-> 01194 activate_object_with_id (id, 01195 servant, 01196 priority, 01197 wait_occurred_restart_call); 01198 }
ACE_INLINE PortableInterceptor::AdapterName * TAO_Root_POA::adapter_name | ( | void | ) |
This method returns the adapter_name as a sequence of strings of length one or more or just a fixed name depending on the Object Adapter. Added wrt to ORT Spec.
Definition at line 32 of file Root_POA.inl.
References adapter_name_i().
Referenced by create_POA_i(), and ORT_adapter_i().
00033 { 00034 return this->adapter_name_i (); 00035 }
PortableInterceptor::AdapterName * TAO_Root_POA::adapter_name_i | ( | void | ) | [protected] |
This method returns the adapter_name as a sequence of strings of length one or more or just a fixed name depending on the Object Adapter. Added wrt to ORT Spec.
Definition at line 1008 of file Root_POA.cpp.
References CORBA::SystemException::_tao_minor_code(), ACE_ASSERT, ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), CORBA::string_dup(), and TAO::VMCID.
Referenced by adapter_name(), and ORT_adapter_i().
01009 { 01010 // The adapter name is the sequence of names starting from the 01011 // RootPOA to the one whose name is requested. The name of the 01012 // RootPOA is "RootPOA". 01013 01014 PortableServer::POA_var poa = PortableServer::POA::_duplicate (this); 01015 01016 CORBA::ULong len = 0; 01017 01018 // Find the length of the adapter name sequence by traversing the 01019 // POA hierarchy until the RootPOA is reached. The RootPOA has no 01020 // parent. 01021 while (!CORBA::is_nil (poa.in ())) 01022 { 01023 poa = poa->the_parent (); 01024 ++len; 01025 } 01026 01027 // Empty adapter name sequence. 01028 PortableInterceptor::AdapterName *names = 0; 01029 ACE_NEW_THROW_EX (names, 01030 PortableInterceptor::AdapterName (len), 01031 CORBA::NO_MEMORY ( 01032 CORBA::SystemException::_tao_minor_code ( 01033 TAO::VMCID, 01034 ENOMEM), 01035 CORBA::COMPLETED_NO)); 01036 01037 PortableInterceptor::AdapterName_var safe_names (names); 01038 01039 names->length (len); 01040 01041 poa = PortableServer::POA::_duplicate (this); 01042 01043 (*names)[0] = CORBA::string_dup ("RootPOA"); 01044 01045 // Fill in the AdapterName sequence as the POA hierarchy is 01046 // traversed. 01047 CORBA::ULong ilen = len; 01048 for (CORBA::ULong i = 1; i < len; ++i) 01049 { 01050 (*names)[--ilen] = poa->the_name (); 01051 01052 poa = poa->the_parent (); 01053 01054 // If this condition asserts, the POA hierarchy was modified 01055 // (i.e. reduced in size) by another thread! 01056 ACE_ASSERT ((ilen > 0 ? !CORBA::is_nil (poa.in ()) : 1)); 01057 } 01058 01059 return safe_names._retn (); 01060 }
void TAO_Root_POA::adapter_state_changed | ( | const TAO::ORT_Array & | array_obj_ref_template, | |
PortableInterceptor::AdapterState | state | |||
) | [protected] |
Method to notify the IOR Interceptors when there is a state changed not related to POAManager.
Definition at line 1109 of file Root_POA.cpp.
References TAO_IORInterceptor_Adapter::adapter_state_changed(), TAO_ORB_Core::ior_interceptor_adapter(), and orb_core_.
Referenced by complete_destruction_i(), and destroy_i().
01112 { 01113 TAO_IORInterceptor_Adapter *ior_adapter = 01114 this->orb_core_.ior_interceptor_adapter (); 01115 01116 if (ior_adapter) 01117 { 01118 ior_adapter->adapter_state_changed (array_obj_ref_template, state); 01119 } 01120 }
void TAO_Root_POA::add_ior_component | ( | TAO_MProfile & | mprofile, | |
const IOP::TaggedComponent & | component | |||
) | [protected] |
Add the given tagged component to all profiles.
Definition at line 1063 of file Root_POA.cpp.
References TAO_Profile::add_tagged_component(), TAO_MProfile::get_profile(), and TAO_MProfile::profile_count().
01065 { 01066 // Add the given tagged component to all profiles. 01067 const CORBA::ULong profile_count = mprofile.profile_count (); 01068 01069 for (CORBA::ULong i = 0; i < profile_count; ++i) 01070 { 01071 TAO_Profile *profile = mprofile.get_profile (i); 01072 01073 profile->add_tagged_component (component); 01074 } 01075 }
void TAO_Root_POA::add_ior_component_to_profile | ( | TAO_MProfile & | mprofile, | |
const IOP::TaggedComponent & | component, | |||
IOP::ProfileId | profile_id | |||
) | [protected] |
Add the given tagged component to all profiles matching the given ProfileId.
Definition at line 1078 of file Root_POA.cpp.
References TAO_Profile::add_tagged_component(), CORBA::COMPLETED_NO, TAO_MProfile::get_profile(), CORBA::OMGVMCID, and TAO_MProfile::profile_count().
01082 { 01083 // Add the given tagged component to all profiles matching the given 01084 // ProfileId. 01085 bool found_profile = false; 01086 01087 CORBA::ULong const profile_count = mprofile.profile_count (); 01088 01089 for (CORBA::ULong i = 0; i < profile_count; ++i) 01090 { 01091 TAO_Profile *profile = mprofile.get_profile (i); 01092 01093 if (profile->tag () == profile_id) 01094 { 01095 profile->add_tagged_component (component); 01096 01097 found_profile = true; 01098 } 01099 } 01100 01101 // According to the Portable Interceptor specification, we're 01102 // supposed to throw a CORBA::BAD_PARAM exception if no profile 01103 // matched the given ProfileId. 01104 if (found_profile == false) 01105 throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 29, CORBA::COMPLETED_NO); 01106 }
bool TAO_Root_POA::allow_implicit_activation | ( | void | ) | const |
Definition at line 2485 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::implicit_activation_strategy().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::servant_to_system_id_i(), and TAO::Portable_Server::ServantRetentionStrategyRetain::servant_to_user_id().
02486 { 02487 return this->active_policy_strategies_.implicit_activation_strategy ()-> 02488 allow_implicit_activation (); 02489 }
bool TAO_Root_POA::allow_multiple_activations | ( | void | ) | const |
Definition at line 2492 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::id_uniqueness_strategy().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::strategy_init().
02493 { 02494 return this->active_policy_strategies_.id_uniqueness_strategy ()-> 02495 allow_multiple_activations (); 02496 }
TAO::Portable_Server::Cached_Policies & TAO_Root_POA::cached_policies | ( | void | ) |
obtain a reference to the cached_profiles
Definition at line 2523 of file Root_POA.cpp.
References cached_policies_.
Referenced by TAO_Network_Priority_Hook::update_network_priority().
02524 { 02525 return this->cached_policies_; 02526 }
void TAO_Root_POA::check_for_valid_wait_for_completions | ( | const TAO_ORB_Core & | orb_core, | |
CORBA::Boolean | wait_for_completion | |||
) | [static] |
Definition at line 1229 of file Root_POA.cpp.
References CORBA::COMPLETED_NO, TAO_TSS_Resources::instance(), CORBA::OMGVMCID, TAO::Portable_Server::POA_Current_Impl::orb_core(), orb_core(), TAO_TSS_Resources::poa_current_impl_, and TAO::Portable_Server::POA_Current_Impl::previous_current_impl_.
Referenced by TAO_Object_Adapter::check_close(), TAO_POA_Manager::deactivate_i(), destroy_i(), TAO_POA_Manager::discard_requests_i(), and TAO_POA_Manager::hold_requests_i().
01231 { 01232 if (wait_for_completion) 01233 { 01234 TAO::Portable_Server::POA_Current_Impl *poa_current_impl = 01235 static_cast <TAO::Portable_Server::POA_Current_Impl *> 01236 (TAO_TSS_Resources::instance ()->poa_current_impl_); 01237 01238 while (1) 01239 { 01240 // If wait_for_completion is TRUE and the current thread is 01241 // in an invocation context dispatched from some POA 01242 // belonging to the same ORB as this POA, the BAD_INV_ORDER 01243 // system exception with standard minor code 3 is raised and 01244 // POA destruction does not occur. 01245 if (poa_current_impl != 0) 01246 { 01247 if (&orb_core == &poa_current_impl->orb_core ()) 01248 { 01249 // CORBA 2.3 specifies which minor code corresponds 01250 // to this particular problem. 01251 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 3, 01252 CORBA::COMPLETED_NO); 01253 } 01254 } 01255 else 01256 break; 01257 01258 poa_current_impl = 01259 poa_current_impl->previous_current_impl_; 01260 } 01261 } 01262 }
void TAO_Root_POA::check_state | ( | void | ) |
Check the state of this POA.
Definition at line 2632 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::lifespan_strategy().
Referenced by find_POA_i(), and TAO::Portable_Server::Servant_Upcall::prepare_for_upcall_i().
02633 { 02634 this->active_policy_strategies_.lifespan_strategy ()->check_state (); 02635 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Boolean TAO_Root_POA::cleanup_in_progress | ( | void | ) |
Definition at line 8 of file Root_POA.inl.
References cleanup_in_progress_.
Referenced by TAO::Portable_Server::POA_Guard::POA_Guard().
00009 { 00010 return this->cleanup_in_progress_; 00011 }
void TAO_Root_POA::cleanup_servant | ( | PortableServer::Servant | servant, | |
const PortableServer::ObjectId & | user_id | |||
) |
Definition at line 1504 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::deactivate_map_entry(), and TAO::Portable_Server::Servant_Upcall::servant_cleanup().
01507 { 01508 this->active_policy_strategies_.request_processing_strategy()-> 01509 cleanup_servant (servant, user_id); 01510 }
CORBA::PolicyList * TAO_Root_POA::client_exposed_policies | ( | CORBA::Short | object_priority | ) | [virtual] |
This method gives the policies that are exposed to the client. These policies are shipped within the IOR.
Definition at line 2249 of file Root_POA.cpp.
References ACE_NEW_THROW_EX, TAO_POA_Policy_Set::add_client_exposed_fixed_policies(), CORBA::COMPLETED_NO, policies(), policies_, and TAO::VMCID.
Referenced by key_to_stub_i().
02250 { 02251 CORBA::PolicyList *client_exposed_policies = 0; 02252 ACE_NEW_THROW_EX (client_exposed_policies, 02253 CORBA::PolicyList (), 02254 CORBA::NO_MEMORY (TAO::VMCID, 02255 CORBA::COMPLETED_NO)); 02256 02257 CORBA::PolicyList_var policies = client_exposed_policies; 02258 02259 // Add in all of the client exposed policies. 02260 this->policies_.add_client_exposed_fixed_policies (client_exposed_policies); 02261 02262 return policies._retn (); 02263 }
void TAO_Root_POA::complete_destruction_i | ( | void | ) | [protected] |
Definition at line 327 of file Root_POA.cpp.
References active_policy_strategies_, adapter_activator_, adapter_state_, adapter_state_changed(), TAO::Portable_Server::Active_Policy_Strategies::cleanup(), object_adapter(), ort_adapter_, ORT_adapter_factory(), ORT_adapter_i(), release(), TAO_Object_Adapter::unbind_poa(), and waiting_destruction_.
Referenced by destroy_i(), and TAO::Portable_Server::Servant_Upcall::poa_cleanup().
00328 { 00329 bool doing_complete_destruction = 00330 this->waiting_destruction_ != false; 00331 00332 // No longer awaiting destruction. 00333 this->waiting_destruction_ = false; 00334 00335 PortableServer::POA_var poa; 00336 TAO::ORT_Array my_array_obj_ref_template; 00337 TAO::ORT_Adapter *ort_adapter = 0; 00338 if (doing_complete_destruction) 00339 { 00340 ort_adapter = 00341 this->ORT_adapter_i (); 00342 00343 // In case no ORT library is linked we get zero. 00344 if (ort_adapter != 0) 00345 { 00346 // Get the ObjectReferenceTemplate. 00347 PortableInterceptor::ObjectReferenceTemplate * const ort = 00348 ort_adapter->get_adapter_template (); 00349 00350 // Add it to the sequence of object reference templates, we 00351 // just notify for ourselves that we are now non_existent, 00352 // our childs will do it for themselves. 00353 my_array_obj_ref_template.size (1); 00354 my_array_obj_ref_template[0] = ort; 00355 } 00356 00357 poa = PortableServer::POA::_duplicate (this); 00358 } 00359 00360 // Remove POA from the POAManager. 00361 if (this->poa_manager_.remove_poa (this) != 0) 00362 throw ::CORBA::OBJ_ADAPTER (); 00363 00364 // Remove POA from the Object Adapter. 00365 int result = this->object_adapter ().unbind_poa (this, 00366 this->folded_name_, 00367 this->system_name_.in ()); 00368 if (result != 0) 00369 throw ::CORBA::OBJ_ADAPTER (); 00370 00371 // Cleanup all strategies 00372 this->active_policy_strategies_.cleanup (); 00373 00374 // Forced cleanup. The new memory management scheme is evil and can 00375 // lead to reference deadlock, i.e., POA holds object A, but POA 00376 // cannot die because object A hold POA. 00377 { 00378 // 00379 // If new things are added to this cleanup code, make sure to move 00380 // the minimum CORBA #define after the declaration of 00381 // <non_servant_upcall>. 00382 // 00383 00384 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) 00385 00386 // ATTENTION: Trick locking here, see class header for details 00387 TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); 00388 ACE_UNUSED_ARG (non_servant_upcall); 00389 00390 this->adapter_activator_ = PortableServer::AdapterActivator::_nil (); 00391 00392 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00393 00394 } 00395 00396 ::CORBA::release (this); 00397 00398 if (doing_complete_destruction) 00399 { 00400 this->adapter_state_ = PortableInterceptor::NON_EXISTENT; 00401 00402 this->adapter_state_changed (my_array_obj_ref_template, 00403 this->adapter_state_); 00404 00405 if (ort_adapter != 0) 00406 { 00407 ort_adapter->release (my_array_obj_ref_template[0]); 00408 00409 TAO::ORT_Adapter_Factory *ort_factory = 00410 this->ORT_adapter_factory (); 00411 00412 ort_factory->destroy (ort_adapter); 00413 00414 this->ort_adapter_ = 0; 00415 } 00416 } 00417 }
void TAO_Root_POA::components_established | ( | PortableInterceptor::IORInfo_ptr | info | ) | [protected] |
Call the IORInterceptor::components_established() method on all registered IORInterceptors.
Definition at line 2127 of file Root_POA.cpp.
References TAO_IORInterceptor_Adapter::components_established(), TAO_ORB_Core::ior_interceptor_adapter(), and orb_core_.
02128 { 02129 TAO_IORInterceptor_Adapter *ior_adapter = 02130 this->orb_core_.ior_interceptor_adapter (); 02131 02132 if (ior_adapter) 02133 { 02134 ior_adapter->components_established (info); 02135 } 02136 }
PortableServer::IdAssignmentPolicy_ptr TAO_Root_POA::create_id_assignment_policy | ( | PortableServer::IdAssignmentPolicyValue | value | ) |
Definition at line 125 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
00126 { 00127 TAO::Portable_Server::IdAssignmentPolicy *policy = 0; 00128 ACE_NEW_THROW_EX (policy, 00129 TAO::Portable_Server::IdAssignmentPolicy (value), 00130 CORBA::NO_MEMORY ()); 00131 00132 return policy; 00133 }
PortableServer::IdUniquenessPolicy_ptr TAO_Root_POA::create_id_uniqueness_policy | ( | PortableServer::IdUniquenessPolicyValue | value | ) |
Definition at line 112 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
00113 { 00114 TAO::Portable_Server::IdUniquenessPolicy *policy = 0; 00115 ACE_NEW_THROW_EX (policy, 00116 TAO::Portable_Server::IdUniquenessPolicy (value), 00117 CORBA::NO_MEMORY ()); 00118 00119 return policy; 00120 }
PortableServer::ImplicitActivationPolicy_ptr TAO_Root_POA::create_implicit_activation_policy | ( | PortableServer::ImplicitActivationPolicyValue | value | ) |
Definition at line 139 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
00140 { 00141 TAO::Portable_Server::ImplicitActivationPolicy *policy = 0; 00142 ACE_NEW_THROW_EX (policy, 00143 TAO::Portable_Server::ImplicitActivationPolicy (value), 00144 CORBA::NO_MEMORY ()); 00145 00146 return policy; 00147 }
PortableServer::LifespanPolicy_ptr TAO_Root_POA::create_lifespan_policy | ( | PortableServer::LifespanPolicyValue | value | ) |
Definition at line 98 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
00099 { 00100 TAO::Portable_Server::LifespanPolicy *policy = 0; 00101 ACE_NEW_THROW_EX (policy, 00102 TAO::Portable_Server::LifespanPolicy (value), 00103 CORBA::NO_MEMORY ()); 00104 00105 return policy; 00106 }
TAO::ObjectKey * TAO_Root_POA::create_object_key | ( | const PortableServer::ObjectId & | id | ) | [protected] |
Definition at line 1716 of file Root_POA.cpp.
References ACE_NEW_RETURN, id_, and ACE_OS::memcpy().
Referenced by invoke_key_to_object().
01717 { 01718 // Calculate the space required for the key. 01719 CORBA::ULong buffer_size = 01720 this->id_.length () + 01721 id.length (); 01722 01723 // Create the buffer for the key. 01724 CORBA::Octet *buffer = TAO::ObjectKey::allocbuf (buffer_size); 01725 01726 // First copy the POA id into the key. 01727 ACE_OS::memcpy (&buffer[0], 01728 this->id_.get_buffer (), 01729 this->id_.length ()); 01730 01731 // Then copy the object id into the key. 01732 ACE_OS::memcpy (&buffer[this->id_.length ()], 01733 id.get_buffer (), 01734 id.length ()); 01735 01736 // Create the key, giving the ownership of the buffer to the 01737 // sequence. 01738 TAO::ObjectKey *key = 0; 01739 ACE_NEW_RETURN (key, 01740 TAO::ObjectKey (buffer_size, 01741 buffer_size, 01742 buffer, 01743 1), 01744 0); 01745 01746 return key; 01747 }
PortableServer::POA_ptr TAO_Root_POA::create_POA | ( | const char * | adapter_name, | |
PortableServer::POAManager_ptr | poa_manager, | |||
const CORBA::PolicyList & | policies | |||
) |
Definition at line 700 of file Root_POA.cpp.
References create_POA_i(), and TAO_POA_GUARD_RETURN.
00703 { 00704 // Lock access for the duration of this transaction. 00705 TAO_POA_GUARD_RETURN (0); 00706 00707 return this->create_POA_i (adapter_name, poa_manager, policies); 00708 }
PortableServer::POA_ptr TAO_Root_POA::create_POA_i | ( | const String & | adapter_name, | |
PortableServer::POAManager_ptr | poa_manager, | |||
const TAO_POA_Policy_Set & | policies | |||
) | [protected] |
Definition at line 527 of file Root_POA.cpp.
References CORBA::Object::_add_ref(), adapter_name(), establish_components(), new_POA(), object_adapter(), object_adapter_, orb_core_, policies(), and TAO_Object_Adapter::thread_lock().
00530 { 00531 // This operaton creates a new POA as a child of the target POA. The 00532 // specified name identifies the new POA with respect to other POAs 00533 // with the same parent POA. If the target POA already has a child 00534 // POA with the specified name, the AdapterAlreadyExists exception 00535 // is raised. 00536 // Child was found 00537 if (this->children_.find (adapter_name) != -1) 00538 { 00539 throw PortableServer::POA::AdapterAlreadyExists (); 00540 } 00541 00542 // 00543 // Child was not found. Create one. 00544 // 00545 00546 // The specified policy objects are associated with the POA and used 00547 // to control its behavior. The policy objects are effectively 00548 // copied before this operation returns, so the application is free 00549 // to destroy them while the POA is in use. Policies are not 00550 // inherited from the parent POA. 00551 TAO_Root_POA * poa = this->new_POA (adapter_name, 00552 poa_manager, 00553 policies, 00554 this, 00555 this->object_adapter ().lock (), 00556 this->object_adapter ().thread_lock (), 00557 this->orb_core_, 00558 this->object_adapter_); 00559 00560 // Give ownership of the new map to the POA_var. Note, that it 00561 // is important for the POA_var to take ownership before 00562 // checking for exception since we may need to delete the new map. 00563 PortableServer::POA_var new_poa = poa; 00564 00565 // Check for exception in construction of the POA. 00566 00567 // Add to children map 00568 if (this->children_.bind (adapter_name, poa) != 0) 00569 { 00570 throw ::CORBA::OBJ_ADAPTER (); 00571 } 00572 00573 // Increment the reference count on the child POA since the children 00574 // map must retain ownership. Do so immediately before any other 00575 // operations to prevent memory cleanup problems induced from 00576 // errors below. 00577 poa->_add_ref (); 00578 00579 // Iterate over the registered IOR interceptors so that they may be 00580 // given the opportunity to add tagged components to the profiles 00581 // for this servant. 00582 poa->establish_components (); 00583 00584 // Note: Creating a POA using a POA manager that is in the active 00585 // state can lead to race conditions if the POA supports preexisting 00586 // objects, because the new POA may receive a request before its 00587 // adapter activator, servant manager, or default servant have been 00588 // initialized. These problems do not occur if the POA is created by 00589 // an adapter activator registered with a parent of the new POA, 00590 // because requests are queued until the adapter activator 00591 // returns. To avoid these problems when a POA must be explicitly 00592 // initialized, the application can initialize the POA by invoking 00593 // find_POA with a TRUE activate parameter. 00594 00595 // Everything is fine. Don't let the POA_var release the 00596 // implementation. 00597 return new_poa._retn (); 00598 }
PortableServer::POA_ptr TAO_Root_POA::create_POA_i | ( | const char * | adapter_name, | |
PortableServer::POAManager_ptr | poa_manager, | |||
const CORBA::PolicyList & | policies | |||
) | [protected] |
Definition at line 421 of file Root_POA.cpp.
References TAO_Objref_Var_T< T >::_retn(), ACE_NEW_THROW_EX, TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), TAO_Policy_Validator::merge_policies(), object_adapter(), orb_core_, and TAO_Object_Adapter::validator().
Referenced by create_POA().
00424 { 00425 // Initialize a TAO_POA_Policy_Set instance so that it contains the 00426 // default POA policies. 00427 TAO_POA_Policy_Set tao_policies (this->object_adapter ().default_poa_policies ()); 00428 00429 // Merge policies from the ORB level. 00430 this->object_adapter ().validator ().merge_policies (tao_policies.policies ()); 00431 00432 // Merge in any policies that the user may have specified. 00433 tao_policies.merge_policies (policies); 00434 00435 // If any of the policy objects specified are not valid for the ORB 00436 // implementation, if conflicting policy objects are specified, or 00437 // if any of the specified policy objects require prior 00438 // administrative action that has not been performed, an 00439 // InvalidPolicy exception is raised containing the index in the 00440 // policies parameter value of the first offending policy object. 00441 tao_policies.validate_policies (this->object_adapter ().validator (), 00442 this->orb_core_); 00443 00444 // If the poa_manager parameter is null, a new POAManager object is 00445 // created and associated with the new POA. Otherwise, the specified 00446 // POAManager object is associated with the new POA. The POAManager 00447 // object can be obtained using the attribute name the_POAManager. 00448 00449 PortableServer::POAManager_var the_poa_manager; 00450 00451 if (CORBA::is_nil (poa_manager)) 00452 { 00453 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) 00454 00455 PortableServer::POA_var poa = PortableServer::POA::_duplicate (this); 00456 PortableServer::POA_var root_poa; 00457 00458 // Find the RootPOA by traversing the POA hierarchy until the 00459 // RootPOA is reached. The RootPOA has no parent. 00460 while (!CORBA::is_nil (poa.in ())) 00461 { 00462 root_poa = poa; 00463 poa = poa->the_parent (); 00464 } 00465 00466 // Get the POAManagerFactory instance owned by RootPOA. 00467 PortableServer::POAManagerFactory_var tao_poa_manager_factory 00468 = root_poa->the_POAManagerFactory (); 00469 00470 CORBA::PolicyList empty_policies; 00471 00472 // The POAManager name will be generated when the POAManager instance 00473 // is created. 00474 the_poa_manager 00475 = tao_poa_manager_factory->create_POAManager (0, empty_policies); 00476 #else 00477 00478 PortableServer::POAManager_ptr the_poa_manager_ptr; 00479 ACE_NEW_THROW_EX (the_poa_manager_ptr, 00480 TAO_POA_Manager (this->object_adapter (), 0), 00481 CORBA::NO_MEMORY ()); 00482 the_poa_manager = the_poa_manager_ptr; 00483 #endif /* TAO_HAS_MINIMUM_POA == 0 && ! CORBA_E_COMPACT) */ 00484 00485 } 00486 else 00487 { 00488 the_poa_manager = PortableServer::POAManager::_duplicate (poa_manager); 00489 } 00490 00491 PortableServer::POA_var poa = this->create_POA_i (adapter_name, 00492 the_poa_manager.in (), 00493 tao_policies); 00494 00495 return poa._retn (); 00496 }
CORBA::Object_ptr TAO_Root_POA::create_reference | ( | const char * | intf | ) |
Definition at line 1298 of file Root_POA.cpp.
References CORBA::Object::_nil(), create_reference_i(), and TAO_POA_GUARD_RETURN.
Referenced by create_reference_i().
01299 { 01300 // Lock access for the duration of this transaction. 01301 TAO_POA_GUARD_RETURN (CORBA::Object::_nil ()); 01302 01303 return this->create_reference_i (intf, 01304 this->server_priority ()); 01305 }
CORBA::Object_ptr TAO_Root_POA::create_reference_i | ( | const char * | intf, | |
CORBA::Short | priority | |||
) | [protected] |
Definition at line 1308 of file Root_POA.cpp.
References active_policy_strategies_, create_reference(), and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by create_reference().
01310 { 01311 if (!this->has_system_id ()) 01312 { 01313 throw PortableServer::POA::WrongPolicy (); 01314 } 01315 01316 return this->active_policy_strategies_.servant_retention_strategy()-> 01317 create_reference (intf, priority); 01318 }
CORBA::Object_ptr TAO_Root_POA::create_reference_with_id | ( | const PortableServer::ObjectId & | oid, | |
const char * | intf | |||
) |
Definition at line 777 of file Root_POA.cpp.
References CORBA::Object::_nil(), create_reference_with_id_i(), and TAO_POA_GUARD_RETURN.
Referenced by create_reference_with_id_i().
00779 { 00780 // Lock access for the duration of this transaction. 00781 TAO_POA_GUARD_RETURN (CORBA::Object::_nil ()); 00782 00783 return this->create_reference_with_id_i (id, 00784 intf, 00785 this->server_priority ()); 00786 }
CORBA::Object_ptr TAO_Root_POA::create_reference_with_id_i | ( | const PortableServer::ObjectId & | oid, | |
const char * | intf, | |||
CORBA::Short | priority | |||
) | [protected] |
Definition at line 1342 of file Root_POA.cpp.
References active_policy_strategies_, CORBA::COMPLETED_NO, create_reference_with_id(), is_poa_generated_id(), CORBA::OMGVMCID, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by create_reference_with_id().
01345 { 01346 // If the POA has the SYSTEM_ID policy and it detects that the 01347 // Object Id value was not generated by the system or for this POA, 01348 // the create_reference_with_id operation may raise the BAD_PARAM 01349 // system exception. An ORB is not required to detect all such 01350 // invalid Object Id values, but a portable application must not 01351 // invoke this operation on a POA that has the SYSTEM_ID policy with 01352 // an Object Id value that was not previously generated by the 01353 // system for that POA, or, if the POA also has the PERSISTENT 01354 // policy, for a previous instantiation of the same POA. 01355 if (this->has_system_id () && 01356 !this->is_poa_generated_id (user_id)) 01357 { 01358 throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 01359 } 01360 01361 return this->active_policy_strategies_.servant_retention_strategy()-> 01362 create_reference_with_id (user_id, intf, priority); 01363 }
PortableServer::RequestProcessingPolicy_ptr TAO_Root_POA::create_request_processing_policy | ( | PortableServer::RequestProcessingPolicyValue | value | ) |
Definition at line 161 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
00162 { 00163 TAO::Portable_Server::RequestProcessingPolicy *policy = 0; 00164 ACE_NEW_THROW_EX (policy, 00165 TAO::Portable_Server::RequestProcessingPolicy (value), 00166 CORBA::NO_MEMORY ()); 00167 00168 return policy; 00169 }
PortableServer::ServantRetentionPolicy_ptr TAO_Root_POA::create_servant_retention_policy | ( | PortableServer::ServantRetentionPolicyValue | value | ) |
Definition at line 150 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
00151 { 00152 TAO::Portable_Server::ServantRetentionPolicy *policy = 0; 00153 ACE_NEW_THROW_EX (policy, 00154 TAO::Portable_Server::ServantRetentionPolicy (value), 00155 CORBA::NO_MEMORY ()); 00156 00157 return policy; 00158 }
TAO_Stub * TAO_Root_POA::create_stub_object | ( | const TAO::ObjectKey & | object_key, | |
const char * | type_id, | |||
CORBA::PolicyList * | policy_list, | |||
TAO_Acceptor_Filter * | filter, | |||
TAO_Acceptor_Registry & | acceptor_registry | |||
) | [protected] |
Definition at line 2170 of file Root_POA.cpp.
References CORBA::SystemException::_tao_minor_code(), TAO_Acceptor_Registry::begin(), CORBA::COMPLETED_NO, TAO_ORB_Core::create_stub_object(), TAO_Acceptor_Filter::encode_endpoints(), TAO_Acceptor_Registry::end(), TAO_Acceptor_Registry::endpoint_count(), TAO_Acceptor_Filter::fill_profile(), orb_core_, TAO_MProfile::profile_count(), TAO_MProfile::set(), tagged_component_, tagged_component_id_, and TAO_MPROFILE_CREATION_ERROR.
Referenced by key_to_stub_i().
02175 { 02176 bool error = false; 02177 02178 // Count the number of endpoints. 02179 size_t const profile_count = acceptor_registry.endpoint_count (); 02180 02181 // Create a profile container and have acceptor registries populate 02182 // it with profiles as appropriate. 02183 TAO_MProfile mprofile (0); 02184 02185 // Allocate space for storing the profiles. There can never be more 02186 // profiles than there are endpoints. In some cases, there can be 02187 // less profiles than endpoints. 02188 int result = mprofile.set (static_cast <CORBA::ULong> (profile_count)); 02189 if (result == -1) 02190 error = true; 02191 02192 if (!error) 02193 { 02194 result = 02195 filter->fill_profile (object_key, 02196 mprofile, 02197 acceptor_registry.begin (), 02198 acceptor_registry.end ()); 02199 if (result == -1) 02200 error = true; 02201 } 02202 02203 if (!error) 02204 result = filter->encode_endpoints (mprofile); 02205 02206 if (result == -1) 02207 error = true; 02208 02209 if (error) 02210 throw ::CORBA::INTERNAL ( 02211 CORBA::SystemException::_tao_minor_code ( 02212 TAO_MPROFILE_CREATION_ERROR, 02213 0), 02214 CORBA::COMPLETED_NO); 02215 02216 // Make sure we have at least one profile. <mp> may end up being 02217 // empty if none of the acceptor endpoints have the right priority 02218 // for this object, for example. 02219 if (mprofile.profile_count () == 0) 02220 throw ::CORBA::BAD_PARAM ( 02221 CORBA::SystemException::_tao_minor_code ( 02222 TAO_MPROFILE_CREATION_ERROR, 02223 0), 02224 CORBA::COMPLETED_NO); 02225 02226 TAO_Stub *stub = 02227 this->orb_core_.create_stub_object (mprofile, type_id, policy_list); 02228 02229 // Add the saved tagged components methods to the profiles. 02230 CORBA::ULong len = this->tagged_component_.length (); 02231 for (CORBA::ULong i = 0; i != len; ++i) 02232 { 02233 this->add_ior_component (mprofile, this->tagged_component_[i]); 02234 } 02235 02236 len = this->tagged_component_id_.length (); 02237 02238 for (CORBA::ULong k = 0; k != len; ++k) 02239 { 02240 this->add_ior_component_to_profile (mprofile, 02241 this->tagged_component_id_[k], 02242 this->profile_id_array_[k]); 02243 } 02244 02245 return stub; 02246 }
PortableServer::ThreadPolicy_ptr TAO_Root_POA::create_thread_policy | ( | PortableServer::ThreadPolicyValue | value | ) |
Definition at line 83 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
00084 { 00085 TAO::Portable_Server::ThreadPolicy *policy = 0; 00086 ACE_NEW_THROW_EX (policy, 00087 TAO::Portable_Server::ThreadPolicy (value), 00088 CORBA::NO_MEMORY ()); 00089 00090 return policy; 00091 }
void TAO_Root_POA::deactivate_all_objects_i | ( | CORBA::Boolean | etherealize_objects, | |
CORBA::Boolean | wait_for_completion | |||
) | [protected] |
Definition at line 1202 of file Root_POA.cpp.
References deactivate_all_objects_i(), and wait_for_completions().
01204 { 01205 this->deactivate_all_objects_i (etherealize_objects); 01206 01207 this->wait_for_completions (wait_for_completion); 01208 }
void TAO_Root_POA::deactivate_all_objects_i | ( | CORBA::Boolean | etherealize_objects | ) | [protected] |
Definition at line 1265 of file Root_POA.cpp.
References active_policy_strategies_, TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy(), and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by deactivate_all_objects_i(), and destroy_i().
01266 { 01267 this->active_policy_strategies_.request_processing_strategy ()-> 01268 etherealize_objects (etherealize_objects); 01269 01270 this->active_policy_strategies_.servant_retention_strategy ()-> 01271 deactivate_all_objects (); 01272 }
void TAO_Root_POA::deactivate_object | ( | const PortableServer::ObjectId & | oid | ) |
Definition at line 1275 of file Root_POA.cpp.
References deactivate_object_i(), and TAO_POA_GUARD.
Referenced by deactivate_object_i().
01276 { 01277 // Lock access for the duration of this transaction. 01278 TAO_POA_GUARD; 01279 01280 this->deactivate_object_i (oid); 01281 }
void TAO_Root_POA::deactivate_object_i | ( | const PortableServer::ObjectId & | oid | ) |
Definition at line 1285 of file Root_POA.cpp.
References active_policy_strategies_, deactivate_object(), and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by deactivate_object().
01286 { 01287 this->active_policy_strategies_.servant_retention_strategy()-> 01288 deactivate_object (id); 01289 }
ACE_INLINE CORBA::ULong TAO_Root_POA::decrement_outstanding_requests | ( | void | ) | [protected] |
Definition at line 201 of file Root_POA.inl.
References outstanding_requests_.
Referenced by TAO::Portable_Server::Servant_Upcall::poa_cleanup().
00202 { 00203 return --this->outstanding_requests_; 00204 }
int TAO_Root_POA::delete_child | ( | const String & | child | ) |
Definition at line 967 of file Root_POA.cpp.
References children_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind().
Referenced by TAO_Regular_POA::remove_from_parent_i().
00968 { 00969 int result = 0; 00970 00971 // If we are not closing down, we must remove this child from our 00972 // collection. 00973 if (!this->cleanup_in_progress_) 00974 result = this->children_.unbind (child); 00975 00976 // Otherwise, if we are closing down, we are currently iterating 00977 // over our children and there is not need to remove this child from 00978 // our collection. 00979 00980 return result; 00981 }
void TAO_Root_POA::destroy | ( | CORBA::Boolean | etherealize_objects, | |
CORBA::Boolean | wait_for_completion | |||
) |
Definition at line 790 of file Root_POA.cpp.
References destroy_i().
00792 { 00793 // Lock access for the duration of this transaction. 00794 TAO::Portable_Server::POA_Guard poa_guard (*this , 0); 00795 ACE_UNUSED_ARG (poa_guard); 00796 00797 this->destroy_i (etherealize_objects, wait_for_completion); 00798 }
void TAO_Root_POA::destroy_i | ( | CORBA::Boolean | etherealize_objects, | |
CORBA::Boolean | wait_for_completion | |||
) | [protected] |
Definition at line 807 of file Root_POA.cpp.
References active_policy_strategies_, adapter_state_, adapter_state_changed(), check_for_valid_wait_for_completions(), children_, cleanup_in_progress_, complete_destruction_i(), deactivate_all_objects_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), TAO::Portable_Server::Active_Policy_Strategies::lifespan_strategy(), TAO_Object_Adapter::non_servant_upcall_in_progress(), object_adapter(), ort_adapter_, ORT_adapter_factory(), ORT_adapter_i(), TAO::Portable_Server::Non_Servant_Upcall::poa(), poa_deactivated_hook(), remove_from_parent_i(), and waiting_destruction_.
Referenced by destroy().
00809 { 00810 if (this->cleanup_in_progress_) 00811 return; 00812 00813 // Is the <wait_for_completion> semantics for this thread correct? 00814 TAO_Root_POA::check_for_valid_wait_for_completions (this->orb_core (), 00815 wait_for_completion); 00816 00817 this->cleanup_in_progress_ = true; 00818 00819 // Inform the custom servant dispatching strategy to stop the working 00820 // threads when the poa is destroyed. 00821 this->poa_deactivated_hook (); 00822 00823 // This operation destroys the POA and all descendant POAs. The POA 00824 // so destroyed (that is, the POA with its name) may be re-created 00825 // later in the same process. (This differs from the 00826 // POAManager::deactivate operation that does not allow a 00827 // re-creation of its associated POA in the same process.) 00828 00829 // Remove POA from the parent 00830 this->remove_from_parent_i (); 00831 00832 TAO::ORT_Array array_obj_ref_template (1); 00833 00834 CORBA::ULong i = 0; 00835 00836 // Gather all ObjectReferenceTemplates and change all adapter states 00837 // to INACTIVE. 00838 for (CHILDREN::iterator iterator = this->children_.begin (); 00839 iterator != this->children_.end (); 00840 ++iterator) 00841 { 00842 TAO_Root_POA * const child_poa = (*iterator).int_id_; 00843 00844 TAO::ORT_Adapter * const adapter = child_poa->ORT_adapter_i (); 00845 00846 // In case no ORT library is linked we get zero. 00847 if (adapter != 0) 00848 { 00849 // Get the ObjectReferenceTemplate for the child POA. 00850 PortableInterceptor::ObjectReferenceTemplate * const ort = 00851 adapter->get_adapter_template (); 00852 00853 // Add it to the sequence of object reference templates that 00854 // will be destroyed. 00855 array_obj_ref_template.size (1); 00856 00857 array_obj_ref_template[0] = ort; 00858 } 00859 00860 child_poa->adapter_state_ = 00861 PortableInterceptor::INACTIVE; 00862 00863 // Notify the state changes to the IORInterceptors 00864 this->adapter_state_changed (array_obj_ref_template, 00865 PortableInterceptor::INACTIVE); 00866 00867 if (adapter != 0) 00868 adapter->release (array_obj_ref_template[0]); 00869 00870 ++i; 00871 } 00872 00873 // Destroy all child POA's now. 00874 for (CHILDREN::iterator destroy_iterator = this->children_.begin (); 00875 destroy_iterator != this->children_.end (); 00876 ++destroy_iterator) 00877 { 00878 TAO_Root_POA *destroy_child_poa = (*destroy_iterator).int_id_; 00879 00880 destroy_child_poa->destroy_i (etherealize_objects, 00881 wait_for_completion); 00882 } 00883 00884 // Notify the lifespan strategy of our shutdown 00885 this->active_policy_strategies_.lifespan_strategy()->notify_shutdown (); 00886 00887 // @todo, is the exception handling above correct, should we just fail when 00888 // the notify above fails 00889 00890 // When a POA is destroyed, any requests that have started execution 00891 // continue to completion. Any requests that have not started 00892 // execution are processed as if they were newly arrived, that is, 00893 // the POA will attempt to cause recreation of the POA by invoking 00894 // one or more adapter activators as described in Section 3.3.3. 00895 // If the wait_for_completion parameter is TRUE, the destroy 00896 // operation will return only after all requests in process have 00897 // completed and all invocations of etherealize have 00898 // completed. Otherwise, the destroy operation returns after 00899 // destroying the POAs. 00900 00901 this->deactivate_all_objects_i (etherealize_objects, 00902 wait_for_completion); 00903 00904 // If there are no outstanding requests and that we are not in a 00905 // non-servant upcall or if we are in a non-servant upcall, make 00906 // sure we are the POA related to the non-servant upcall. 00907 TAO::Portable_Server::Non_Servant_Upcall *non_servant_upcall_in_progress = 00908 this->object_adapter ().non_servant_upcall_in_progress (); 00909 if (this->outstanding_requests_ == 0 && 00910 (non_servant_upcall_in_progress == 0 || 00911 &non_servant_upcall_in_progress->poa () != this)) 00912 { 00913 TAO::ORT_Array my_array_obj_ref_template; 00914 00915 TAO::ORT_Adapter * const ort_adapter = 00916 this->ORT_adapter_i (); 00917 00918 // In case no ORT library is linked we get zero. 00919 if (ort_adapter != 0) 00920 { 00921 // Get the ObjectReferenceTemplate. 00922 PortableInterceptor::ObjectReferenceTemplate * const ort = 00923 ort_adapter->get_adapter_template (); 00924 00925 // Add it to the sequence of object reference templates, we 00926 // just notify for ourselves that we are now non_existent, 00927 // our childs will do it for themselves. 00928 my_array_obj_ref_template.size (1); 00929 my_array_obj_ref_template[0] = ort; 00930 } 00931 00932 // According to the ORT spec, after a POA is destroyed, its state 00933 // has to be changed to NON_EXISTENT and all the registered 00934 // interceptors are to be informed. Since, the POA is destroyed 00935 // and is released in the complete_destruction_i method, we are 00936 // trying to keep the poa still around by doing a duplicate of 00937 // it. (a hack). 00938 PortableServer::POA_var poa = PortableServer::POA::_duplicate (this); 00939 00940 this->complete_destruction_i (); 00941 00942 this->adapter_state_ = PortableInterceptor::NON_EXISTENT; 00943 00944 this->adapter_state_changed (my_array_obj_ref_template, 00945 this->adapter_state_); 00946 00947 if (ort_adapter != 0) 00948 { 00949 ort_adapter->release (my_array_obj_ref_template[0]); 00950 00951 TAO::ORT_Adapter_Factory *ort_factory = 00952 this->ORT_adapter_factory (); 00953 00954 ort_factory->destroy (ort_adapter); 00955 00956 this->ort_adapter_ = 0; 00957 } 00958 } 00959 else 00960 { 00961 // Mark that we are ready for destruction. 00962 this->waiting_destruction_ = true; 00963 } 00964 }
int TAO_Root_POA::enter | ( | void | ) | [protected] |
Definition at line 2542 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::thread_strategy().
02543 { 02544 return this->active_policy_strategies_.thread_strategy ()->enter(); 02545 }
void TAO_Root_POA::establish_components | ( | void | ) | [protected] |
This method calls IORInterceptor::establish_components() method on all registered IORInterceptors, and IORInterceptor::components_established() once the former is completed.
Definition at line 2115 of file Root_POA.cpp.
References TAO_IORInterceptor_Adapter::establish_components(), TAO_ORB_Core::ior_interceptor_adapter(), and orb_core_.
Referenced by create_POA_i(), and TAO_Object_Adapter::open().
02116 { 02117 TAO_IORInterceptor_Adapter *ior_adapter = 02118 this->orb_core_.ior_interceptor_adapter (); 02119 02120 if (ior_adapter) 02121 { 02122 ior_adapter->establish_components (this); 02123 } 02124 }
int TAO_Root_POA::exit | ( | void | ) | [protected] |
Definition at line 2550 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::thread_strategy().
Referenced by TAO::Portable_Server::Servant_Upcall::single_threaded_poa_cleanup().
02551 { 02552 return this->active_policy_strategies_.thread_strategy ()->exit(); 02553 }
PortableServer::POA_ptr TAO_Root_POA::find_POA | ( | const char * | adapter_name, | |
CORBA::Boolean | activate_it | |||
) |
Definition at line 603 of file Root_POA.cpp.
References find_POA_i(), and TAO_POA_GUARD_RETURN.
00605 { 00606 // Lock access for the duration of this transaction. 00607 TAO_POA_GUARD_RETURN (0); 00608 00609 TAO_Root_POA *poa = this->find_POA_i (adapter_name, activate_it); 00610 00611 return PortableServer::POA::_duplicate (poa); 00612 }
TAO_Root_POA * TAO_Root_POA::find_POA_i | ( | const ACE_CString & | child_name, | |
CORBA::Boolean | activate_it | |||
) | [protected] |
Definition at line 617 of file Root_POA.cpp.
References adapter_activator_, ACE_String_Base< CHAR >::c_str(), check_state(), children_, CORBA::COMPLETED_NO, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), CORBA::is_nil(), and CORBA::OMGVMCID.
Referenced by TAO_Object_Adapter::activate_poa(), and find_POA().
00619 { 00620 TAO_Root_POA *child = 0; 00621 int result = this->children_.find (child_name, child); 00622 00623 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) 00624 00625 if (result != 0) 00626 { 00627 if (activate_it) 00628 { 00629 if (!CORBA::is_nil (this->adapter_activator_.in ())) 00630 { 00631 // Check our state 00632 this->check_state (); 00633 00634 CORBA::Boolean success = false; 00635 try 00636 { 00637 // ATTENTION: Trick locking here, see class header for details 00638 TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall ( 00639 *this); 00640 ACE_UNUSED_ARG (non_servant_upcall); 00641 00642 // When unknown_adapter gives a system exception, the POA 00643 // should raise OBJ_ADAPTER with standard minor code 1. 00644 // See 11.3.9.2 of the Corba spec 00645 success = 00646 this->adapter_activator_->unknown_adapter ( 00647 this, 00648 child_name.c_str ()); 00649 } 00650 catch (const ::CORBA::SystemException&) 00651 { 00652 throw ::CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 1, 00653 CORBA::COMPLETED_NO); 00654 } 00655 00656 if (success) 00657 { 00658 result = this->children_.find (child_name, 00659 child); 00660 } 00661 else 00662 { 00663 result = -1; 00664 } 00665 } 00666 else 00667 { 00668 result = -1; 00669 } 00670 } 00671 else 00672 { 00673 result = -1; 00674 } 00675 } 00676 #else 00677 ACE_UNUSED_ARG (activate_it); 00678 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00679 00680 if (result == 0) 00681 { 00682 return child; 00683 } 00684 else 00685 { 00686 // Otherwise, the AdapterNonExistent exception is raised. 00687 throw PortableServer::POA::AdapterNonExistent (); 00688 } 00689 }
PortableServer::Servant TAO_Root_POA::find_servant | ( | const PortableServer::ObjectId & | system_id, | |
TAO::Portable_Server::Servant_Upcall & | servant_upcall, | |||
TAO::Portable_Server::POA_Current_Impl & | poa_current_impl | |||
) |
Definition at line 2282 of file Root_POA.cpp.
References active_policy_strategies_, find_servant(), and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
02286 { 02287 return this->active_policy_strategies_.servant_retention_strategy()-> 02288 find_servant (system_id, 02289 servant_upcall, 02290 poa_current_impl); 02291 }
PortableServer::Servant TAO_Root_POA::find_servant | ( | const PortableServer::ObjectId & | system_id | ) |
Definition at line 1490 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by find_servant(), TAO::Portable_Server::RequestProcessingStrategyServantLocator::locate_servant(), TAO::Portable_Server::RequestProcessingStrategyServantActivator::locate_servant(), TAO::Portable_Server::RequestProcessingStrategyDefaultServant::locate_servant(), TAO::Portable_Server::RequestProcessingStrategyAOMOnly::locate_servant(), TAO::Portable_Server::RequestProcessingStrategyServantManager::system_id_to_servant(), TAO::Portable_Server::RequestProcessingStrategyDefaultServant::system_id_to_servant(), and TAO::Portable_Server::RequestProcessingStrategyAOMOnly::system_id_to_servant().
01491 { 01492 return this->active_policy_strategies_.servant_retention_strategy()-> 01493 find_servant (system_id); 01494 }
int TAO_Root_POA::find_servant_priority | ( | const PortableServer::ObjectId & | system_id, | |
CORBA::Short & | priority | |||
) |
Find the the servant with ObjectId <system_id>, and retrieve its priority.Usually used in RT CORBA with SERVER_DECLARED priority model.
Definition at line 2294 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
02297 { 02298 return this->active_policy_strategies_.servant_retention_strategy()-> 02299 find_servant_priority (system_id, priority); 02300 }
ACE_INLINE const TAO_Object_Adapter::poa_name & TAO_Root_POA::folded_name | ( | void | ) | const |
Definition at line 99 of file Root_POA.inl.
References folded_name_.
Referenced by TAO_Object_Adapter::Active_Hint_Strategy::find_persistent_poa(), and set_folded_name().
00100 { 00101 return this->folded_name_; 00102 }
ACE_INLINE PortableInterceptor::AdapterState TAO_Root_POA::get_adapter_state | ( | void | ) |
Accessor methods to POA state.
The POA can be in one of HOLDING, ACTIVE, DISCARDING, INACTIVE and NON_EXISTENT states.
Definition at line 219 of file Root_POA.inl.
References adapter_state_.
00220 { 00221 return this->adapter_state_; 00222 }
ACE_INLINE PortableInterceptor::ObjectReferenceTemplate * TAO_Root_POA::get_adapter_template | ( | void | ) | [protected] |
Accessor methods to ObjectReferenceTemplate.
Definition at line 38 of file Root_POA.inl.
References ORT_adapter(), and ort_adapter_.
00039 { 00040 TAO::ORT_Adapter *adapter = this->ORT_adapter (); 00041 00042 if (adapter) 00043 { 00044 return this->ort_adapter_->get_adapter_template(); 00045 } 00046 00047 return 0; 00048 }
ACE_INLINE PortableInterceptor::ObjectReferenceTemplate * TAO_Root_POA::get_adapter_template_i | ( | void | ) | [protected] |
Accessor methods to ObjectReferenceTemplate, non locked version.
Definition at line 51 of file Root_POA.inl.
00052 { 00053 if (this->ORT_adapter_i ()) 00054 { 00055 return this->ort_adapter_->get_adapter_template (); 00056 } 00057 00058 return 0; 00059 }
ACE_INLINE PortableInterceptor::ObjectReferenceFactory * TAO_Root_POA::get_obj_ref_factory | ( | void | ) | [protected] |
Accessor methods to PortableInterceptor::ObjectReferenceFactory.
Definition at line 62 of file Root_POA.inl.
References ORT_adapter(), and ort_adapter_.
00063 { 00064 TAO::ORT_Adapter *adapter = this->ORT_adapter (); 00065 00066 if (adapter) 00067 { 00068 return this->ort_adapter_->get_obj_ref_factory(); 00069 } 00070 00071 return 0; 00072 }
CORBA::Policy_ptr TAO_Root_POA::get_policy | ( | CORBA::PolicyType | policy | ) |
Get the set policy of the given type.
Definition at line 2626 of file Root_POA.cpp.
References TAO_POA_Policy_Set::get_policy(), and policies_.
02627 { 02628 return this->policies_.get_policy (policy); 02629 }
PortableServer::Servant TAO_Root_POA::get_servant | ( | void | ) |
Definition at line 2404 of file Root_POA.cpp.
References TAO_ServantBase::_add_ref(), get_servant_i(), and TAO_POA_GUARD_RETURN.
Referenced by get_servant_i().
02405 { 02406 // Lock access for the duration of this transaction. 02407 TAO_POA_GUARD_RETURN (0); 02408 02409 PortableServer::Servant servant = this->get_servant_i (); 02410 02411 if (servant != 0) 02412 { 02413 // ATTENTION: Trick locking here, see class header for details 02414 TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); 02415 ACE_UNUSED_ARG (non_servant_upcall); 02416 02417 // The POA invokes _add_ref once on the Servant before returning 02418 // it. If the application uses reference counting, the caller of 02419 // get_servant is responsible for invoking _remove_ref once on 02420 // the returned Servant when it is finished with it. A 02421 // conforming caller need not invoke _remove_ref on the returned 02422 // Servant if the type of the Servant uses the default reference 02423 // counting inherited from ServantBase. 02424 servant->_add_ref (); 02425 02426 return servant; 02427 } 02428 else 02429 { 02430 // If no servant has been associated with the POA, the NoServant 02431 // exception is raised. 02432 throw PortableServer::POA::NoServant (); 02433 } 02434 }
PortableServer::Servant TAO_Root_POA::get_servant_i | ( | void | ) | [protected] |
Definition at line 2397 of file Root_POA.cpp.
References active_policy_strategies_, get_servant(), and TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy().
Referenced by get_servant().
02398 { 02399 return this->active_policy_strategies_.request_processing_strategy()-> 02400 get_servant (); 02401 }
PortableServer::ServantManager_ptr TAO_Root_POA::get_servant_manager | ( | void | ) |
Definition at line 2377 of file Root_POA.cpp.
References active_policy_strategies_, TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy(), and TAO_POA_GUARD_RETURN.
02378 { 02379 // Lock access for the duration of this transaction. 02380 TAO_POA_GUARD_RETURN (PortableServer::ServantManager::_nil ()); 02381 02382 return this->active_policy_strategies_.request_processing_strategy()-> 02383 get_servant_manager (); 02384 }
bool TAO_Root_POA::has_system_id | ( | void | ) | const |
Definition at line 2457 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::id_assignment_strategy().
02458 { 02459 return this->active_policy_strategies_.id_assignment_strategy ()-> 02460 has_system_id (); 02461 }
CORBA::OctetSeq * TAO_Root_POA::id | ( | void | ) |
Definition at line 1555 of file Root_POA.cpp.
References ACE_NEW_THROW_EX.
01556 { 01557 CORBA::OctetSeq *id = 0; 01558 ACE_NEW_THROW_EX (id, 01559 CORBA::OctetSeq (this->id_), 01560 CORBA::NO_MEMORY ()); 01561 01562 return id; 01563 }
CORBA::Object_ptr TAO_Root_POA::id_to_reference | ( | const PortableServer::ObjectId & | oid | ) |
Definition at line 766 of file Root_POA.cpp.
References id_to_reference_i(), and TAO_POA_GUARD_RETURN.
Referenced by TAO::Portable_Server::POA_Current_Impl::get_reference(), and id_to_reference_i().
00767 { 00768 // Lock access for the duration of this transaction. 00769 TAO_POA_GUARD_RETURN (0); 00770 00771 return this->id_to_reference_i (oid, true); 00772 }
CORBA::Object_ptr TAO_Root_POA::id_to_reference_i | ( | const PortableServer::ObjectId & | oid, | |
bool | indirect | |||
) |
Definition at line 1547 of file Root_POA.cpp.
References active_policy_strategies_, id_to_reference(), and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by id_to_reference().
01549 { 01550 return this->active_policy_strategies_.servant_retention_strategy()-> 01551 id_to_reference (id, indirect); 01552 }
PortableServer::Servant TAO_Root_POA::id_to_servant | ( | const PortableServer::ObjectId & | oid | ) |
Definition at line 757 of file Root_POA.cpp.
References id_to_servant_i(), and TAO_POA_GUARD_RETURN.
Referenced by id_to_servant_i().
00758 { 00759 // Lock access for the duration of this transaction. 00760 TAO_POA_GUARD_RETURN (0); 00761 00762 return this->id_to_servant_i (oid); 00763 }
PortableServer::Servant TAO_Root_POA::id_to_servant_i | ( | const PortableServer::ObjectId & | oid | ) | [protected] |
Definition at line 1513 of file Root_POA.cpp.
References TAO_ServantBase::_add_ref(), active_policy_strategies_, id_to_servant(), and TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy().
Referenced by id_to_servant().
01514 { 01515 01516 PortableServer::Servant servant = 01517 this->active_policy_strategies_.request_processing_strategy()-> 01518 id_to_servant (id); 01519 01520 if (servant != 0) 01521 { 01522 // ATTENTION: Trick locking here, see class header for details 01523 TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); 01524 ACE_UNUSED_ARG (non_servant_upcall); 01525 01526 // The POA invokes _add_ref once on the Servant before returning 01527 // it. If the application uses reference counting, the caller of 01528 // id_to_servant is responsible for invoking _remove_ref once on 01529 // the returned Servant when it is finished with it. A 01530 // conforming caller need not invoke _remove_ref on the returned 01531 // Servant if the type of the Servant uses the default reference 01532 // counting inherited from ServantBase. 01533 servant->_add_ref (); 01534 } 01535 01536 return servant; 01537 }
const char * TAO_Root_POA::imr_client_adapter_name | ( | void | ) | [static] |
Gets the value of TAO_POA_Static_Resources::imr_client_adapter_name_.
Definition at line 2650 of file Root_POA.cpp.
References ACE_String_Base< CHAR >::c_str(), TAO_POA_Static_Resources::imr_client_adapter_name_, and TAO_POA_Static_Resources::instance().
Referenced by TAO::Portable_Server::LifespanStrategyPersistent::notify_shutdown(), and TAO::Portable_Server::LifespanStrategyPersistent::notify_startup().
02651 { 02652 return TAO_POA_Static_Resources::instance ()->imr_client_adapter_name_.c_str(); 02653 }
void TAO_Root_POA::imr_client_adapter_name | ( | const char * | name | ) | [static] |
Sets the value of TAO_POA_Static_Resources::imr_client_adapter_name_.
Definition at line 2644 of file Root_POA.cpp.
References TAO_POA_Static_Resources::imr_client_adapter_name_, and TAO_POA_Static_Resources::instance().
02645 { 02646 TAO_POA_Static_Resources::instance ()->imr_client_adapter_name_ = name; 02647 }
ACE_INLINE CORBA::ULong TAO_Root_POA::increment_outstanding_requests | ( | void | ) | [protected] |
Definition at line 195 of file Root_POA.inl.
References outstanding_requests_.
Referenced by TAO::Portable_Server::Servant_Upcall::prepare_for_upcall_i().
00196 { 00197 return ++this->outstanding_requests_; 00198 }
CORBA::Object_ptr TAO_Root_POA::invoke_key_to_object | ( | void | ) |
Definition at line 1927 of file Root_POA.cpp.
References TAO_Root_POA::Key_To_Object_Params::collocated_, create_object_key(), TAO_Root_POA::Key_To_Object_Params::indirect_, key_to_object(), key_to_object_params_, TAO_Root_POA::Key_To_Object_Params::priority_, TAO_Root_POA::Key_To_Object_Params::servant_, system_id(), TAO_Root_POA::Key_To_Object_Params::system_id_, and TAO_Root_POA::Key_To_Object_Params::type_id_.
Referenced by invoke_key_to_object_helper_i().
01928 { 01929 PortableServer::ObjectId_var &system_id = 01930 *this->key_to_object_params_.system_id_; 01931 01932 // Create object key. 01933 TAO::ObjectKey_var key = 01934 this->create_object_key (system_id.in ()); 01935 01936 return this->key_to_object (key.in (), 01937 this->key_to_object_params_.type_id_, 01938 this->key_to_object_params_.servant_, 01939 this->key_to_object_params_.collocated_, 01940 this->key_to_object_params_.priority_, 01941 this->key_to_object_params_.indirect_); 01942 }
CORBA::Object_ptr TAO_Root_POA::invoke_key_to_object_helper_i | ( | const char * | repository_id, | |
const PortableServer::ObjectId & | id | |||
) |
Definition at line 1321 of file Root_POA.cpp.
References invoke_key_to_object().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::create_reference(), TAO::Portable_Server::ServantRetentionStrategyNonRetain::create_reference(), TAO::Portable_Server::ServantRetentionStrategyRetain::create_reference_with_id(), TAO::Portable_Server::ServantRetentionStrategyNonRetain::create_reference_with_id(), TAO::Portable_Server::ServantRetentionStrategyRetain::id_to_reference(), and TAO::Portable_Server::ServantRetentionStrategyRetain::servant_to_reference().
01323 { 01324 const PortableInterceptor::ObjectId &user_oid = 01325 reinterpret_cast <const PortableInterceptor::ObjectId &>(id); 01326 01327 // Ask the ORT to create the object. 01328 if (this->ORT_adapter_i ()) 01329 { 01330 // Ask the ORT to create the object. 01331 return this->ort_adapter_->make_object (repository_id, 01332 user_oid); 01333 } 01334 else 01335 { 01336 return this->invoke_key_to_object (); 01337 } 01338 }
CORBA::Boolean TAO_Root_POA::is_persistent | ( | void | ) | const |
Definition at line 1292 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::lifespan_strategy().
Referenced by is_poa_generated(), parse_ir_object_key(), set_id(), and TAO::Portable_Server::ServantRetentionStrategyRetain::strategy_init().
01293 { 01294 return active_policy_strategies_.lifespan_strategy()->is_persistent (); 01295 }
bool TAO_Root_POA::is_poa_generated | ( | CORBA::Object_ptr | reference, | |
PortableServer::ObjectId & | system_id | |||
) |
Definition at line 1424 of file Root_POA.cpp.
References CORBA::Object::_key(), is_persistent(), parse_key(), root(), system_id(), system_name(), and validate_lifespan().
Referenced by reference_to_id(), and reference_to_servant_i().
01426 { 01427 TAO::ObjectKey_var key = reference->_key (); 01428 01429 TAO_Object_Adapter::poa_name poa_system_name; 01430 CORBA::Boolean is_root = false; 01431 CORBA::Boolean is_persistent = false; 01432 CORBA::Boolean is_system_id = false; 01433 TAO::Portable_Server::Temporary_Creation_Time poa_creation_time; 01434 01435 int const result = this->parse_key (key.in (), 01436 poa_system_name, 01437 system_id, 01438 is_root, 01439 is_persistent, 01440 is_system_id, 01441 poa_creation_time); 01442 if (result != 0 || 01443 !this->root () && 01444 poa_system_name != this->system_name () || 01445 is_root != this->root () || 01446 is_system_id != this->system_id () || 01447 !this->validate_lifespan (is_persistent, poa_creation_time)) 01448 { 01449 // The passed reference is NOT generated by this POA 01450 return false; 01451 } 01452 else 01453 { 01454 // The passed reference is generated by this POA 01455 return true; 01456 } 01457 }
int TAO_Root_POA::is_poa_generated_id | ( | const PortableServer::ObjectId & | id | ) |
Definition at line 1848 of file Root_POA.cpp.
References ACE_String_Base< CHAR >::length(), name_, and ACE_OS::strncmp().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::activate_object_with_id(), and create_reference_with_id_i().
01849 { 01850 #if defined (POA_NAME_IN_POA_GENERATED_ID) 01851 01852 // Grab the buffer 01853 const char *id_buffer = (const char *) id.get_buffer (); 01854 01855 // Check to see if the POA name is the first part of the id 01856 return 01857 this->name_.length () < id.length () && 01858 ACE_OS::strncmp (id_buffer, 01859 this->name_.c_str (), 01860 this->name_.length ()) == 0; 01861 #else /* POA_NAME_IN_POA_GENERATED_ID */ 01862 01863 ACE_UNUSED_ARG (id); 01864 return 1; 01865 01866 #endif /* POA_NAME_IN_POA_GENERATED_ID */ 01867 }
bool TAO_Root_POA::is_servant_activation_allowed | ( | PortableServer::Servant | servant, | |
bool & | wait_occurred_restart_call | |||
) |
Definition at line 2449 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::id_uniqueness_strategy().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::activate_object(), TAO::Portable_Server::ServantRetentionStrategyRetain::activate_object_with_id(), and TAO::Portable_Server::RequestProcessingStrategyServantActivator::locate_servant().
02451 { 02452 return this->active_policy_strategies_.id_uniqueness_strategy ()-> 02453 is_servant_activation_allowed (servant, wait_occurred_restart_call); 02454 }
int TAO_Root_POA::is_servant_active | ( | PortableServer::Servant | servant, | |
bool & | wait_occurred_restart_call | |||
) |
Definition at line 2514 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by TAO::Portable_Server::IdUniquenessStrategyUnique::is_servant_activation_allowed().
02517 { 02518 return this->active_policy_strategies_.servant_retention_strategy ()-> 02519 is_servant_in_map (servant, wait_occurred_restart_call); 02520 }
CORBA::Object_ptr TAO_Root_POA::key_to_object | ( | const TAO::ObjectKey & | key, | |
const char * | type_id, | |||
TAO_ServantBase * | servant, | |||
CORBA::Boolean | collocated, | |||
CORBA::Short | priority, | |||
bool | indirect | |||
) | [protected] |
Wrapper for the ORB's key_to_object that will alter the object pointer if the ImplRepo is used.
Definition at line 1945 of file Root_POA.cpp.
References CORBA::Object::_nil(), ACE_DEBUG, ACE_ERROR, ACE_NEW_THROW_EX, ACE_TEXT_CHAR_TO_TCHAR, TAO_ORB_Core::check_shutdown(), TAO_ORB_Core::imr_endpoints_in_ior(), CORBA::Object::ior(), CORBA::is_nil(), key_to_stub_i(), LM_DEBUG, LM_ERROR, TAO_ORB_Core::orb(), orb_core(), orb_core_, TAO_Stub_Auto_Ptr::release(), TAO_Stub::servant_orb(), ACE_OS::strchr(), CORBA::ORB::string_to_object(), ACE_OS::strstr(), and TAO_debug_level.
Referenced by invoke_key_to_object().
01951 { 01952 // Check if the ORB is still running, otherwise throw an exception. 01953 // @@ What if the ORB was destroyed? In that case we shouldn't even 01954 // get here! 01955 this->orb_core_.check_shutdown (); 01956 01957 // 01958 // ImplRepo related. 01959 // 01960 #if (TAO_HAS_MINIMUM_CORBA == 0) 01961 01962 CORBA::Object_ptr obj = CORBA::Object::_nil (); 01963 01964 if (indirect && this->active_policy_strategies_.lifespan_strategy()->use_imr () 01965 && this->orb_core ().imr_endpoints_in_ior ()) 01966 { 01967 // Check to see if we alter the IOR. 01968 CORBA::Object_var imr = this->orb_core ().implrepo_service (); 01969 01970 if (CORBA::is_nil (imr.in ()) 01971 || !imr->_stubobj () 01972 || !imr->_stubobj ()->profile_in_use ()) 01973 { 01974 if (TAO_debug_level > 1) 01975 { 01976 ACE_DEBUG ((LM_DEBUG, 01977 "Missing ImR IOR, will not use the ImR\n")); 01978 } 01979 goto orbkey; 01980 } 01981 01982 CORBA::String_var imr_str = 01983 imr->_stubobj ()->profile_in_use ()->to_string (); 01984 01985 if (TAO_debug_level > 0) 01986 ACE_DEBUG ((LM_DEBUG, 01987 "IMR IOR = \n%s\n", 01988 ACE_TEXT_CHAR_TO_TCHAR (imr_str.in ()))); 01989 01990 // Search for "corbaloc:" alone, without the protocol. This code 01991 // should be protocol neutral. 01992 const char corbaloc[] = "corbaloc:"; 01993 char *pos = ACE_OS::strstr (imr_str.inout (), corbaloc); 01994 pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':'); 01995 01996 pos = ACE_OS::strchr (pos + 1, 01997 imr->_stubobj ()->profile_in_use ()->object_key_delimiter ()); 01998 01999 if (pos) 02000 pos[1] = 0; // Crop the string. 02001 else 02002 { 02003 if (TAO_debug_level > 0) 02004 ACE_ERROR ((LM_ERROR, 02005 "Could not parse ImR IOR, skipping ImRification\n")); 02006 goto orbkey; 02007 } 02008 02009 ACE_CString ior (imr_str.in ()); 02010 02011 // Add the key. 02012 02013 CORBA::String_var key_str; 02014 TAO::ObjectKey::encode_sequence_to_string (key_str.inout (), key); 02015 02016 ior += key_str.in (); 02017 02018 if (TAO_debug_level > 0) 02019 ACE_DEBUG ((LM_DEBUG, 02020 "ImR-ified IOR = \n%s\n", 02021 ACE_TEXT_CHAR_TO_TCHAR (ior.c_str ()))); 02022 02023 obj = this->orb_core_.orb ()->string_to_object (ior.c_str ()); 02024 02025 return obj; 02026 } 02027 02028 orbkey: 02029 02030 #else 02031 ACE_UNUSED_ARG (indirect); 02032 #endif /* TAO_HAS_MINIMUM_CORBA */ 02033 02034 TAO_Stub *data = this->key_to_stub_i (key, type_id, priority); 02035 02036 TAO_Stub_Auto_Ptr safe_data (data); 02037 02038 CORBA::Object_ptr tmp; 02039 02040 if (this->orb_core_.optimize_collocation_objects ()) 02041 { 02042 ACE_NEW_THROW_EX (tmp, CORBA::Object (data, 02043 collocated, 02044 servant), 02045 CORBA::INTERNAL ()); 02046 02047 } 02048 else 02049 { 02050 ACE_NEW_THROW_EX (tmp, 02051 CORBA::Object (data, 02052 collocated), 02053 CORBA::INTERNAL ()); 02054 } 02055 02056 data->servant_orb (this->orb_core_.orb ()); 02057 02058 // Transfer ownership to the Object. 02059 (void) safe_data.release (); 02060 02061 return tmp; 02062 }
TAO_Stub * TAO_Root_POA::key_to_stub | ( | const TAO::ObjectKey & | key, | |
const char * | type_id, | |||
CORBA::Short | priority | |||
) |
Create the correct stub, properly initialized with the attributes and policies attached to the current POA.
Definition at line 2065 of file Root_POA.cpp.
References TAO_ORB_Core::check_shutdown(), key_to_stub_i(), and orb_core_.
02068 { 02069 // Check if the ORB is still running, otherwise throw an exception. 02070 // @@ What if the ORB was destroyed? In that case we shouldn't even 02071 // get here! 02072 this->orb_core_.check_shutdown (); 02073 02074 return this->key_to_stub_i (key, type_id, priority); 02075 }
TAO_Stub * TAO_Root_POA::key_to_stub_i | ( | const TAO::ObjectKey & | key, | |
const char * | type_id, | |||
CORBA::Short | priority | |||
) | [protected, virtual] |
Like key_to_stub() but assume that the ORB is not shutting down.
Definition at line 2078 of file Root_POA.cpp.
References TAO_Thread_Lane_Resources::acceptor_registry(), ACE_NEW_RETURN, client_exposed_policies(), TAO_Acceptor_Filter_Factory::create_object(), create_stub_object(), filter_factory_, TAO_ORB_Core::lane_resources(), and orb_core_.
Referenced by key_to_object(), and key_to_stub().
02081 { 02082 CORBA::PolicyList_var client_exposed_policies = 02083 this->client_exposed_policies (priority); 02084 02085 TAO_Acceptor_Filter* filter = 0; 02086 02087 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) 02088 if (this->filter_factory_) 02089 { 02090 filter = this->filter_factory_->create_object (this->poa_manager_); 02091 } 02092 else 02093 #endif 02094 { 02095 ACE_NEW_RETURN (filter, 02096 TAO_Default_Acceptor_Filter (), 02097 0); 02098 } 02099 02100 // Give ownership to the auto pointer. 02101 auto_ptr<TAO_Acceptor_Filter> new_filter (filter); 02102 02103 TAO_Stub *data = 02104 this->create_stub_object ( 02105 key, 02106 type_id, 02107 client_exposed_policies._retn (), 02108 filter, 02109 this->orb_core_.lane_resources ().acceptor_registry ()); 02110 02111 return data; 02112 }
PortableServer::Servant TAO_Root_POA::locate_servant_i | ( | const char * | operation, | |
const PortableServer::ObjectId & | id, | |||
TAO::Portable_Server::Servant_Upcall & | servant_upcall, | |||
TAO::Portable_Server::POA_Current_Impl & | poa_current_impl, | |||
bool & | wait_occurred_restart_call | |||
) | [protected] |
Definition at line 1566 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy().
01571 { 01572 return this->active_policy_strategies_.request_processing_strategy()-> 01573 locate_servant (operation, 01574 system_id, 01575 servant_upcall, 01576 poa_current_impl, 01577 wait_occurred_restart_call); 01578 }
TAO_SERVANT_LOCATION TAO_Root_POA::locate_servant_i | ( | const PortableServer::ObjectId & | id, | |
PortableServer::Servant & | servant | |||
) | [protected] |
Definition at line 2266 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy().
Referenced by TAO_Object_Adapter::find_servant_i(), TAO_Object_Adapter::locate_servant_i(), and TAO::Portable_Server::Servant_Upcall::prepare_for_upcall_i().
02268 { 02269 return this->active_policy_strategies_.request_processing_strategy()-> 02270 locate_servant (system_id, servant); 02271 }
ACE_INLINE ACE_Lock & TAO_Root_POA::lock | ( | void | ) |
Definition at line 14 of file Root_POA.inl.
References lock_.
Referenced by new_POA().
00015 { 00016 return this->lock_; 00017 }
ACE_INLINE const ACE_CString & TAO_Root_POA::name | ( | void | ) | const |
Definition at line 87 of file Root_POA.inl.
References name_.
Referenced by TAO_Object_Adapter::activate_poa(), and new_POA().
00088 { 00089 return this->name_; 00090 }
ACE_INLINE char TAO_Root_POA::name_separator | ( | void | ) | [static] |
Definition at line 111 of file Root_POA.inl.
Referenced by TAO_Object_Adapter::poa_name_iterator::operator++(), and set_folded_name().
ACE_INLINE CORBA::ULong TAO_Root_POA::name_separator_length | ( | void | ) | [static] |
Definition at line 117 of file Root_POA.inl.
Referenced by TAO_Object_Adapter::poa_name_iterator::operator *(), and set_folded_name().
TAO_Network_Priority_Hook * TAO_Root_POA::network_priority_hook | ( | void | ) |
obtain a handle to the network priority hooks
Definition at line 2529 of file Root_POA.cpp.
References network_priority_hook_.
Referenced by TAO_Default_Servant_Dispatcher::pre_invoke_remote_request().
02530 { 02531 return this->network_priority_hook_; 02532 }
TAO_Root_POA * TAO_Root_POA::new_POA | ( | const String & | name, | |
PortableServer::POAManager_ptr | poa_manager, | |||
const TAO_POA_Policy_Set & | policies, | |||
TAO_Root_POA * | parent, | |||
ACE_Lock & | lock, | |||
TAO_SYNCH_MUTEX & | thread_lock, | |||
TAO_ORB_Core & | orb_core, | |||
TAO_Object_Adapter * | object_adapter | |||
) | [protected, virtual] |
Template method for creating new POA's of this type.
Definition at line 501 of file Root_POA.cpp.
References ACE_NEW_THROW_EX, lock(), name(), object_adapter(), orb_core(), and policies().
Referenced by create_POA_i().
00509 { 00510 TAO_Regular_POA *poa = 0; 00511 00512 ACE_NEW_THROW_EX (poa, 00513 TAO_Regular_POA (name, 00514 poa_manager, 00515 policies, 00516 parent, 00517 lock, 00518 thread_lock, 00519 orb_core, 00520 object_adapter), 00521 CORBA::NO_MEMORY ()); 00522 00523 return poa; 00524 }
ACE_INLINE char TAO_Root_POA::non_root_key_char | ( | void | ) | [static, protected] |
Definition at line 165 of file Root_POA.inl.
Referenced by parse_key(), TAO_Regular_POA::root_key_type(), and set_id().
TAO_Object_Adapter & TAO_Root_POA::object_adapter | ( | void | ) |
Definition at line 1921 of file Root_POA.cpp.
References object_adapter_.
Referenced by complete_destruction_i(), create_POA_i(), destroy_i(), TAO::Portable_Server::RequestProcessingStrategyServantLocator::locate_servant(), new_POA(), TAO::Portable_Server::POA_Guard::POA_Guard(), and TAO_Root_POA().
01922 { 01923 return *this->object_adapter_; 01924 }
ACE_INLINE TAO_ORB_Core & TAO_Root_POA::orb_core | ( | void | ) | const |
ORB Core for POA.
Reimplemented from CORBA::Object.
Definition at line 213 of file Root_POA.inl.
References orb_core_.
Referenced by check_for_valid_wait_for_completions(), key_to_object(), new_POA(), TAO::Portable_Server::POA_Current_Impl::orb_core(), TAO::Portable_Server::ServantRetentionStrategyRetain::strategy_init(), and TAO::Portable_Server::LifespanStrategyPersistent::strategy_init().
00214 { 00215 return this->orb_core_; 00216 }
TAO::ORT_Adapter * TAO_Root_POA::ORT_adapter | ( | void | ) | [protected] |
Get the ORT adapter, in case there is no adapter yet, this method will try to create one and hold the POA lock
Definition at line 2572 of file Root_POA.cpp.
References ort_adapter_, ORT_adapter_i(), and TAO_POA_GUARD_RETURN.
Referenced by get_adapter_template(), get_obj_ref_factory(), and set_obj_ref_factory().
02573 { 02574 if (this->ort_adapter_ != 0) 02575 return this->ort_adapter_; 02576 02577 // Lock access for the duration of this transaction. 02578 TAO_POA_GUARD_RETURN (0); 02579 02580 // DCL .. 02581 if (this->ort_adapter_ != 0) 02582 { 02583 return this->ort_adapter_; 02584 } 02585 02586 return this->ORT_adapter_i (); 02587 }
TAO::ORT_Adapter_Factory * TAO_Root_POA::ORT_adapter_factory | ( | void | ) | [protected] |
Definition at line 2303 of file Root_POA.cpp.
References TAO_ORB_Core::configuration(), ACE_Dynamic_Service< TYPE >::instance(), orb_core_, and ort_adapter_factory_name().
Referenced by complete_destruction_i(), destroy_i(), and ORT_adapter_i().
02304 { 02305 return ACE_Dynamic_Service<TAO::ORT_Adapter_Factory>::instance 02306 (orb_core_.configuration (), 02307 TAO_Root_POA::ort_adapter_factory_name ()); 02308 }
const char * TAO_Root_POA::ort_adapter_factory_name | ( | void | ) | [static] |
Definition at line 2638 of file Root_POA.cpp.
References ACE_String_Base< CHAR >::c_str(), TAO_POA_Static_Resources::instance(), and TAO_POA_Static_Resources::ort_adapter_factory_name_.
Referenced by ORT_adapter_factory().
02639 { 02640 return TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_.c_str(); 02641 }
void TAO_Root_POA::ort_adapter_factory_name | ( | const char * | name | ) | [static] |
Definition at line 2619 of file Root_POA.cpp.
References TAO_POA_Static_Resources::instance(), and TAO_POA_Static_Resources::ort_adapter_factory_name_.
02620 { 02621 TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_ = 02622 name; 02623 }
TAO::ORT_Adapter * TAO_Root_POA::ORT_adapter_i | ( | void | ) | [protected] |
Get the ORT adapter, in case there is no adapter yet, this method will try to create one but assumes the POA lock is already hold
Definition at line 2311 of file Root_POA.cpp.
References adapter_name(), adapter_name_i(), orb_core_, TAO_ORB_Core::orbid(), ort_adapter_, and ORT_adapter_factory().
Referenced by complete_destruction_i(), destroy_i(), and ORT_adapter().
02312 { 02313 if (this->ort_adapter_ != 0) 02314 return this->ort_adapter_; 02315 02316 try 02317 { 02318 TAO::ORT_Adapter_Factory * ort_ap_factory = this->ORT_adapter_factory (); 02319 02320 if (!ort_ap_factory) 02321 return 0; 02322 02323 // Get the full adapter name of this POA, do this before we 02324 // create the adapter so that in case this fails, we just 02325 // return 0 and not a not activated adapter 02326 PortableInterceptor::AdapterName *adapter_name = this->adapter_name_i (); 02327 02328 this->ort_adapter_ = ort_ap_factory->create (); 02329 02330 if (!this->ort_adapter_) 02331 return 0; 02332 02333 // @todo We have to look at this, we activate it but hold the POA lock, 02334 // in case we are called by ORT_adapter, we shouldn't keep the lock 02335 // here, but then the ort_adapter should be guarded against multiple 02336 // activations. 02337 this->ort_adapter_->activate (this->orb_core_.server_id (), 02338 this->orb_core_.orbid (), 02339 adapter_name, 02340 this); 02341 } 02342 catch (const ::CORBA::Exception& ex) 02343 { 02344 ex._tao_print_exception ( 02345 "(%P|%t) Cannot initialize the " 02346 "object_reference_template_adapter\n"); 02347 } 02348 02349 return this->ort_adapter_; 02350 }
ACE_INLINE void TAO_Root_POA::outstanding_requests | ( | CORBA::ULong | new_outstanding_requests | ) | [protected] |
Definition at line 189 of file Root_POA.inl.
References outstanding_requests_.
00190 { 00191 this->outstanding_requests_ = new_outstanding_requests; 00192 }
ACE_INLINE CORBA::ULong TAO_Root_POA::outstanding_requests | ( | void | ) | const |
Definition at line 183 of file Root_POA.inl.
References outstanding_requests_.
Referenced by TAO::Portable_Server::Non_Servant_Upcall::~Non_Servant_Upcall().
00184 { 00185 return this->outstanding_requests_; 00186 }
int TAO_Root_POA::parse_ir_object_key | ( | const TAO::ObjectKey & | object_key, | |
PortableServer::ObjectId & | user_id | |||
) | [static] |
Calls protected static method used when POACurrent is not appropriate.
Definition at line 1902 of file Root_POA.cpp.
References is_persistent(), and parse_key().
01904 { 01905 TAO_Object_Adapter::poa_name poa_system_name; 01906 CORBA::Boolean is_root = false; 01907 CORBA::Boolean is_persistent = false; 01908 CORBA::Boolean is_system_id = false; 01909 TAO::Portable_Server::Temporary_Creation_Time poa_creation_time; 01910 01911 return TAO_Root_POA::parse_key (object_key, 01912 poa_system_name, 01913 user_id, 01914 is_root, 01915 is_persistent, 01916 is_system_id, 01917 poa_creation_time); 01918 }
int TAO_Root_POA::parse_key | ( | const TAO::ObjectKey & | key, | |
TAO_Object_Adapter::poa_name & | poa_system_name, | |||
PortableServer::ObjectId & | system_id, | |||
CORBA::Boolean & | is_root, | |||
CORBA::Boolean & | is_persistent, | |||
CORBA::Boolean & | is_system_id, | |||
TAO::Portable_Server::Temporary_Creation_Time & | poa_creation_time | |||
) | [static, protected] |
Definition at line 1582 of file Root_POA.cpp.
References ACE_NTOHL, TAO::Portable_Server::Temporary_Creation_Time::creation_time(), TAO::Portable_Server::Creation_Time::creation_time_length(), ACE_OS::memcpy(), non_root_key_char(), persistent_key_char(), persistent_key_type_length(), root_key_char(), root_key_type(), root_key_type_length(), system_id_key_char(), system_id_key_type_length(), TAO_Active_Object_Map::system_id_size(), TAO_OBJECTKEY_PREFIX_SIZE, transient_key_char(), TAO_Object_Adapter::transient_poa_name_size(), and user_id_key_char().
Referenced by is_poa_generated(), TAO_Object_Adapter::locate_poa(), and parse_ir_object_key().
01589 { 01590 // Get the object key octets. 01591 const CORBA::Octet *key_data = key.get_buffer (); 01592 01593 // Skip the object key prefix since we have already checked for this. 01594 CORBA::ULong starting_at = TAO_OBJECTKEY_PREFIX_SIZE; 01595 01596 // Check the root indicator. 01597 char root_key_type = key_data[starting_at]; 01598 if (root_key_type == TAO_Root_POA::root_key_char ()) 01599 { 01600 is_root = true; 01601 } 01602 else if (root_key_type == TAO_Root_POA::non_root_key_char ()) 01603 { 01604 is_root = false; 01605 } 01606 else 01607 { 01608 // Incorrect key 01609 return -1; 01610 } 01611 01612 // Skip past the system id indicator 01613 starting_at += TAO_Root_POA::root_key_type_length (); 01614 01615 // Check the system id indicator. 01616 char system_id_key_type = key_data[starting_at]; 01617 if (system_id_key_type == TAO_Root_POA::system_id_key_char ()) 01618 { 01619 is_system_id = true; 01620 } 01621 else if (system_id_key_type == TAO_Root_POA::user_id_key_char ()) 01622 { 01623 is_system_id = false; 01624 } 01625 else 01626 { 01627 // Incorrect key 01628 return -1; 01629 } 01630 01631 // Skip past the system id indicator 01632 starting_at += TAO_Root_POA::system_id_key_type_length (); 01633 01634 // Check the persistence indicator 01635 char persistent_key_type = key_data[starting_at]; 01636 if (persistent_key_type == TAO_Root_POA::persistent_key_char ()) 01637 { 01638 is_persistent = true; 01639 } 01640 else if (persistent_key_type == TAO_Root_POA::transient_key_char ()) 01641 { 01642 is_persistent = false; 01643 } 01644 else 01645 { 01646 // Incorrect key 01647 return -1; 01648 } 01649 01650 // Skip past the persistent indicator 01651 starting_at += TAO_Root_POA::persistent_key_type_length (); 01652 01653 #if (POA_NO_TIMESTAMP == 0) 01654 // Grab the timestamp for transient POAs. 01655 if (!is_persistent) 01656 { 01657 // Take the creation time for the timestamp 01658 poa_creation_time.creation_time (key_data + starting_at); 01659 01660 // Skip past the timestamp 01661 starting_at += TAO::Portable_Server::Creation_Time::creation_time_length (); 01662 } 01663 #else 01664 ACE_UNUSED_ARG (poa_creation_time); 01665 #endif /* POA_NO_TIMESTAMP */ 01666 01667 // Calculate the size of the POA name. 01668 CORBA::ULong poa_name_size = 0; 01669 if (!is_persistent) 01670 { 01671 // Transient POAs have fixed size. 01672 poa_name_size = TAO_Object_Adapter::transient_poa_name_size (); 01673 } 01674 else if (is_system_id) 01675 { 01676 // System ids have fixed size. 01677 poa_name_size = static_cast <CORBA::ULong> 01678 (key.length () - starting_at - 01679 TAO_Active_Object_Map::system_id_size ()); 01680 } 01681 else 01682 { 01683 // Get the size from the object key. 01684 ACE_OS::memcpy (&poa_name_size, 01685 key_data + starting_at, 01686 sizeof (poa_name_size)); 01687 poa_name_size = ACE_NTOHL (poa_name_size); 01688 01689 starting_at += sizeof (poa_name_size); 01690 } 01691 01692 // Grep the name if there is a name 01693 if (!is_root) 01694 { 01695 poa_system_name.replace (poa_name_size, 01696 poa_name_size, 01697 (CORBA::Octet *) key_data + starting_at, 01698 0); 01699 01700 starting_at += poa_name_size; 01701 } 01702 01703 // The rest is the system id. 01704 CORBA::ULong system_id_size = key.length () - starting_at; 01705 01706 // Reset <system_id>. 01707 system_id.length (system_id_size); 01708 CORBA::Octet * buf = system_id.get_buffer (); 01709 ACE_OS::memcpy (buf, key_data + starting_at, system_id_size); 01710 01711 // Success 01712 return 0; 01713 }
ACE_INLINE CORBA::Boolean TAO_Root_POA::persistent | ( | void | ) | [protected] |
Definition at line 81 of file Root_POA.inl.
Referenced by TAO_Object_Adapter::bind_poa(), and TAO_Object_Adapter::unbind_poa().
ACE_INLINE char TAO_Root_POA::persistent_key_char | ( | void | ) | [static, protected] |
ACE_INLINE CORBA::ULong TAO_Root_POA::persistent_key_type_length | ( | void | ) | [static, protected] |
void TAO_Root_POA::poa_activated_hook | ( | ) | [virtual] |
Hook - The POA has been (or is being) activated.
These hooks are needed by the CSD strategy to override and no-ops by default.
Definition at line 2711 of file Root_POA.cpp.
void TAO_Root_POA::poa_deactivated_hook | ( | ) | [virtual] |
Hook - The POA has been deactivated.
Definition at line 2716 of file Root_POA.cpp.
Referenced by destroy_i().
ACE_INLINE TAO_POA_Policy_Set & TAO_Root_POA::policies | ( | void | ) |
Accessor for POA policies.
Definition at line 20 of file Root_POA.inl.
References policies_.
Referenced by client_exposed_policies(), create_POA_i(), and new_POA().
00021 { 00022 return this->policies_; 00023 }
void TAO_Root_POA::post_invoke_servant_cleanup | ( | const PortableServer::ObjectId & | system_id, | |
const TAO::Portable_Server::Servant_Upcall & | servant_upcall | |||
) |
Definition at line 2499 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy().
Referenced by TAO::Portable_Server::Servant_Upcall::post_invoke_servant_cleanup().
02502 { 02503 this->active_policy_strategies_.request_processing_strategy ()-> 02504 post_invoke_servant_cleanup (system_id, servant_upcall); 02505 }
TAO::Portable_Server::Cached_Policies::PriorityModel TAO_Root_POA::priority_model | ( | void | ) | const |
Definition at line 2535 of file Root_POA.cpp.
References cached_policies_, and TAO::Portable_Server::Cached_Policies::priority_model().
02536 { 02537 return cached_policies_.priority_model (); 02538 }
int TAO_Root_POA::rebind_using_user_id_and_system_id | ( | PortableServer::Servant | servant, | |
const PortableServer::ObjectId & | user_id, | |||
const PortableServer::ObjectId & | system_id, | |||
TAO::Portable_Server::Servant_Upcall & | servant_upcall | |||
) |
Definition at line 2464 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
02469 { 02470 return this->active_policy_strategies_.servant_retention_strategy ()-> 02471 rebind_using_user_id_and_system_id (servant, 02472 user_id, 02473 system_id, 02474 servant_upcall); 02475 }
PortableServer::ObjectId * TAO_Root_POA::reference_to_id | ( | CORBA::Object_ptr | reference | ) |
Definition at line 1460 of file Root_POA.cpp.
References active_policy_strategies_, CORBA::is_nil(), is_poa_generated(), TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy(), system_id(), and TAO_POA_GUARD_RETURN.
01461 { 01462 // Make sure that the reference is valid. 01463 if (CORBA::is_nil (reference)) 01464 { 01465 throw ::CORBA::BAD_PARAM (); 01466 } 01467 01468 // The WrongPolicy exception is declared to allow future extensions. 01469 01470 // This operation is valid only if the reference was created by the 01471 // POA on which the operation is being performed. If the object 01472 // reference was not created by this POA, the WrongAdapter exception 01473 // is raised. 01474 PortableServer::ObjectId system_id; 01475 bool const is_generated = this->is_poa_generated (reference, system_id); 01476 01477 if (!is_generated) 01478 { 01479 throw PortableServer::POA::WrongAdapter (); 01480 } 01481 01482 // Lock access for the duration of this transaction. 01483 TAO_POA_GUARD_RETURN (0); 01484 01485 return this->active_policy_strategies_.servant_retention_strategy()-> 01486 system_id_to_object_id (system_id); 01487 }
PortableServer::Servant TAO_Root_POA::reference_to_servant | ( | CORBA::Object_ptr | reference | ) |
Definition at line 730 of file Root_POA.cpp.
References reference_to_servant_i(), and TAO_POA_GUARD_RETURN.
00731 { 00732 // Lock access for the duration of this transaction. 00733 TAO_POA_GUARD_RETURN (0); 00734 00735 return this->reference_to_servant_i (reference); 00736 }
PortableServer::Servant TAO_Root_POA::reference_to_servant_i | ( | CORBA::Object_ptr | reference | ) | [protected] |
Definition at line 1381 of file Root_POA.cpp.
References TAO_ServantBase::_add_ref(), active_policy_strategies_, CORBA::is_nil(), is_poa_generated(), TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy(), and system_id().
Referenced by reference_to_servant().
01382 { 01383 // Make sure that the reference is valid. 01384 if (CORBA::is_nil (reference)) 01385 { 01386 throw ::CORBA::BAD_PARAM (); 01387 } 01388 01389 PortableServer::ObjectId system_id; 01390 bool const is_generated = 01391 this->is_poa_generated (reference, system_id); 01392 01393 if (!is_generated) 01394 { 01395 // In case this object reference is not generated by this POA throw 01396 // an exception 01397 throw PortableServer::POA::WrongAdapter (); 01398 } 01399 01400 PortableServer::Servant servant = 01401 this->active_policy_strategies_.request_processing_strategy()-> 01402 system_id_to_servant (system_id); 01403 01404 if (servant != 0) 01405 { 01406 // ATTENTION: Trick locking here, see class header for details 01407 TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); 01408 ACE_UNUSED_ARG (non_servant_upcall); 01409 01410 // The POA invokes _add_ref once on the Servant before returning 01411 // it. If the application uses reference counting, the caller of 01412 // id_to_servant is responsible for invoking _remove_ref once on 01413 // the returned Servant when it is finished with it. A 01414 // conforming caller need not invoke _remove_ref on the returned 01415 // Servant if the type of the Servant uses the default reference 01416 // counting inherited from ServantBase. 01417 servant->_add_ref (); 01418 } 01419 01420 return servant; 01421 }
void TAO_Root_POA::remove_from_parent_i | ( | void | ) | [protected, virtual] |
Reimplemented in TAO_Regular_POA.
Definition at line 801 of file Root_POA.cpp.
Referenced by destroy_i().
CORBA::Boolean TAO_Root_POA::root | ( | void | ) | const [protected, virtual] |
Reimplemented in TAO_Regular_POA.
Definition at line 2566 of file Root_POA.cpp.
Referenced by is_poa_generated().
ACE_INLINE char TAO_Root_POA::root_key_char | ( | void | ) | [static, protected] |
Definition at line 159 of file Root_POA.inl.
Referenced by parse_key(), root_key_type(), and set_id().
ACE_INLINE char TAO_Root_POA::root_key_type | ( | void | ) | [protected, virtual] |
Reimplemented in TAO_Regular_POA.
Definition at line 171 of file Root_POA.inl.
References root_key_char().
Referenced by parse_key(), and TAO_Regular_POA::root_key_type().
00172 { 00173 return TAO_Root_POA::root_key_char (); 00174 }
ACE_INLINE CORBA::ULong TAO_Root_POA::root_key_type_length | ( | void | ) | [static, protected] |
void TAO_Root_POA::save_ior_component | ( | const IOP::TaggedComponent & | component | ) |
Store the given TaggedComponent for eventual insertion into all object reference profiles.
Definition at line 2139 of file Root_POA.cpp.
References tagged_component_.
02140 { 02141 CORBA::ULong const old_len = this->tagged_component_.length (); 02142 02143 this->tagged_component_.length (old_len + 1); 02144 this->tagged_component_[old_len] = component; 02145 }
void TAO_Root_POA::save_ior_component_and_profile_id | ( | const IOP::TaggedComponent & | component, | |
IOP::ProfileId | profile_id | |||
) |
Store the given TaggedComponent for eventual insertion into all object reference profiles with the given ProfileId.
Definition at line 2149 of file Root_POA.cpp.
References profile_id_array_, ACE_Array_Base< T >::size(), and tagged_component_id_.
02151 { 02152 // The length of this->tagged_component_id_ is the same as the 02153 // length of the profile_id_array_ since we are trying to make a 02154 // one-to-one link between these two arrays. So, whenever 02155 // this->tagged_component_id_ is increased, we need to increase the 02156 // size of this->profile_id_array_ also. 02157 02158 CORBA::ULong const old_len = this->tagged_component_id_.length (); 02159 02160 CORBA::ULong const new_len = old_len + 1; 02161 02162 this->tagged_component_id_.length (new_len); 02163 this->tagged_component_id_[old_len] = component; 02164 02165 this->profile_id_array_.size (new_len); 02166 this->profile_id_array_[old_len] = profile_id; 02167 }
void TAO_Root_POA::servant_activated_hook | ( | PortableServer::Servant | servant, | |
const PortableServer::ObjectId & | oid | |||
) | [virtual] |
Hook - A servant has been activated.
Definition at line 2721 of file Root_POA.cpp.
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::activate_object(), TAO::Portable_Server::ServantRetentionStrategyRetain::activate_object_with_id(), TAO::Portable_Server::ServantRetentionStrategyRetain::servant_to_system_id_i(), and TAO::Portable_Server::ServantRetentionStrategyRetain::servant_to_user_id().
void TAO_Root_POA::servant_deactivated_hook | ( | PortableServer::Servant | servant, | |
const PortableServer::ObjectId & | oid | |||
) | [virtual] |
Hook - A servant has been deactivated.
Definition at line 2727 of file Root_POA.cpp.
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::deactivate_map_entry().
ACE_INLINE TAO_SYNCH_CONDITION & TAO_Root_POA::servant_deactivation_condition | ( | void | ) |
Definition at line 231 of file Root_POA.inl.
References servant_deactivation_condition_.
00232 { 00233 return servant_deactivation_condition_; 00234 }
CORBA::Boolean TAO_Root_POA::servant_has_remaining_activations | ( | PortableServer::Servant | servant | ) |
Definition at line 2478 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by TAO::Portable_Server::RequestProcessingStrategyServantActivator::etherealize_servant().
02479 { 02480 return this->active_policy_strategies_.servant_retention_strategy ()-> 02481 servant_has_remaining_activations (servant); 02482 }
TAO_SERVANT_LOCATION TAO_Root_POA::servant_present | ( | const PortableServer::ObjectId & | system_id, | |
PortableServer::Servant & | servant | |||
) |
Definition at line 2274 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by TAO::Portable_Server::RequestProcessingStrategyServantLocator::locate_servant(), TAO::Portable_Server::RequestProcessingStrategyServantActivator::locate_servant(), TAO::Portable_Server::RequestProcessingStrategyDefaultServant::locate_servant(), and TAO::Portable_Server::RequestProcessingStrategyAOMOnly::locate_servant().
02276 { 02277 return this->active_policy_strategies_.servant_retention_strategy()-> 02278 servant_present (system_id, servant); 02279 }
PortableServer::ObjectId * TAO_Root_POA::servant_to_id | ( | PortableServer::Servant | p_servant | ) |
Definition at line 712 of file Root_POA.cpp.
References servant_to_id_i(), and TAO_POA_GUARD_RETURN.
Referenced by servant_to_id_i().
00713 { 00714 // If we had upgradeable locks, this would initially be a read lock 00715 // 00716 // Lock access for the duration of this transaction. 00717 TAO_POA_GUARD_RETURN (0); 00718 00719 return this->servant_to_id_i (servant); 00720 }
PortableServer::ObjectId * TAO_Root_POA::servant_to_id_i | ( | PortableServer::Servant | servant | ) |
Definition at line 1367 of file Root_POA.cpp.
References active_policy_strategies_, TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy(), and servant_to_id().
Referenced by servant_to_id().
01368 { 01369 return this->active_policy_strategies_.request_processing_strategy()-> 01370 servant_to_id (servant); 01371 }
CORBA::Object_ptr TAO_Root_POA::servant_to_reference | ( | PortableServer::Servant | p_servant | ) |
Definition at line 739 of file Root_POA.cpp.
References CORBA::Object::_nil(), servant_to_reference_i(), and TAO_POA_GUARD_RETURN.
Referenced by servant_to_reference_i().
00740 { 00741 TAO_POA_GUARD_RETURN (CORBA::Object::_nil ()); 00742 00743 return this->servant_to_reference_i (servant); 00744 }
CORBA::Object_ptr TAO_Root_POA::servant_to_reference_i | ( | PortableServer::Servant | p_servant | ) | [protected] |
Definition at line 1374 of file Root_POA.cpp.
References active_policy_strategies_, TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy(), and servant_to_reference().
Referenced by servant_to_reference().
01375 { 01376 return this->active_policy_strategies_.servant_retention_strategy()-> 01377 servant_to_reference (servant); 01378 }
PortableServer::ObjectId * TAO_Root_POA::servant_to_user_id | ( | PortableServer::Servant | p_servant | ) |
Definition at line 723 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by TAO::Portable_Server::RequestProcessingStrategyServantManager::servant_to_id(), TAO::Portable_Server::RequestProcessingStrategyDefaultServant::servant_to_id(), and TAO::Portable_Server::RequestProcessingStrategyAOMOnly::servant_to_id().
00724 { 00725 return this->active_policy_strategies_.servant_retention_strategy()-> 00726 servant_to_user_id (servant); 00727 }
CORBA::Short TAO_Root_POA::server_priority | ( | void | ) | const |
Definition at line 2508 of file Root_POA.cpp.
References cached_policies_, and TAO::Portable_Server::Cached_Policies::server_priority().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::servant_to_reference().
02509 { 02510 return this->cached_policies_.server_priority (); 02511 }
CORBA::Policy * TAO_Root_POA::server_protocol | ( | void | ) | [virtual] |
void TAO_Root_POA::set_folded_name | ( | TAO_Root_POA * | parent | ) | [protected] |
Definition at line 1870 of file Root_POA.cpp.
References folded_name(), folded_name_, ACE_String_Base< CHAR >::length(), ACE_OS::memcpy(), name_, name_separator(), and name_separator_length().
Referenced by TAO_Root_POA().
01871 { 01872 size_t length = 0; 01873 size_t parent_length = 0; 01874 01875 if (parent != 0) 01876 { 01877 parent_length = parent->folded_name ().length (); 01878 length += parent_length; 01879 } 01880 01881 length += this->name_.length (); 01882 length += TAO_Root_POA::name_separator_length (); 01883 01884 this->folded_name_.length (static_cast <CORBA::ULong> (length)); 01885 CORBA::Octet *folded_name_buffer = this->folded_name_.get_buffer (); 01886 01887 if (parent != 0) 01888 { 01889 ACE_OS::memcpy (folded_name_buffer, 01890 parent->folded_name ().get_buffer (), 01891 parent_length); 01892 } 01893 01894 ACE_OS::memcpy (&folded_name_buffer[parent_length], 01895 this->name_.c_str (), 01896 this->name_.length ()); 01897 01898 folded_name_buffer[length - TAO_Root_POA::name_separator_length ()] = TAO_Root_POA::name_separator (); 01899 }
void TAO_Root_POA::set_id | ( | TAO_Root_POA * | parent | ) | [protected] |
Definition at line 1750 of file Root_POA.cpp.
References ACE_HTONL, active_policy_strategies_, id_, TAO::Portable_Server::Active_Policy_Strategies::id_assignment_strategy(), is_persistent(), TAO::Portable_Server::Active_Policy_Strategies::lifespan_strategy(), ACE_OS::memcpy(), non_root_key_char(), objectkey_prefix, root_key_char(), root_key_type_length(), system_id(), system_name_, and TAO_OBJECTKEY_PREFIX_SIZE.
Referenced by TAO_Root_POA().
01751 { 01752 // Calculate the prefix size. 01753 CORBA::ULong prefix_size = 0; 01754 prefix_size += TAO_OBJECTKEY_PREFIX_SIZE; 01755 01756 // If we are dealing with a persistent POA and user ids are being 01757 // used, then we need to add the POA name length field to the object 01758 // key. Otherwise, the POA name length can be calculated by looking 01759 // at the remainder after extracting other parts of the key. 01760 bool const add_poa_name_length = 01761 this->is_persistent () && 01762 !this->system_id (); 01763 01764 // Size required by the POA name. 01765 CORBA::ULong poa_name = 0; 01766 01767 // Calculate the space required for the POA name. 01768 CORBA::ULong poa_name_length = this->system_name_->length (); 01769 if (parent != 0) 01770 { 01771 poa_name += poa_name_length; 01772 } 01773 01774 // Check if we need to added the length of the POA name. 01775 if (add_poa_name_length) 01776 { 01777 poa_name += sizeof (poa_name_length); 01778 } 01779 01780 // Get the space needed for the lifespan length 01781 // byte. 01782 CORBA::ULong const lifespan_key_length = 01783 this->active_policy_strategies_.lifespan_strategy()->key_length (); 01784 01785 CORBA::ULong const id_assignment_key_length = 01786 this->active_policy_strategies_.id_assignment_strategy()->key_type_length (); 01787 01788 // Calculate the space required for the POA id. 01789 CORBA::ULong const buffer_size = 01790 prefix_size + 01791 this->root_key_type_length () + 01792 id_assignment_key_length + 01793 lifespan_key_length + 01794 poa_name; 01795 01796 // Create the buffer for the POA id. 01797 this->id_.length (buffer_size); 01798 CORBA::Octet *buffer = &this->id_[0]; 01799 01800 // Keeps track of where the next infomation goes; start at 0 byte. 01801 CORBA::ULong starting_at = 0; 01802 01803 // Add the object key prefix. 01804 ACE_OS::memcpy (&buffer[starting_at], 01805 &objectkey_prefix[0], 01806 TAO_OBJECTKEY_PREFIX_SIZE); 01807 01808 starting_at += TAO_OBJECTKEY_PREFIX_SIZE; 01809 01810 // Copy the root byte. 01811 if (parent != 0) 01812 { 01813 buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::non_root_key_char (); 01814 } 01815 else 01816 { 01817 buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::root_key_char (); 01818 } 01819 starting_at += this->root_key_type_length (); 01820 01821 // Add the id_assignment part 01822 this->active_policy_strategies_.id_assignment_strategy()->create_key (buffer, starting_at); 01823 01824 // Add the lifespan part 01825 this->active_policy_strategies_.lifespan_strategy()->create_key (buffer, starting_at); 01826 01827 // Check if we need to added the length of the POA name. 01828 if (add_poa_name_length) 01829 { 01830 poa_name_length = ACE_HTONL (poa_name_length); 01831 ACE_OS::memcpy (&buffer[starting_at], 01832 &poa_name_length, 01833 sizeof (poa_name_length)); 01834 starting_at += sizeof (poa_name_length); 01835 } 01836 01837 // Put the POA name into the key (for non-root POAs). 01838 if (parent != 0) 01839 { 01840 ACE_OS::memcpy (&buffer[starting_at], 01841 this->system_name_->get_buffer (), 01842 this->system_name_->length ()); 01843 starting_at += this->system_name_->length (); 01844 } 01845 }
void TAO_Root_POA::set_obj_ref_factory | ( | PortableInterceptor::ObjectReferenceFactory * | current_factory | ) | [protected] |
Set the object reference factory.
Definition at line 174 of file Root_POA.cpp.
References ORT_adapter(), and ort_adapter_.
00176 { 00177 TAO::ORT_Adapter *adapter = this->ORT_adapter (); 00178 00179 if (adapter) 00180 { 00181 // Activate a different factory 00182 this->ort_adapter_->set_obj_ref_factory (current_factory); 00183 } 00184 }
void TAO_Root_POA::set_servant | ( | PortableServer::Servant | servant | ) |
Definition at line 2437 of file Root_POA.cpp.
References active_policy_strategies_, TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy(), and TAO_POA_GUARD.
02438 { 02439 // Lock access for the duration of this transaction. 02440 TAO_POA_GUARD; 02441 02442 this->active_policy_strategies_.request_processing_strategy()-> 02443 set_servant (servant); 02444 }
void TAO_Root_POA::set_servant_manager | ( | PortableServer::ServantManager_ptr | imgr | ) |
Definition at line 2387 of file Root_POA.cpp.
References active_policy_strategies_, TAO::Portable_Server::Active_Policy_Strategies::request_processing_strategy(), and TAO_POA_GUARD.
02388 { 02389 // Lock access for the duration of this transaction. 02390 TAO_POA_GUARD; 02391 02392 this->active_policy_strategies_.request_processing_strategy()-> 02393 set_servant_manager (imgr); 02394 }
ACE_INLINE CORBA::Boolean TAO_Root_POA::system_id | ( | void | ) |
Definition at line 75 of file Root_POA.inl.
Referenced by invoke_key_to_object(), is_poa_generated(), reference_to_id(), reference_to_servant_i(), set_id(), and TAO::Portable_Server::ServantRetentionStrategyRetain::strategy_init().
00076 { 00077 return (this->cached_policies_.id_assignment () == PortableServer::SYSTEM_ID); 00078 }
ACE_INLINE char TAO_Root_POA::system_id_key_char | ( | void | ) | [static, protected] |
ACE_INLINE CORBA::ULong TAO_Root_POA::system_id_key_type_length | ( | void | ) | [static, protected] |
ACE_INLINE const TAO_Object_Adapter::poa_name & TAO_Root_POA::system_name | ( | void | ) | const |
Definition at line 105 of file Root_POA.inl.
References system_name_.
Referenced by is_poa_generated().
00106 { 00107 return this->system_name_.in (); 00108 }
TAO_POA_Manager & TAO_Root_POA::tao_poa_manager | ( | ) |
Return the POA Manager related to this POA.
Definition at line 693 of file Root_POA.cpp.
References poa_manager_.
Referenced by TAO::Portable_Server::LifespanStrategyTransient::check_state(), and TAO::Portable_Server::LifespanStrategyPersistent::check_state().
00694 { 00695 return poa_manager_; 00696 }
void TAO_Root_POA::the_activator | ( | PortableServer::AdapterActivator_ptr | adapter_activator | ) |
Definition at line 2364 of file Root_POA.cpp.
References adapter_activator_, and TAO_POA_GUARD.
02365 { 02366 // Lock access for the duration of this transaction. 02367 TAO_POA_GUARD; 02368 02369 this->adapter_activator_ = PortableServer::AdapterActivator::_duplicate (adapter_activator); 02370 }
PortableServer::AdapterActivator_ptr TAO_Root_POA::the_activator | ( | void | ) |
Definition at line 2355 of file Root_POA.cpp.
References TAO_POA_GUARD_RETURN.
02356 { 02357 // Lock access for the duration of this transaction. 02358 TAO_POA_GUARD_RETURN (PortableServer::AdapterActivator::_nil ()); 02359 02360 return PortableServer::AdapterActivator::_duplicate (this->adapter_activator_.in ()); 02361 }
PortableServer::POAList * TAO_Root_POA::the_children | ( | void | ) |
Definition at line 747 of file Root_POA.cpp.
References TAO_POA_GUARD_RETURN, and the_children_i().
00748 { 00749 // Lock access for the duration of this transaction. 00750 TAO_POA_GUARD_RETURN (0); 00751 00752 return this->the_children_i (); 00753 }
PortableServer::POAList * TAO_Root_POA::the_children_i | ( | void | ) | [protected] |
Definition at line 984 of file Root_POA.cpp.
References ACE_NEW_THROW_EX, children_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::current_size(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end().
Referenced by the_children().
00985 { 00986 PortableServer::POAList_var children; 00987 CORBA::ULong child_current = static_cast <CORBA::ULong> 00988 (this->children_.current_size ()); 00989 ACE_NEW_THROW_EX (children, 00990 PortableServer::POAList (child_current), 00991 CORBA::NO_MEMORY ()); 00992 00993 children->length (child_current); 00994 00995 CORBA::ULong index = 0; 00996 for (CHILDREN::iterator iterator = this->children_.begin (); 00997 iterator != this->children_.end (); 00998 ++iterator, ++index) 00999 { 01000 TAO_Root_POA *child_poa = (*iterator).int_id_; 01001 children[index] = PortableServer::POA::_duplicate (child_poa); 01002 } 01003 01004 return children._retn (); 01005 }
ACE_INLINE char * TAO_Root_POA::the_name | ( | void | ) |
Definition at line 93 of file Root_POA.inl.
References CORBA::string_dup().
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::strategy_init().
00094 { 00095 return CORBA::string_dup (this->name_.c_str ()); 00096 }
ACE_INLINE PortableServer::POA_ptr TAO_Root_POA::the_parent | ( | void | ) |
PortableServer::POAManager_ptr TAO_Root_POA::the_POAManager | ( | void | ) |
PortableServer::POAManagerFactory_ptr TAO_Root_POA::the_POAManagerFactory | ( | void | ) |
Definition at line 2663 of file Root_POA.cpp.
02664 { 02665 return PortableServer::POAManagerFactory::_duplicate (&this->poa_manager_factory_); 02666 }
ACE_INLINE void * TAO_Root_POA::thread_pool | ( | void | ) | const [virtual] |
ACE_INLINE char TAO_Root_POA::transient_key_char | ( | void | ) | [static, protected] |
int TAO_Root_POA::unbind_using_user_id | ( | const PortableServer::ObjectId & | user_id | ) |
Definition at line 1497 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
01498 { 01499 return this->active_policy_strategies_.servant_retention_strategy()-> 01500 unbind_using_user_id (user_id); 01501 }
ACE_INLINE char TAO_Root_POA::user_id_key_char | ( | void | ) | [static, protected] |
PortableServer::Servant TAO_Root_POA::user_id_to_servant_i | ( | const PortableServer::ObjectId & | oid | ) |
Definition at line 1540 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
Referenced by TAO::Portable_Server::RequestProcessingStrategyServantManager::id_to_servant(), and TAO::Portable_Server::RequestProcessingStrategyAOMOnly::id_to_servant().
01541 { 01542 return this->active_policy_strategies_.servant_retention_strategy()-> 01543 user_id_to_servant (id); 01544 }
bool TAO_Root_POA::validate_lifespan | ( | CORBA::Boolean | is_persistent, | |
const TAO::Portable_Server::Temporary_Creation_Time & | creation_time | |||
) | const |
Definition at line 2557 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::lifespan_strategy().
Referenced by TAO_Object_Adapter::find_transient_poa(), and is_poa_generated().
02560 { 02561 return this->active_policy_strategies_.lifespan_strategy()-> 02562 validate (is_persistent, creation_time); 02563 }
void TAO_Root_POA::wait_for_completions | ( | CORBA::Boolean | wait_for_completion | ) | [protected] |
Definition at line 1211 of file Root_POA.cpp.
References outstanding_requests_.
Referenced by deactivate_all_objects_i().
01212 { 01213 while (this->object_adapter ().enable_locking_ && 01214 wait_for_completion && 01215 this->outstanding_requests_ > 0) 01216 { 01217 this->wait_for_completion_pending_ = 1; 01218 01219 int result = this->outstanding_requests_condition_.wait (); 01220 if (result == -1) 01221 { 01222 throw ::CORBA::OBJ_ADAPTER (); 01223 } 01224 } 01225 }
ACE_INLINE CORBA::Boolean TAO_Root_POA::waiting_destruction | ( | void | ) | const |
Definition at line 207 of file Root_POA.inl.
References waiting_destruction_.
00208 { 00209 return this->waiting_destruction_; 00210 }
CORBA::ULong TAO_Root_POA::waiting_servant_deactivation | ( | void | ) | const |
Definition at line 2612 of file Root_POA.cpp.
References active_policy_strategies_, and TAO::Portable_Server::Active_Policy_Strategies::servant_retention_strategy().
02613 { 02614 return this->active_policy_strategies_.servant_retention_strategy ()-> 02615 waiting_servant_deactivation (); 02616 }
friend class TAO::Portable_Server::Non_Servant_Upcall [friend] |
Definition at line 122 of file Root_POA.h.
friend class TAO::Portable_Server::Servant_Upcall [friend] |
Definition at line 121 of file Root_POA.h.
friend class TAO_IORInfo [friend] |
Definition at line 125 of file Root_POA.h.
friend class TAO_Object_Adapter [friend] |
Definition at line 120 of file Root_POA.h.
friend class TAO_POA_Manager [friend] |
Definition at line 123 of file Root_POA.h.
friend class TAO_RT_Collocation_Resolver [friend] |
Definition at line 124 of file Root_POA.h.
Definition at line 723 of file Root_POA.h.
Referenced by activate_object_i(), activate_object_with_id_i(), allow_implicit_activation(), allow_multiple_activations(), check_state(), cleanup_servant(), complete_destruction_i(), create_reference_i(), create_reference_with_id_i(), deactivate_all_objects_i(), deactivate_object_i(), destroy_i(), enter(), exit(), find_servant(), find_servant_priority(), get_servant_i(), get_servant_manager(), has_system_id(), id_to_reference_i(), id_to_servant_i(), is_persistent(), is_servant_activation_allowed(), is_servant_active(), locate_servant_i(), post_invoke_servant_cleanup(), rebind_using_user_id_and_system_id(), reference_to_id(), reference_to_servant_i(), servant_has_remaining_activations(), servant_present(), servant_to_id_i(), servant_to_reference_i(), servant_to_user_id(), set_id(), set_servant(), set_servant_manager(), TAO_Root_POA(), unbind_using_user_id(), user_id_to_servant_i(), validate_lifespan(), and waiting_servant_deactivation().
PortableServer::AdapterActivator_var TAO_Root_POA::adapter_activator_ [protected] |
Definition at line 726 of file Root_POA.h.
Referenced by complete_destruction_i(), find_POA_i(), and the_activator().
PortableInterceptor::AdapterState TAO_Root_POA::adapter_state_ [protected] |
Adapter can be accepting, rejecting etc.
Definition at line 717 of file Root_POA.h.
Referenced by complete_destruction_i(), destroy_i(), and get_adapter_state().
Definition at line 719 of file Root_POA.h.
Referenced by cached_policies(), priority_model(), server_priority(), and TAO_Root_POA().
Definition at line 765 of file Root_POA.h.
CHILDREN TAO_Root_POA::children_ [protected] |
Definition at line 738 of file Root_POA.h.
Referenced by delete_child(), destroy_i(), find_POA_i(), and the_children_i().
CORBA::Boolean TAO_Root_POA::cleanup_in_progress_ [protected] |
TAO_Acceptor_Filter_Factory* TAO_Root_POA::filter_factory_ [protected] |
CORBA::OctetSeq TAO_Root_POA::id_ [protected] |
Definition at line 786 of file Root_POA.h.
Referenced by TAO::Portable_Server::ServantRetentionStrategyRetain::create_reference(), TAO::Portable_Server::ServantRetentionStrategyNonRetain::create_reference(), TAO::Portable_Server::ServantRetentionStrategyRetain::create_reference_with_id(), TAO::Portable_Server::ServantRetentionStrategyNonRetain::create_reference_with_id(), TAO::Portable_Server::ServantRetentionStrategyRetain::id_to_reference(), invoke_key_to_object(), and TAO::Portable_Server::ServantRetentionStrategyRetain::servant_to_reference().
ACE_Lock& TAO_Root_POA::lock_ [protected] |
String TAO_Root_POA::name_ [protected] |
Definition at line 689 of file Root_POA.h.
Referenced by is_poa_generated_id(), name(), and set_folded_name().
Definition at line 721 of file Root_POA.h.
Referenced by network_priority_hook(), and TAO_Root_POA().
TAO_Object_Adapter* TAO_Root_POA::object_adapter_ [protected] |
The object adapter we belong to.
Definition at line 745 of file Root_POA.h.
Referenced by create_POA_i(), and object_adapter().
Initial value:
{ 024, 001, 017, 000 }
Definition at line 282 of file Root_POA.h.
Referenced by TAO_Object_Adapter::dispatch(), TAO_Object_Adapter::get_collocated_servant(), and set_id().
TAO_ORB_Core& TAO_Root_POA::orb_core_ [protected] |
Reimplemented from CORBA::Object.
Definition at line 742 of file Root_POA.h.
Referenced by adapter_state_changed(), components_established(), create_POA_i(), create_stub_object(), establish_components(), key_to_object(), key_to_stub(), key_to_stub_i(), orb_core(), ORT_adapter_factory(), and ORT_adapter_i().
TAO::ORT_Adapter* TAO_Root_POA::ort_adapter_ [protected] |
Pointer to the object reference template adapter.
Definition at line 714 of file Root_POA.h.
Referenced by complete_destruction_i(), destroy_i(), get_adapter_template(), get_obj_ref_factory(), ORT_adapter(), ORT_adapter_i(), and set_obj_ref_factory().
CORBA::ULong TAO_Root_POA::outstanding_requests_ [protected] |
Definition at line 749 of file Root_POA.h.
Referenced by decrement_outstanding_requests(), increment_outstanding_requests(), outstanding_requests(), and wait_for_completions().
Definition at line 751 of file Root_POA.h.
Referenced by TAO::Portable_Server::Servant_Upcall::poa_cleanup().
TAO_POA_Manager& TAO_Root_POA::poa_manager_ [protected] |
Reference to the POAManager that this poa assicuates with.
Definition at line 692 of file Root_POA.h.
Referenced by tao_poa_manager(), TAO_Root_POA(), and ~TAO_Root_POA().
TAO_POAManager_Factory& TAO_Root_POA::poa_manager_factory_ [protected] |
Reference to the POAManagerFactory that generate the POAManager.
Definition at line 696 of file Root_POA.h.
TAO_POA_Policy_Set TAO_Root_POA::policies_ [protected] |
Definition at line 705 of file Root_POA.h.
Referenced by client_exposed_policies(), get_policy(), and policies().
ACE_Array_Base<IOP::ProfileId> TAO_Root_POA::profile_id_array_ [protected] |
Definition at line 767 of file Root_POA.h.
IOP::TaggedComponentSeq TAO_Root_POA::tagged_component_ [protected] |
Definition at line 699 of file Root_POA.h.
Referenced by create_stub_object(), and save_ior_component().
IOP::TaggedComponentSeq TAO_Root_POA::tagged_component_id_ [protected] |
Definition at line 701 of file Root_POA.h.
Referenced by create_stub_object(), and save_ior_component_and_profile_id().
Definition at line 753 of file Root_POA.h.
CORBA::Boolean TAO_Root_POA::waiting_destruction_ [protected] |
Definition at line 755 of file Root_POA.h.
Referenced by complete_destruction_i(), destroy_i(), and waiting_destruction().