#include <RT_POA.h>
Public Member Functions | |
CORBA::Object_ptr | create_reference_with_priority (const char *intf, RTCORBA::Priority priority) |
CORBA::Object_ptr | create_reference_with_id_and_priority (const PortableServer::ObjectId &oid, const char *intf, RTCORBA::Priority priority) |
PortableServer::ObjectId * | activate_object_with_priority (PortableServer::Servant p_servant, RTCORBA::Priority priority) |
void | activate_object_with_id_and_priority (const PortableServer::ObjectId &oid, PortableServer::Servant p_servant, RTCORBA::Priority priority) |
PortableServer::POA_ptr | create_POA (const char *adapter_name, PortableServer::POAManager_ptr poa_manager, const CORBA::PolicyList &policies) |
PortableServer::POA_ptr | find_POA (const char *adapter_name, CORBA::Boolean activate_it) |
void | destroy (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion) |
PortableServer::ThreadPolicy_ptr | create_thread_policy (PortableServer::ThreadPolicyValue value) |
PortableServer::LifespanPolicy_ptr | create_lifespan_policy (PortableServer::LifespanPolicyValue value) |
PortableServer::IdUniquenessPolicy_ptr | create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value) |
PortableServer::IdAssignmentPolicy_ptr | create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value) |
PortableServer::ImplicitActivationPolicy_ptr | create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value) |
PortableServer::ServantRetentionPolicy_ptr | create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value) |
PortableServer::RequestProcessingPolicy_ptr | create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value) |
char * | the_name (void) |
PortableServer::POA_ptr | the_parent (void) |
PortableServer::POAList * | the_children (void) |
PortableServer::POAManager_ptr | the_POAManager (void) |
PortableServer::AdapterActivator_ptr | the_activator (void) |
void | the_activator (PortableServer::AdapterActivator_ptr adapter_activator) |
PortableServer::ServantManager_ptr | get_servant_manager (void) |
void | set_servant_manager (PortableServer::ServantManager_ptr imgr) |
PortableServer::Servant | get_servant (void) |
void | set_servant (PortableServer::Servant servant) |
PortableServer::ObjectId * | activate_object (PortableServer::Servant p_servant) |
void | activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant p_servant) |
void | deactivate_object (const PortableServer::ObjectId &oid) |
CORBA::Object_ptr | create_reference (const char *intf) |
CORBA::Object_ptr | create_reference_with_id (const PortableServer::ObjectId &oid, const char *intf) |
PortableServer::ObjectId * | servant_to_id (PortableServer::Servant p_servant) |
CORBA::Object_ptr | servant_to_reference (PortableServer::Servant p_servant) |
PortableServer::Servant | reference_to_servant (CORBA::Object_ptr reference) |
PortableServer::ObjectId * | reference_to_id (CORBA::Object_ptr reference) |
PortableServer::Servant | id_to_servant (const PortableServer::ObjectId &oid) |
CORBA::Object_ptr | id_to_reference (const PortableServer::ObjectId &oid) |
CORBA::OctetSeq * | id (void) |
virtual CORBA::PolicyList * | client_exposed_policies (CORBA::Short object_priority) |
TAO_RT_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) | |
virtual | ~TAO_RT_POA (void) |
void * | thread_pool (void) const |
Protected Member Functions | |
virtual 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) |
Template method for creating new POA's of this type. | |
virtual TAO_Stub * | key_to_stub_i (const TAO::ObjectKey &key, const char *type_id, CORBA::Short priority) |
void | validate_priority (RTCORBA::Priority priority) |
void | validate_policies (void) |
void | parse_rt_policies (TAO_POA_Policy_Set &policies) |
size_t | endpoint_count (void) |
TAO_Stub * | create_stub_object (const TAO::ObjectKey &object_key, const char *type_id, CORBA::PolicyList *policy_list, TAO_Acceptor_Filter *filter, TAO_PriorityBandedConnectionPolicy *priority_bands) |
int | lane_required (TAO_Thread_Lane *lane, TAO_PriorityBandedConnectionPolicy *priority_bands) |
Protected Attributes | |
TAO_Thread_Pool * | thread_pool_ |
Definition at line 48 of file RT_POA.h.
TAO_RT_POA::TAO_RT_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 | |||
) |
TAO_RT_POA::~TAO_RT_POA | ( | void | ) | [virtual] |
PortableServer::ObjectId * TAO_RT_POA::activate_object | ( | PortableServer::Servant | p_servant | ) |
void TAO_RT_POA::activate_object_with_id | ( | const PortableServer::ObjectId & | id, | |
PortableServer::Servant | p_servant | |||
) |
ACE_INLINE void TAO_RT_POA::activate_object_with_id_and_priority | ( | const PortableServer::ObjectId & | oid, | |
PortableServer::Servant | p_servant, | |||
RTCORBA::Priority | priority | |||
) |
Definition at line 75 of file RT_POA.inl.
References validate_policies(), and validate_priority().
00078 { 00079 // Check that this method can be used based on this POA's policies. 00080 this->validate_policies (); 00081 00082 this->validate_priority (priority); 00083 00084 while (true) 00085 { 00086 bool wait_occurred_restart_call = false; 00087 00088 // Lock access for the duration of this transaction. 00089 TAO_POA_GUARD; 00090 00091 this->activate_object_with_id_i (oid, 00092 servant, 00093 priority, 00094 wait_occurred_restart_call); 00095 00096 // If we ended up waiting on a condition variable, the POA state 00097 // may have changed while we are waiting. Therefore, we need to 00098 // restart this call. 00099 if (wait_occurred_restart_call) 00100 continue; 00101 else 00102 return; 00103 } 00104 }
ACE_INLINE PortableServer::ObjectId * TAO_RT_POA::activate_object_with_priority | ( | PortableServer::Servant | p_servant, | |
RTCORBA::Priority | priority | |||
) |
Definition at line 45 of file RT_POA.inl.
References validate_policies(), and validate_priority().
00047 { 00048 // Check that this method can be used based on this POA's policies. 00049 this->validate_policies (); 00050 00051 this->validate_priority (priority); 00052 00053 while (true) 00054 { 00055 bool wait_occurred_restart_call = false; 00056 00057 // Lock access for the duration of this transaction. 00058 TAO_POA_GUARD_RETURN (0); 00059 00060 PortableServer::ObjectId *result = 00061 this->activate_object_i (servant, priority, wait_occurred_restart_call); 00062 00063 // If we ended up waiting on a condition variable, the POA state 00064 // may have changed while we are waiting. Therefore, we need to 00065 // restart this call. 00066 if (wait_occurred_restart_call) 00067 continue; 00068 else 00069 return result; 00070 } 00071 }
CORBA::PolicyList * TAO_RT_POA::client_exposed_policies | ( | CORBA::Short | object_priority | ) | [virtual] |
Definition at line 442 of file RT_POA.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, TAO_INVALID_PRIORITY, and TAO::VMCID.
Referenced by key_to_stub_i().
00443 { 00444 CORBA::PolicyList *client_exposed_policies = 0; 00445 ACE_NEW_THROW_EX (client_exposed_policies, 00446 CORBA::PolicyList (), 00447 CORBA::NO_MEMORY (TAO::VMCID, 00448 CORBA::COMPLETED_NO)); 00449 00450 CORBA::PolicyList_var safe_client_exposed_policies = client_exposed_policies; 00451 00452 // Add in all of the client exposed policies. 00453 this->policies_.add_client_exposed_fixed_policies (client_exposed_policies); 00454 00455 // Check if the priority model policy has been set, and if so, let 00456 // the client know about it. 00457 CORBA::Short poa_priority = 00458 this->cached_policies_.server_priority (); 00459 00460 if (poa_priority != TAO_INVALID_PRIORITY) 00461 { 00462 TAO::Portable_Server::Cached_Policies::PriorityModel priority_model = 00463 this->cached_policies_.priority_model (); 00464 00465 // If the priority model is client propagated, let the client 00466 // about the default server priority (the POA priority). If 00467 // the priority model is server declared, tell the client the 00468 // servant's priority. 00469 CORBA::Short priority; 00470 if (priority_model == TAO::Portable_Server::Cached_Policies::CLIENT_PROPAGATED) 00471 priority = poa_priority; 00472 else 00473 priority = object_priority; 00474 00475 const CORBA::ULong current_length = 00476 client_exposed_policies->length (); 00477 client_exposed_policies->length (current_length + 1); 00478 00479 TAO_PriorityModelPolicy *priority_model_policy; 00480 ACE_NEW_THROW_EX (priority_model_policy, 00481 TAO_PriorityModelPolicy (RTCORBA::PriorityModel (priority_model), 00482 priority), 00483 CORBA::NO_MEMORY (TAO::VMCID, 00484 CORBA::COMPLETED_NO)); 00485 00486 (*client_exposed_policies)[current_length] = priority_model_policy; 00487 } 00488 00489 return safe_client_exposed_policies._retn (); 00490 }
PortableServer::IdAssignmentPolicy_ptr TAO_RT_POA::create_id_assignment_policy | ( | PortableServer::IdAssignmentPolicyValue | value | ) |
PortableServer::IdUniquenessPolicy_ptr TAO_RT_POA::create_id_uniqueness_policy | ( | PortableServer::IdUniquenessPolicyValue | value | ) |
PortableServer::ImplicitActivationPolicy_ptr TAO_RT_POA::create_implicit_activation_policy | ( | PortableServer::ImplicitActivationPolicyValue | value | ) |
PortableServer::LifespanPolicy_ptr TAO_RT_POA::create_lifespan_policy | ( | PortableServer::LifespanPolicyValue | value | ) |
PortableServer::POA_ptr TAO_RT_POA::create_POA | ( | const char * | adapter_name, | |
PortableServer::POAManager_ptr | poa_manager, | |||
const CORBA::PolicyList & | policies | |||
) |
Definition at line 495 of file RT_POA.cpp.
00498 { 00499 return this->TAO_Regular_POA::create_POA (adapter_name, poa_manager, policies); 00500 }
CORBA::Object_ptr TAO_RT_POA::create_reference | ( | const char * | intf | ) |
CORBA::Object_ptr TAO_RT_POA::create_reference_with_id | ( | const PortableServer::ObjectId & | oid, | |
const char * | intf | |||
) |
ACE_INLINE CORBA::Object_ptr TAO_RT_POA::create_reference_with_id_and_priority | ( | const PortableServer::ObjectId & | oid, | |
const char * | intf, | |||
RTCORBA::Priority | priority | |||
) |
Definition at line 28 of file RT_POA.inl.
References validate_policies(), and validate_priority().
00031 { 00032 // Check that this method can be used based on this POA's policies. 00033 this->validate_policies (); 00034 00035 this->validate_priority (priority); 00036 00037 // Lock access for the duration of this transaction. 00038 TAO_POA_GUARD_RETURN (0); 00039 00040 return this->create_reference_with_id_i (oid, intf, priority); 00041 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Object_ptr TAO_RT_POA::create_reference_with_priority | ( | const char * | intf, | |
RTCORBA::Priority | priority | |||
) |
Definition at line 12 of file RT_POA.inl.
References validate_policies(), and validate_priority().
00014 { 00015 // Check that this method can be used based on this POA's policies. 00016 this->validate_policies (); 00017 00018 this->validate_priority (priority); 00019 00020 // Lock access for the duration of this transaction. 00021 TAO_POA_GUARD_RETURN (0); 00022 00023 return this->create_reference_i (intf, priority); 00024 }
PortableServer::RequestProcessingPolicy_ptr TAO_RT_POA::create_request_processing_policy | ( | PortableServer::RequestProcessingPolicyValue | value | ) |
PortableServer::ServantRetentionPolicy_ptr TAO_RT_POA::create_servant_retention_policy | ( | PortableServer::ServantRetentionPolicyValue | value | ) |
TAO_Stub * TAO_RT_POA::create_stub_object | ( | const TAO::ObjectKey & | object_key, | |
const char * | type_id, | |||
CORBA::PolicyList * | policy_list, | |||
TAO_Acceptor_Filter * | filter, | |||
TAO_PriorityBandedConnectionPolicy * | priority_bands | |||
) | [protected] |
Definition at line 325 of file RT_POA.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, TAO_Acceptor_Filter::encode_endpoints(), endpoint_count(), TAO_Acceptor_Filter::fill_profile(), TAO_MProfile::profile_count(), TAO_MProfile::set(), and TAO_MPROFILE_CREATION_ERROR.
Referenced by key_to_stub_i().
00330 { 00331 int error = 0; 00332 00333 // Count the number of endpoints. 00334 size_t profile_count = 00335 this->endpoint_count (); 00336 00337 // Create a profile container and have acceptor registries populate 00338 // it with profiles as appropriate. 00339 TAO_MProfile mprofile (0); 00340 00341 // Allocate space for storing the profiles. There can never be more 00342 // profiles than there are endpoints. In some cases, there can be 00343 // less profiles than endpoints. 00344 int result = 00345 mprofile.set (static_cast <CORBA::ULong> (profile_count)); 00346 if (result == -1) 00347 error = 1; 00348 00349 TAO_Thread_Lane **lanes = 00350 this->thread_pool_->lanes (); 00351 00352 // Leave it to the filter to decide which acceptors/in which order 00353 // go into the mprofile. 00354 for (CORBA::ULong i = 0; 00355 i != this->thread_pool_->number_of_lanes () && 00356 !error; 00357 ++i) 00358 { 00359 if (this->lane_required (lanes[i], 00360 priority_bands)) 00361 { 00362 TAO_Acceptor_Registry &acceptor_registry = 00363 lanes[i]->resources ().acceptor_registry (); 00364 00365 result = 00366 filter->fill_profile (object_key, 00367 mprofile, 00368 acceptor_registry.begin (), 00369 acceptor_registry.end (), 00370 lanes[i]->lane_priority ()); 00371 if (result == -1) 00372 error = 1; 00373 } 00374 } 00375 00376 if (!error) 00377 result = filter->encode_endpoints (mprofile); 00378 if (result == -1) 00379 error = 1; 00380 00381 if (error) 00382 throw ::CORBA::INTERNAL ( 00383 CORBA::SystemException::_tao_minor_code ( 00384 TAO_MPROFILE_CREATION_ERROR, 00385 0), 00386 CORBA::COMPLETED_NO); 00387 00388 // Make sure we have at least one profile. <mp> may end up being 00389 // empty if none of the acceptor endpoints have the right priority 00390 // for this object, for example. 00391 if (mprofile.profile_count () == 0) 00392 throw ::CORBA::BAD_PARAM ( 00393 CORBA::SystemException::_tao_minor_code ( 00394 TAO_MPROFILE_CREATION_ERROR, 00395 0), 00396 CORBA::COMPLETED_NO); 00397 00398 return 00399 this->orb_core_.create_stub_object (mprofile, type_id, policy_list); 00400 }
PortableServer::ThreadPolicy_ptr TAO_RT_POA::create_thread_policy | ( | PortableServer::ThreadPolicyValue | value | ) |
void TAO_RT_POA::deactivate_object | ( | const PortableServer::ObjectId & | oid | ) |
void TAO_RT_POA::destroy | ( | CORBA::Boolean | etherealize_objects, | |
CORBA::Boolean | wait_for_completion | |||
) |
size_t TAO_RT_POA::endpoint_count | ( | void | ) | [protected] |
Definition at line 403 of file RT_POA.cpp.
Referenced by create_stub_object().
00404 { 00405 size_t profile_count = 0; 00406 00407 TAO_Thread_Lane **lanes = 00408 this->thread_pool_->lanes (); 00409 00410 for (CORBA::ULong i = 0; 00411 i != this->thread_pool_->number_of_lanes (); 00412 ++i) 00413 profile_count += 00414 lanes[i]->resources ().acceptor_registry ().endpoint_count (); 00415 00416 return profile_count; 00417 }
PortableServer::POA_ptr TAO_RT_POA::find_POA | ( | const char * | adapter_name, | |
CORBA::Boolean | activate_it | |||
) |
PortableServer::Servant TAO_RT_POA::get_servant | ( | void | ) |
PortableServer::ServantManager_ptr TAO_RT_POA::get_servant_manager | ( | void | ) |
CORBA::OctetSeq * TAO_RT_POA::id | ( | void | ) |
CORBA::Object_ptr TAO_RT_POA::id_to_reference | ( | const PortableServer::ObjectId & | oid | ) |
PortableServer::Servant TAO_RT_POA::id_to_servant | ( | const PortableServer::ObjectId & | oid | ) |
TAO_Stub * TAO_RT_POA::key_to_stub_i | ( | const TAO::ObjectKey & | key, | |
const char * | type_id, | |||
CORBA::Short | priority | |||
) | [protected, virtual] |
Definition at line 222 of file RT_POA.cpp.
References TAO_Thread_Lane_Resources::acceptor_registry(), ACE_ASSERT, client_exposed_policies(), create_stub_object(), TAO_Thread_Lane_Resources_Manager::default_lane_resources(), TAO_Objref_Var_T< T >::in(), TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION, and TAO_CACHED_POLICY_RT_SERVER_PROTOCOL.
00225 { 00226 // Client exposed policies. 00227 CORBA::PolicyList_var client_exposed_policies = 00228 this->client_exposed_policies (priority); 00229 00230 // Server protocol policy. 00231 CORBA::Policy_var protocol = 00232 this->policies ().get_cached_policy (TAO_CACHED_POLICY_RT_SERVER_PROTOCOL); 00233 00234 RTCORBA::ServerProtocolPolicy_var server_protocol_policy = 00235 RTCORBA::ServerProtocolPolicy::_narrow (protocol.in ()); 00236 00237 TAO_ServerProtocolPolicy *server_protocol = 00238 dynamic_cast <TAO_ServerProtocolPolicy *> (server_protocol_policy.in ()); 00239 00240 // Filter for server protocol. 00241 TAO_Server_Protocol_Acceptor_Filter filter (server_protocol->protocols_rep ()); 00242 00243 // If this POA is using the default thread pool or a thread pool 00244 // without lanes, create the IOR with the acceptors in the thread 00245 // pool. 00246 if (this->thread_pool_ == 0 || 00247 !this->thread_pool_->with_lanes ()) 00248 { 00249 TAO_Acceptor_Registry *acceptor_registry = 0; 00250 00251 if (this->thread_pool_ == 0) 00252 { 00253 TAO_Thread_Lane_Resources_Manager &thread_lane_resources_manager = 00254 this->orb_core_.thread_lane_resources_manager (); 00255 00256 TAO_Thread_Lane_Resources &resources = 00257 thread_lane_resources_manager.default_lane_resources (); 00258 00259 acceptor_registry = &resources.acceptor_registry (); 00260 } 00261 else 00262 { 00263 TAO_Thread_Lane **lanes = this->thread_pool_->lanes (); 00264 00265 TAO_Thread_Lane_Resources &resources = lanes[0]->resources (); 00266 00267 acceptor_registry = &resources.acceptor_registry (); 00268 } 00269 00270 return 00271 this->TAO_Regular_POA::create_stub_object (object_key, 00272 type_id, 00273 client_exposed_policies._retn (), 00274 &filter, 00275 *acceptor_registry); 00276 } 00277 00278 // If this POA has the SERVER_DECLARED policy, create the IOR with 00279 // the acceptors in the only thread lane that matches the priority 00280 // of the object. 00281 if (this->cached_policies_.priority_model () == 00282 TAO::Portable_Server::Cached_Policies::SERVER_DECLARED) 00283 { 00284 TAO_Thread_Lane **lanes = 00285 this->thread_pool_->lanes (); 00286 00287 for (CORBA::ULong i = 0; 00288 i != this->thread_pool_->number_of_lanes (); 00289 ++i) 00290 { 00291 if (lanes[i]->lane_priority () == priority) 00292 return this->TAO_Regular_POA::create_stub_object (object_key, 00293 type_id, 00294 client_exposed_policies._retn (), 00295 &filter, 00296 lanes[i]->resources ().acceptor_registry () 00297 ); 00298 } 00299 00300 ACE_ASSERT (0); 00301 } 00302 00303 // If this POA has the CLIENT_PROPAGATED policy, create the IOR with 00304 // the acceptors in the thread lanes that matches the bands in this 00305 // POA. If there are no bands, all the thread lanes are used. 00306 CORBA::Policy_var bands = 00307 this->policies ().get_cached_policy ( 00308 TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION 00309 ); 00310 00311 RTCORBA::PriorityBandedConnectionPolicy_var priority_bands 00312 = RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands.in ()); 00313 00314 TAO_PriorityBandedConnectionPolicy *priority_bands_i = 00315 dynamic_cast <TAO_PriorityBandedConnectionPolicy *> (priority_bands.in ()); 00316 00317 return this->create_stub_object (object_key, 00318 type_id, 00319 client_exposed_policies._retn (), 00320 &filter, 00321 priority_bands_i); 00322 }
int TAO_RT_POA::lane_required | ( | TAO_Thread_Lane * | lane, | |
TAO_PriorityBandedConnectionPolicy * | priority_bands | |||
) | [protected] |
Definition at line 420 of file RT_POA.cpp.
00422 { 00423 if (priority_bands == 0) 00424 return 1; 00425 00426 RTCORBA::PriorityBands &bands = 00427 priority_bands->priority_bands_rep (); 00428 00429 for (CORBA::ULong i = 0; 00430 i < bands.length (); 00431 ++i) 00432 { 00433 if (bands[i].low <= lane->lane_priority () && 00434 bands[i].high >= lane->lane_priority ()) 00435 return 1; 00436 } 00437 00438 return 0; 00439 }
TAO_Root_POA * TAO_RT_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 67 of file RT_POA.cpp.
References ACE_NEW_THROW_EX.
00075 { 00076 TAO_RT_POA *poa = 0; 00077 00078 ACE_NEW_THROW_EX (poa, 00079 TAO_RT_POA (name, 00080 poa_manager, 00081 policies, 00082 parent, 00083 lock, 00084 thread_lock, 00085 orb_core, 00086 object_adapter 00087 ), 00088 CORBA::NO_MEMORY ()); 00089 00090 return poa; 00091 }
void TAO_RT_POA::parse_rt_policies | ( | TAO_POA_Policy_Set & | policies | ) | [protected] |
Parse the policy list for RT policies and update our cached policy instance.
Definition at line 94 of file RT_POA.cpp.
References TAO_POA_RT_Policy_Validator::extract_thread_pool(), TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), and TAO_CACHED_POLICY_PRIORITY_MODEL.
00095 { 00096 { 00097 CORBA::Policy_var policy = 00098 policies.get_cached_policy (TAO_CACHED_POLICY_PRIORITY_MODEL); 00099 00100 RTCORBA::PriorityModelPolicy_var priority_model = 00101 RTCORBA::PriorityModelPolicy::_narrow (policy.in ()); 00102 00103 if (!CORBA::is_nil (priority_model.in ())) 00104 { 00105 RTCORBA::PriorityModel rt_priority_model = 00106 priority_model->priority_model (); 00107 00108 this->cached_policies_.priority_model ( 00109 TAO::Portable_Server::Cached_Policies::PriorityModel (rt_priority_model)); 00110 00111 RTCORBA::Priority priority = 00112 priority_model->server_priority (); 00113 00114 this->cached_policies_.server_priority (priority); 00115 } 00116 } 00117 00118 this->thread_pool_ = 00119 TAO_POA_RT_Policy_Validator::extract_thread_pool (this->orb_core_, 00120 policies.policies ()); 00121 }
PortableServer::ObjectId * TAO_RT_POA::reference_to_id | ( | CORBA::Object_ptr | reference | ) |
PortableServer::Servant TAO_RT_POA::reference_to_servant | ( | CORBA::Object_ptr | reference | ) |
PortableServer::ObjectId * TAO_RT_POA::servant_to_id | ( | PortableServer::Servant | p_servant | ) |
CORBA::Object_ptr TAO_RT_POA::servant_to_reference | ( | PortableServer::Servant | p_servant | ) |
void TAO_RT_POA::set_servant | ( | PortableServer::Servant | servant | ) |
void TAO_RT_POA::set_servant_manager | ( | PortableServer::ServantManager_ptr | imgr | ) |
void TAO_RT_POA::the_activator | ( | PortableServer::AdapterActivator_ptr | adapter_activator | ) |
PortableServer::AdapterActivator_ptr TAO_RT_POA::the_activator | ( | void | ) |
PortableServer::POAList * TAO_RT_POA::the_children | ( | void | ) |
char * TAO_RT_POA::the_name | ( | void | ) |
PortableServer::POA_ptr TAO_RT_POA::the_parent | ( | void | ) |
PortableServer::POAManager_ptr TAO_RT_POA::the_POAManager | ( | void | ) |
ACE_INLINE void * TAO_RT_POA::thread_pool | ( | void | ) | const |
Definition at line 108 of file RT_POA.inl.
References thread_pool_.
00109 { 00110 return this->thread_pool_; 00111 }
void TAO_RT_POA::validate_policies | ( | void | ) | [protected] |
Definition at line 192 of file RT_POA.cpp.
Referenced by activate_object_with_id_and_priority(), activate_object_with_priority(), create_reference_with_id_and_priority(), and create_reference_with_priority().
00193 { 00194 // For each of the above operations, if the POA supports the 00195 // IMPLICIT_ACTIVATION option for the ImplicitActivationPolicy then 00196 // the ORB shall raise a WrongPolicy user exception. This relieves 00197 // an ORB implementation of the need to retrieve the target object's 00198 // priority from "somewhere" when a request arrives for an inactive 00199 // object. 00200 if (this->cached_policies_.implicit_activation () == 00201 PortableServer::IMPLICIT_ACTIVATION) 00202 { 00203 throw PortableServer::POA::WrongPolicy (); 00204 } 00205 00206 // For each of the above operations, if the POA does not support the 00207 // SERVER_DECLARED option for the PriorityModelPolicy then the ORB 00208 // shall raise a WrongPolicy user exception. 00209 if (this->cached_policies_.priority_model () != 00210 TAO::Portable_Server::Cached_Policies::SERVER_DECLARED) 00211 { 00212 throw PortableServer::POA::WrongPolicy (); 00213 } 00214 00215 // In all other respects the semantics of the corresponding 00216 // (i.e. without the name extensions "_with_priority" and 00217 // "_and_priority") PortableServer::POA operations shall be 00218 // observed. 00219 }
void TAO_RT_POA::validate_priority | ( | RTCORBA::Priority | priority | ) | [protected] |
Definition at line 124 of file RT_POA.cpp.
References TAO_Objref_Var_T< T >::in(), and TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION.
Referenced by activate_object_with_id_and_priority(), activate_object_with_priority(), create_reference_with_id_and_priority(), and create_reference_with_priority().
00125 { 00126 if (priority < RTCORBA::minPriority 00127 // The line below will always be false unless the value of 00128 // RTCORBA::maxPriority, which is now assigned the value of 00129 // 32767, is changed in RTCORBA.pidl. 00130 // || priority > RTCORBA::maxPriority 00131 ) 00132 { 00133 throw ::CORBA::BAD_PARAM (); 00134 } 00135 00136 // If this POA is using a thread pool with lanes, make sure the 00137 // priority matches one of the thread lanes. Note that in this 00138 // case, bands do not matter since matching the lanes priority is a 00139 // stricter condition than meeting the band ranges. In addition, 00140 // when the POA was created, the bands had to match the lanes. 00141 if (this->thread_pool_ != 0 && this->thread_pool_->with_lanes ()) 00142 { 00143 TAO_Thread_Lane **lanes = this->thread_pool_->lanes (); 00144 00145 for (CORBA::ULong i = 0; 00146 i != this->thread_pool_->number_of_lanes (); 00147 ++i) 00148 { 00149 if (lanes[i]->lane_priority () == priority) 00150 return; 00151 } 00152 00153 throw ::CORBA::BAD_PARAM (); 00154 } 00155 else 00156 // Else we are dealing with a thread pool without lanes. 00157 { 00158 // Check if we have bands. 00159 CORBA::Policy_var bands = 00160 this->policies ().get_cached_policy ( 00161 TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION); 00162 00163 RTCORBA::PriorityBandedConnectionPolicy_var priority_bands 00164 = RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands.in ()); 00165 00166 TAO_PriorityBandedConnectionPolicy *priority_bands_i = 00167 dynamic_cast <TAO_PriorityBandedConnectionPolicy *> 00168 (priority_bands.in ()); 00169 00170 if (priority_bands_i) 00171 { 00172 // If we do have bands, make sure that the priority is 00173 // matching one of the bands. 00174 RTCORBA::PriorityBands &bands = 00175 priority_bands_i->priority_bands_rep (); 00176 00177 for (CORBA::ULong i = 0; 00178 i < bands.length (); 00179 ++i) 00180 { 00181 if (bands[i].low <= priority && 00182 bands[i].high >= priority) 00183 return; 00184 } 00185 00186 throw ::CORBA::BAD_PARAM (); 00187 } 00188 } 00189 }
TAO_Thread_Pool* TAO_RT_POA::thread_pool_ [protected] |