#include <Stub.h>

Public Member Functions | |
| virtual CORBA::Policy_ptr | get_policy (CORBA::PolicyType type) |
| virtual CORBA::Policy_ptr | get_cached_policy (TAO_Cached_Policy_Type type) |
| virtual TAO_Stub * | set_policy_overrides (const CORBA::PolicyList &policies, CORBA::SetOverrideType set_add) |
| virtual CORBA::PolicyList * | get_policy_overrides (const CORBA::PolicyTypeSeq &types) |
| TAO::Transport_Queueing_Strategy * | transport_queueing_strategy (void) |
| CORBA::ULong | hash (CORBA::ULong maximum) |
| CORBA::Boolean | is_equivalent (CORBA::Object_ptr other_obj) |
| Implement the is_equivalent() method for the CORBA::Object. | |
| TAO_Stub (const char *repository_id, const TAO_MProfile &profiles, TAO_ORB_Core *orb_core) | |
| Construct from a repository ID and a list of profiles. | |
| void | _incr_refcnt (void) |
| void | _decr_refcnt (void) |
| ACE_Lock * | profile_lock (void) const |
| TAO_Profile * | profile_in_use (void) |
| const TAO::ObjectKey & | object_key (void) const |
| Return the ObjectKey. | |
| TAO_MProfile * | make_profiles (void) |
| const TAO_MProfile & | base_profiles (void) const |
| Obtain a reference to the basic profile set. | |
| TAO_MProfile & | base_profiles (void) |
| Obtain a reference to the basic profile set. | |
| const TAO_MProfile * | forward_profiles (void) const |
| Obtain a pointer to the forwarded profile set. | |
| TAO_Profile * | next_profile (void) |
| True if permanent location forward occured, in this case the lock must be set and the. | |
| void | reset_profiles (void) |
| CORBA::Boolean | valid_forward_profile (void) |
| void | set_valid_profile (void) |
| NON-THREAD-SAFE. Will set profile_success_ to true. | |
| CORBA::Boolean | valid_profile (void) const |
| TAO_Profile * | base_profiles (const TAO_MProfile &mprofiles) |
| void | add_forward_profiles (const TAO_MProfile &mprofiles, const CORBA::Boolean permanent_forward=false) |
| CORBA::Boolean | next_profile_retry (void) |
| TAO_ORB_Core * | orb_core (void) const |
| Accessor. | |
| CORBA::Boolean | is_collocated (void) const |
| Is this stub collocated with the servant? | |
| void | is_collocated (CORBA::Boolean) |
| Mutator to mark this stub as being collocated with the servant. | |
| CORBA::ORB_ptr | servant_orb_ptr (void) |
| This returns a duplicated ORB pointer. | |
| CORBA::ORB_var & | servant_orb_var (void) |
| This returns the ORB var itself (generally for temporary use). | |
| void | servant_orb (CORBA::ORB_ptr orb) |
| void | collocated_servant (TAO_Abstract_ServantBase *servant) |
| Mutator for setting the servant in collocated cases. | |
| TAO_Abstract_ServantBase * | collocated_servant (void) const |
| Accessor for the servant reference in collocated cases. | |
| void | object_proxy_broker (TAO::Object_Proxy_Broker *proxy_broker) |
| TAO::Object_Proxy_Broker * | object_proxy_broker (void) const |
| int | create_ior_info (IOP::IOR *&ior_info, CORBA::ULong &index) |
| void | destroy (void) |
| Deallocate the TAO_Stub object. | |
| CORBA::Boolean | optimize_collocation_objects (void) const |
| Return the cached value from the ORB_Core. | |
| CORBA::Boolean | marshal (TAO_OutputCDR &) |
| Needed to avoid copying forward_profiles for thread safety. | |
| void | forwarded_on_exception (bool forwarded) |
| bool | forwarded_on_exception () const |
Public Attributes | |
| CORBA::String_var | type_id |
| All objref representations carry around a type ID. | |
Protected Member Functions | |
| virtual | ~TAO_Stub (void) |
| void | reset_profiles_i (void) |
| NON-THREAD SAFE version of reset_profiles (void);. | |
| TAO_Profile * | next_profile_i (void) |
| NON-THREAD SAFE version of next_profile (void). | |
Protected Attributes | |
| TAO_ORB_Core_Auto_Ptr | orb_core_ |
| Automatically manage the ORB_Core reference count. | |
| CORBA::ORB_var | orb_ |
| CORBA::Boolean | is_collocated_ |
| CORBA::ORB_var | servant_orb_ |
| TAO_Abstract_ServantBase * | collocated_servant_ |
| Servant pointer. It is 0 except for collocated objects. | |
| TAO::Object_Proxy_Broker * | object_proxy_broker_ |
| Pointer to the Proxy Broker. | |
| TAO_MProfile | base_profiles_ |
| Ordered list of profiles for this object. | |
| TAO_MProfile * | forward_profiles_ |
| TAO_MProfile * | forward_profiles_perm_ |
| TAO_Profile * | profile_in_use_ |
| This is the profile that we are currently sending/receiving with. | |
| ACE_Lock * | profile_lock_ptr_ |
| Mutex to protect access to the forwarding profile. | |
| CORBA::Boolean | profile_success_ |
| Have we successfully talked to the forward profile yet? | |
| ACE_Atomic_Op< TAO_SYNCH_MUTEX, unsigned long > | refcount_ |
| Reference counter. | |
| TAO_Policy_Set * | policies_ |
| IOP::IOR * | ior_info_ |
| IOP::IOR * | forwarded_ior_info_ |
| Forwarded IOR info. | |
| CORBA::Boolean const | collocation_opt_ |
| ACE_Atomic_Op< TAO_SYNCH_MUTEX, bool > | forwarded_on_exception_ |
Private Member Functions | |
| TAO_Profile * | set_profile_in_use_i (TAO_Profile *pfile) |
| void | reset_base () |
| void | forward_back_one (void) |
| void | reset_forward () |
| TAO_Profile * | next_forward_profile (void) |
| NON-THREAD-SAFE. utility method for next_profile. | |
| int | get_profile_ior_info (TAO_MProfile &profile, IOP::IOR *&ior_info) |
| THREAD-SAFE Create the IOR info. | |
| TAO_Stub (const TAO_Stub &) | |
| TAO_Stub & | operator= (const TAO_Stub &) |
Per-objref data includes the (protocol-specific) Profile, which is handled by placing it into a subclass of this type along with data that may be used in protocol-specific caching schemes. The type ID (the data specified by CORBA 2.0 that gets exposed "on the wire", and in stringified objrefs) is held by this module. The stub APIs are member functions of this type.
Definition at line 69 of file Stub.h.
| TAO_Stub::TAO_Stub | ( | const char * | repository_id, | |
| const TAO_MProfile & | profiles, | |||
| TAO_ORB_Core * | orb_core | |||
| ) |
Construct from a repository ID and a list of profiles.
| TAO_Stub::~TAO_Stub | ( | void | ) | [protected, virtual] |
Destructor is to be called only through _decr_refcnt() to enforce proper reference counting.
Definition at line 87 of file Stub.cpp.
00088 { 00089 ACE_ASSERT (this->refcount_ == 0); 00090 00091 if (this->forward_profiles_) 00092 reset_profiles (); 00093 00094 // reset_profiles doesn't delete forward_profiles_perm_. 00095 delete this->forward_profiles_perm_; 00096 00097 if (this->profile_in_use_ != 0) 00098 { 00099 // decrease reference count on profile 00100 this->profile_in_use_->_decr_refcnt (); 00101 this->profile_in_use_ = 0; 00102 } 00103 00104 delete this->profile_lock_ptr_; 00105 00106 #if (TAO_HAS_CORBA_MESSAGING == 1) 00107 delete this->policies_; 00108 #endif 00109 00110 delete this->ior_info_; 00111 00112 delete this->forwarded_ior_info_; 00113 }
| TAO_Stub::TAO_Stub | ( | const TAO_Stub & | ) | [private] |
| void TAO_Stub::_decr_refcnt | ( | void | ) |
| void TAO_Stub::_incr_refcnt | ( | void | ) |
| void TAO_Stub::add_forward_profiles | ( | const TAO_MProfile & | mprofiles, | |
| const CORBA::Boolean | permanent_forward = false | |||
| ) |
THREAD SAFE. Set the forward_profiles. This object will assume ownership of this TAO_MProfile object!! if permanent_forward is true, currently used profiles will be replaced permanently, otherwise stub may fallback to current profiles later. The flag permanent_forward=true is only valid if currently used profile set represents a GroupObject (IOGR), otherwise this flag will be ignored.
Definition at line 116 of file Stub.cpp.
00118 { 00119 // we assume that the profile_in_use_ is being 00120 // forwarded! Grab the lock so things don't change. 00121 ACE_MT (ACE_GUARD (ACE_Lock, 00122 guard, 00123 *this->profile_lock_ptr_)); 00124 00125 if (permanent_forward) 00126 { 00127 // paranoid, reset the bookmark, then clear the forward-stack 00128 this->forward_profiles_perm_ = 0; 00129 00130 this->reset_forward (); 00131 } 00132 00133 TAO_MProfile *now_pfiles = this->forward_profiles_; 00134 if (now_pfiles == 0) 00135 now_pfiles = &this->base_profiles_; 00136 00137 ACE_NEW (this->forward_profiles_, 00138 TAO_MProfile (mprofiles)); 00139 00140 if (permanent_forward) 00141 // bookmark the new element at bottom of stack 00142 this->forward_profiles_perm_ = this->forward_profiles_; 00143 00144 // forwarded profile points to the new IOR (profiles) 00145 this->profile_in_use_->forward_to (this->forward_profiles_); 00146 00147 // new profile list points back to the list which was forwarded. 00148 this->forward_profiles_->forward_from (now_pfiles); 00149 00150 // make sure we start at the beginning of mprofiles 00151 this->forward_profiles_->rewind (); 00152 00153 // Since we have been forwarded, we must set profile_success_ to false 00154 // since we are starting a new with a new set of profiles! 00155 this->profile_success_ = false; 00156 }
| TAO_Profile * TAO_Stub::base_profiles | ( | const TAO_MProfile & | mprofiles | ) |
Initialize the base_profiles_ and set profile_in_use_ to reference the first profile.
Definition at line 185 of file Stub.inl.
00186 { 00187 ACE_MT (ACE_GUARD_RETURN (ACE_Lock, 00188 guard, 00189 *this->profile_lock_ptr_, 00190 0)); 00191 00192 // first reset things so we start from scratch! 00193 00194 // @note This reset forward could effect the collocation status 00195 // but as this method is only used from the Stub ctr, when the status 00196 // is already correctly set, we don't reinitialise here. sm. 00197 this->reset_forward (); 00198 this->base_profiles_.set (mprofiles); 00199 this->reset_base (); 00200 return this->profile_in_use_; 00201 00202 }
| TAO_MProfile & TAO_Stub::base_profiles | ( | void | ) |
Obtain a reference to the basic profile set.
Definition at line 240 of file Stub.inl.
00241 { 00242 return this->base_profiles_; 00243 }
| const TAO_MProfile & TAO_Stub::base_profiles | ( | void | ) | const |
Obtain a reference to the basic profile set.
Definition at line 234 of file Stub.inl.
00235 { 00236 return this->base_profiles_; 00237 }
| TAO_Abstract_ServantBase * TAO_Stub::collocated_servant | ( | void | ) | const |
Accessor for the servant reference in collocated cases.
Definition at line 284 of file Stub.inl.
00285 { 00286 return collocated_servant_; 00287 }
| void TAO_Stub::collocated_servant | ( | TAO_Abstract_ServantBase * | servant | ) |
Mutator for setting the servant in collocated cases.
Definition at line 290 of file Stub.inl.
00291 { 00292 this->collocated_servant_ = servant; 00293 }
| int TAO_Stub::create_ior_info | ( | IOP::IOR *& | ior_info, | |
| CORBA::ULong & | index | |||
| ) |
Create the IOP::IOR info. We will create the info at most once. Get the index of the profile we are using to make the invocation.
Definition at line 159 of file Stub.cpp.
00160 { 00161 // We are creating the IOR info. Let us not be disturbed. So grab a 00162 // lock. 00163 ACE_MT (ACE_GUARD_RETURN (ACE_Lock, 00164 guard, 00165 *this->profile_lock_ptr_, 00166 -1)); 00167 00168 IOP::IOR *tmp_info = 0; 00169 00170 if (this->forward_profiles_ != 0) 00171 { 00172 if (this->forwarded_ior_info_ == 0) 00173 { 00174 this->get_profile_ior_info (*this->forward_profiles_, tmp_info); 00175 00176 this->forwarded_ior_info_ = tmp_info; 00177 } 00178 00179 // First we look at the forward profiles to see whether the 00180 // profile_in_use is any of it. 00181 for (CORBA::ULong i = 0; 00182 i < this->forward_profiles_->profile_count (); 00183 ++i) 00184 { 00185 if (this->forward_profiles_->get_profile (i) 00186 == this->profile_in_use_) 00187 { 00188 ior_info = this->forwarded_ior_info_; 00189 index = i; 00190 return 0; 00191 } 00192 } 00193 } 00194 00195 // Else we look at the base profiles 00196 if (this->ior_info_ == 0) 00197 { 00198 this->get_profile_ior_info (this->base_profiles_, tmp_info); 00199 00200 this->ior_info_ = tmp_info; 00201 } 00202 00203 00204 for (CORBA::ULong ind = 0; 00205 ind < this->base_profiles_.profile_count (); 00206 ++ind) 00207 { 00208 if (this->base_profiles_.get_profile (ind) == this->profile_in_use_) 00209 { 00210 index = ind; 00211 ior_info = this->ior_info_; 00212 return 0; 00213 } 00214 } 00215 00216 // Error, there was no match 00217 return -1; 00218 }
| void TAO_Stub::destroy | ( | void | ) |
Deallocate the TAO_Stub object.
This method is intended to be used only by the CORBA::Object class.
| void TAO_Stub::forward_back_one | ( | void | ) | [private] |
NON-THREAD-SAFE. Utility method which unrolls (removes or pops) the top most forwarding profile list.
Definition at line 349 of file Stub.cpp.
00350 { 00351 TAO_MProfile *from = forward_profiles_->forward_from (); 00352 00353 // Only delete the forward location if it is not permanent 00354 if (this->forward_profiles_ != this->forward_profiles_perm_) 00355 delete this->forward_profiles_; 00356 00357 // the current profile in this profile list is no 00358 // longer being forwarded, so set the reference to zero. 00359 if (from == &this->base_profiles_) 00360 { 00361 this->base_profiles_.get_current_profile ()->forward_to (0); 00362 this->forward_profiles_ = 0; 00363 } 00364 else 00365 { 00366 from->get_current_profile ()->forward_to (0); 00367 this->forward_profiles_ = from; 00368 } 00369 }
| const TAO_MProfile * TAO_Stub::forward_profiles | ( | void | ) | const |
Obtain a pointer to the forwarded profile set.
Definition at line 246 of file Stub.inl.
00247 { 00248 return this->forward_profiles_; 00249 }
| bool TAO_Stub::forwarded_on_exception | ( | ) | const |
Definition at line 345 of file Stub.inl.
00346 { 00347 return forwarded_on_exception_.value (); 00348 }
| void TAO_Stub::forwarded_on_exception | ( | bool | forwarded | ) |
Definition at line 339 of file Stub.inl.
00340 { 00341 forwarded_on_exception_ = forwarded; 00342 }
| CORBA::Policy_ptr TAO_Stub::get_cached_policy | ( | TAO_Cached_Policy_Type | type | ) | [virtual] |
Definition at line 422 of file Stub.cpp.
00423 { 00424 // No need to lock, the stub only changes its policies at 00425 // construction time... 00426 00427 CORBA::Policy_var result; 00428 if (this->policies_ != 0) 00429 { 00430 result = this->policies_->get_cached_policy (type); 00431 } 00432 00433 if (CORBA::is_nil (result.in ())) 00434 { 00435 result = this->orb_core_->get_cached_policy_including_current (type); 00436 } 00437 00438 return result._retn (); 00439 }
| CORBA::Policy_ptr TAO_Stub::get_policy | ( | CORBA::PolicyType | type | ) | [virtual] |
Returns the effective policy if type is a known client-exposed policy type. Returns the effective override for all other policy types.
Definition at line 402 of file Stub.cpp.
00403 { 00404 // No need to lock, the stub only changes its policies at 00405 // construction time... 00406 00407 CORBA::Policy_var result; 00408 if (this->policies_ != 0) 00409 { 00410 result = this->policies_->get_policy (type); 00411 } 00412 00413 if (CORBA::is_nil (result.in ())) 00414 { 00415 result = this->orb_core_->get_policy_including_current (type); 00416 } 00417 00418 return result._retn (); 00419 }
| CORBA::PolicyList * TAO_Stub::get_policy_overrides | ( | const CORBA::PolicyTypeSeq & | types | ) | [virtual] |
Definition at line 476 of file Stub.cpp.
00477 { 00478 if (this->policies_ == 0) 00479 { 00480 CORBA::PolicyList *policy_list_ptr = 0; 00481 ACE_NEW_THROW_EX (policy_list_ptr, 00482 CORBA::PolicyList (), 00483 CORBA::NO_MEMORY ()); 00484 00485 return policy_list_ptr; 00486 } 00487 else 00488 { 00489 return this->policies_->get_policy_overrides (types); 00490 } 00491 }
| int TAO_Stub::get_profile_ior_info | ( | TAO_MProfile & | profile, | |
| IOP::IOR *& | ior_info | |||
| ) | [private] |
THREAD-SAFE Create the IOR info.
Definition at line 241 of file Stub.cpp.
00242 { 00243 ACE_NEW_THROW_EX (ior_info, 00244 IOP::IOR (), 00245 CORBA::NO_MEMORY ()); 00246 00247 // Get the number of elements 00248 CORBA::ULong const count = profiles.profile_count (); 00249 00250 // Set the number of elements in the sequence of tagged_profile 00251 ior_info->profiles.length (count); 00252 00253 // Call the create_tagged_profile one every member of the 00254 // profile and make the sequence 00255 for (CORBA::ULong index = 0; index < count; ++index) 00256 { 00257 TAO_Profile *prof = profiles.get_profile (index); 00258 00259 IOP::TaggedProfile *tp = prof->create_tagged_profile (); 00260 00261 if (tp == 0) 00262 throw ::CORBA::NO_MEMORY (); 00263 ior_info->profiles[index] = *tp; 00264 } 00265 00266 return 0; 00267 }
| CORBA::ULong TAO_Stub::hash | ( | CORBA::ULong | maximum | ) |
All objref representations know how to hash themselves and compare themselves for equivalence to others. It's easily possible to have two objrefs that are distinct copies of data that refers/points to the same remote object (i.e. are equivalent).
Definition at line 294 of file Stub.cpp.
00295 { 00296 // we rely on the profile objects that its address info 00297 return this->base_profiles_.hash (max); 00298 }
| void TAO_Stub::is_collocated | ( | CORBA::Boolean | collocated | ) |
Mutator to mark this stub as being collocated with the servant.
Definition at line 270 of file Stub.cpp.
00271 { 00272 if (this->is_collocated_ != collocated) 00273 { 00274 if (collocated && 00275 _TAO_Object_Proxy_Broker_Factory_function_pointer != 0) 00276 { 00277 this->object_proxy_broker_ = 00278 _TAO_Object_Proxy_Broker_Factory_function_pointer (); 00279 } 00280 else 00281 { 00282 this->object_proxy_broker_ = the_tao_remote_object_proxy_broker (); 00283 } 00284 this->is_collocated_ = collocated; 00285 } 00286 }
| CORBA::Boolean TAO_Stub::is_collocated | ( | void | ) | const |
Is this stub collocated with the servant?
Definition at line 252 of file Stub.inl.
00253 { 00254 return this->is_collocated_; 00255 }
| CORBA::Boolean TAO_Stub::is_equivalent | ( | CORBA::Object_ptr | other_obj | ) |
Implement the is_equivalent() method for the CORBA::Object.
Definition at line 309 of file Stub.cpp.
00310 { 00311 if (CORBA::is_nil (other_obj)) 00312 return false; 00313 00314 TAO_Profile * const other_profile = other_obj->_stubobj ()->profile_in_use_; 00315 TAO_Profile * const this_profile = this->profile_in_use_; 00316 00317 if (other_profile == 0 || this_profile == 0) 00318 return false; 00319 00320 // Compare the profiles 00321 return this_profile->is_equivalent (other_profile); 00322 }
| TAO_MProfile * TAO_Stub::make_profiles | ( | void | ) |
Copy of the profile list, user must free memory when done. although the user can call make_profiles() then reorder the list and give it back to TAO_Stub.
Definition at line 69 of file Stub.inl.
00070 { 00071 TAO_MProfile *mp = 0; 00072 00073 ACE_NEW_RETURN (mp, 00074 TAO_MProfile (base_profiles_), 00075 0); 00076 00077 return mp; 00078 }
| CORBA::Boolean TAO_Stub::marshal | ( | TAO_OutputCDR & | cdr | ) |
Needed to avoid copying forward_profiles for thread safety.
Definition at line 495 of file Stub.cpp.
00496 { 00497 // do as many outside of locked else-branch as posssible 00498 00499 // STRING, a type ID hint 00500 if ((cdr << this->type_id.in()) == 0) 00501 return 0; 00502 00503 if ( ! this->forward_profiles_perm_) 00504 { 00505 const TAO_MProfile& mprofile = this->base_profiles_; 00506 00507 CORBA::ULong const profile_count = mprofile.profile_count (); 00508 if ((cdr << profile_count) == 0) 00509 return 0; 00510 00511 // @@ The MProfile should be locked during this iteration, is there 00512 // anyway to achieve that? 00513 for (CORBA::ULong i = 0; i < profile_count; ++i) 00514 { 00515 const TAO_Profile* p = mprofile.get_profile (i); 00516 if (p->encode (cdr) == 0) 00517 return 0; 00518 } 00519 } 00520 else 00521 { 00522 ACE_MT (ACE_GUARD_RETURN (ACE_Lock, 00523 guard, 00524 *this->profile_lock_ptr_, 00525 0)); 00526 00527 ACE_ASSERT(this->forward_profiles_ !=0); 00528 00529 // paranoid - in case of FT the basic_profiles_ would do, too, 00530 // but might be dated 00531 const TAO_MProfile& mprofile = 00532 this->forward_profiles_perm_ 00533 ? *(this->forward_profiles_perm_) 00534 : this->base_profiles_; 00535 00536 CORBA::ULong const profile_count = mprofile.profile_count (); 00537 if ((cdr << profile_count) == 0) 00538 return 0; 00539 00540 // @@ The MProfile should be locked during this iteration, is there 00541 // anyway to achieve that? 00542 for (CORBA::ULong i = 0; i < profile_count; ++i) 00543 { 00544 const TAO_Profile* p = mprofile.get_profile (i); 00545 if (p->encode (cdr) == 0) 00546 return 0; 00547 } 00548 00549 // release ACE_Lock 00550 } 00551 00552 return (CORBA::Boolean) cdr.good_bit (); 00553 }
| TAO_Profile * TAO_Stub::next_forward_profile | ( | void | ) | [private] |
NON-THREAD-SAFE. utility method for next_profile.
Definition at line 81 of file Stub.inl.
00082 { 00083 TAO_Profile *pfile_next = 0; 00084 00085 while (this->forward_profiles_ 00086 && (pfile_next = this->forward_profiles_->get_next ()) == 0 00087 && this->forward_profiles_ != this->forward_profiles_perm_) // do not remove permanent forward from bottom of stack 00088 // that was the last profile. Now we clean up our forward profiles. 00089 // since we own the forward MProfiles, we must delete them when done. 00090 this->forward_back_one (); 00091 00092 return pfile_next; 00093 }
| TAO_Profile * TAO_Stub::next_profile | ( | void | ) |
True if permanent location forward occured, in this case the lock must be set and the.
THREAD SAFE. If forward_profiles is null then this will get the next profile in the base_profiles list. If forward is not null then this will get the next profile for the list of forwarding profiles. If all profiles have been tried then 0 is returned and profile_in_use_ is set to the first profile in the base_profiles list.
Definition at line 157 of file Stub.inl.
00158 { 00159 ACE_MT (ACE_GUARD_RETURN (ACE_Lock, 00160 guard, 00161 *this->profile_lock_ptr_, 00162 0)); 00163 return this->next_profile_i (); 00164 }
| TAO_Profile * TAO_Stub::next_profile_i | ( | void | ) | [protected] |
NON-THREAD SAFE version of next_profile (void).
Definition at line 96 of file Stub.inl.
00097 { 00098 TAO_Profile *pfile_next = 0; 00099 00100 // First handle the case that a permanent forward occured 00101 if (this->forward_profiles_perm_) // the permanent forward defined 00102 // at bottom of stack 00103 // forward_profiles_ 00104 { 00105 // In case of permanent forward the base_profiles are ingored. 00106 00107 pfile_next = this->next_forward_profile (); 00108 00109 if (pfile_next == 0) 00110 { 00111 // COND: this->forward_profiles_ == this->forward_profiles_perm_ 00112 00113 // reached end of list of permanent forward profiles 00114 // now, reset forward_profiles_perm_ 00115 00116 this->forward_profiles_->rewind (); 00117 this->profile_success_ = false; 00118 this->set_profile_in_use_i (this->forward_profiles_->get_next()); 00119 } 00120 else 00121 this->set_profile_in_use_i (pfile_next); 00122 00123 // We may have been forwarded to / from a collocated situation 00124 // Check for this and apply / remove optimisation if required. 00125 this->orb_core_->reinitialize_object (this); 00126 00127 return pfile_next; 00128 } 00129 else 00130 { 00131 if (this->forward_profiles_) // Now do the common operation 00132 { 00133 pfile_next = this->next_forward_profile (); 00134 if (pfile_next == 0) 00135 { 00136 // Fall back to base profiles 00137 pfile_next = this->base_profiles_.get_next (); 00138 } 00139 00140 // We may have been forwarded to / from a collocated situation 00141 // Check for this and apply / remove optimisation if required. 00142 this->orb_core_->reinitialize_object (this); 00143 } 00144 else 00145 pfile_next = this->base_profiles_.get_next (); 00146 00147 if (pfile_next == 0) 00148 this->reset_base (); 00149 else 00150 this->set_profile_in_use_i (pfile_next); 00151 00152 return pfile_next; 00153 } 00154 }
| CORBA::Boolean TAO_Stub::next_profile_retry | ( | void | ) |
THREAD SAFE Used to get the next profile after the one being used has failed during the initial connect or send of the message!
Definition at line 205 of file Stub.inl.
00206 { 00207 ACE_MT (ACE_GUARD_RETURN (ACE_Lock, 00208 guard, 00209 *this->profile_lock_ptr_, 00210 0)); 00211 00212 if (this->profile_success_ && this->forward_profiles_) 00213 { 00214 // We have a forwarded reference that we have managed to *send* a message to 00215 // previously in the remote path only (but not counting object proxy broker ops). 00216 // @todo I can see little sense to this. It is at best highly inconsistent. sm. 00217 00218 // In this case we are falling back from the forwarded IOR stright to the base IOR 00219 this->reset_profiles_i (); 00220 00221 // We used to return unconditional true at this point but this results in 00222 // infinite retries of any permanent location forward. This is undesirable. 00223 return !this->forward_profiles_perm_; 00224 } 00225 else if (this->next_profile_i ()) 00226 { 00227 return true; 00228 } 00229 00230 return false; 00231 }
| const TAO::ObjectKey & TAO_Stub::object_key | ( | void | ) | const |
Return the ObjectKey.
Definition at line 221 of file Stub.cpp.
00222 { 00223 // Return the profile in use's object key if you see one. 00224 if (this->profile_in_use_) 00225 return this->profile_in_use_->object_key (); 00226 00227 if (this->forward_profiles_) 00228 { 00229 // Double-checked 00230 ACE_Guard<ACE_Lock> obj (*this->profile_lock_ptr_); 00231 00232 if (obj.locked () != 0 && this->forward_profiles_ != 0) 00233 return this->forward_profiles_->get_profile (0)->object_key (); 00234 } 00235 00236 // If no forwarded profiles, just use the base profile 00237 return this->base_profiles_.get_profile (0)->object_key (); 00238 }
| TAO::Object_Proxy_Broker * TAO_Stub::object_proxy_broker | ( | void | ) | const |
Accessor for getting the object proxy broker pointer. CORBA::Objects using this stub use this for standard calls like is_a; get_interface; etc...
Definition at line 296 of file Stub.inl.
00297 { 00298 return this->object_proxy_broker_; 00299 }
| void TAO_Stub::object_proxy_broker | ( | TAO::Object_Proxy_Broker * | proxy_broker | ) |
Mutator for setting the object proxy broker pointer. CORBA::Objects using this stub will use this for standard calls like is_a; get_interface; etc...
Definition at line 302 of file Stub.inl.
00303 { 00304 this->object_proxy_broker_ = object_proxy_broker; 00305 }
| CORBA::Boolean TAO_Stub::optimize_collocation_objects | ( | void | ) | const |
Return the cached value from the ORB_Core.
This flag indicates whether the stub code should make use of the collocation opportunities that are available to the ORB.
Definition at line 315 of file Stub.inl.
00316 { 00317 return this->collocation_opt_; 00318 }
| TAO_ORB_Core * TAO_Stub::orb_core | ( | void | ) | const |
| TAO_Profile * TAO_Stub::profile_in_use | ( | void | ) |
Manage the base (non-forwarded) profiles. Returns a pointer to the profile_in_use object. This object retains ownership of this profile.
Definition at line 63 of file Stub.inl.
00064 { 00065 return this->profile_in_use_; 00066 }
| ACE_Lock * TAO_Stub::profile_lock | ( | void | ) | const |
Return the Profile lock. This lock can be used at places where profiles need to be edited.
Definition at line 20 of file Stub.inl.
00021 { 00022 return this->profile_lock_ptr_; 00023 }
| void TAO_Stub::reset_base | ( | void | ) | [private] |
NON-THREAD-SAFE. Utility method which resets or initializes the base_profile list and forward flags.
Definition at line 10 of file Stub.inl.
00011 { 00012 this->base_profiles_.rewind (); 00013 this->profile_success_ = false; 00014 00015 this->set_profile_in_use_i (base_profiles_.get_next ()); 00016 }
| void TAO_Stub::reset_forward | ( | void | ) | [private] |
NOT THREAD-SAFE. Utility method which pops all forward profile lists and resets the forward_profiles_ pointer.
Definition at line 26 of file Stub.inl.
00027 { 00028 while (this->forward_profiles_ != 0 00029 && this->forward_profiles_ != this->forward_profiles_perm_) // Disturbingly the permanent 00030 // forwarded profile lives at the bottom 00031 // of this stack if it exists. Avoid deleting it. 00032 this->forward_back_one (); 00033 }
| void TAO_Stub::reset_profiles | ( | void | ) |
THREAD SAFE This method will reset the base profile list to reference the first profile and if there are anmy existing forward profiles they are reset.
Definition at line 54 of file Stub.inl.
00055 { 00056 ACE_MT (ACE_GUARD (ACE_Lock, 00057 guard, 00058 *this->profile_lock_ptr_)); 00059 this->reset_profiles_i (); 00060 }
| void TAO_Stub::reset_profiles_i | ( | void | ) | [protected] |
NON-THREAD SAFE version of reset_profiles (void);.
Definition at line 36 of file Stub.inl.
00037 { 00038 this->reset_forward (); 00039 this->reset_base (); 00040 00041 if (this->forward_profiles_perm_) 00042 { 00043 // The *permanent* forward is being kept in the transient 00044 // forward queue (??!). We have just nuked it. Put it back the way it was. 00045 // reset_base should have reset the profile success. 00046 // @todo We have knives in the spoon draw - TAO_Stub needs total rewrite. 00047 this->forward_profiles_ = this->forward_profiles_perm_; 00048 this->forward_profiles_->rewind (); 00049 this->set_profile_in_use_i (this->forward_profiles_->get_next ()); 00050 } 00051 }
| void TAO_Stub::servant_orb | ( | CORBA::ORB_ptr | orb | ) |
Accesor and mutator for the servant ORB. Notice that the mutator assumes the ownership of the passed in ORB and the accesor does not return a copy of the orb since the accessing of the ORB is considered temporary.
Definition at line 278 of file Stub.inl.
00279 { 00280 this->servant_orb_ = CORBA::ORB::_duplicate (orb); 00281 }
| CORBA::ORB_ptr TAO_Stub::servant_orb_ptr | ( | void | ) |
This returns a duplicated ORB pointer.
Definition at line 271 of file Stub.inl.
00272 { 00273 // Simply pass back the ORB pointer for temporary use. 00274 return CORBA::ORB::_duplicate (this->servant_orb_.in ()); 00275 }
| CORBA::ORB_var & TAO_Stub::servant_orb_var | ( | void | ) |
This returns the ORB var itself (generally for temporary use).
Definition at line 264 of file Stub.inl.
00265 { 00266 // Simply pass back the ORB pointer for temporary use. 00267 return this->servant_orb_; 00268 }
| TAO_Stub * TAO_Stub::set_policy_overrides | ( | const CORBA::PolicyList & | policies, | |
| CORBA::SetOverrideType | set_add | |||
| ) | [virtual] |
Definition at line 442 of file Stub.cpp.
00444 { 00445 // Notice the use of an explicit constructor.... 00446 auto_ptr<TAO_Policy_Set> policy_manager ( 00447 new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE)); 00448 00449 if (set_add == CORBA::SET_OVERRIDE) 00450 { 00451 policy_manager->set_policy_overrides (policies, set_add); 00452 } 00453 else if (this->policies_ == 0) 00454 { 00455 policy_manager->set_policy_overrides (policies, CORBA::SET_OVERRIDE); 00456 } 00457 else 00458 { 00459 policy_manager->copy_from (this->policies_); 00460 00461 policy_manager->set_policy_overrides (policies, set_add); 00462 } 00463 00464 TAO_Stub* stub = this->orb_core_->create_stub (this->type_id.in (), 00465 this->base_profiles_); 00466 00467 stub->policies_ = policy_manager.release (); 00468 00469 // Copy the servant ORB if it is present. 00470 stub->servant_orb (this->servant_orb_var ().in ()); 00471 00472 return stub; 00473 }
| TAO_Profile * TAO_Stub::set_profile_in_use_i | ( | TAO_Profile * | pfile | ) | [private] |
Makes a copy of the profile and frees the existing profile_in_use. NOT THREAD SAFE
Definition at line 327 of file Stub.cpp.
00328 { 00329 TAO_Profile *const old = this->profile_in_use_; 00330 00331 // Since we are actively using this profile we dont want 00332 // it to disappear, so increase the reference count by one!! 00333 if (pfile && (pfile->_incr_refcnt () == 0)) 00334 { 00335 ACE_ERROR_RETURN ((LM_ERROR, 00336 ACE_TEXT ("(%P|%t) unable to increment profile ref!\n")), 00337 0); 00338 } 00339 00340 this->profile_in_use_ = pfile; 00341 00342 if (old) 00343 old->_decr_refcnt (); 00344 00345 return this->profile_in_use_; 00346 }
| void TAO_Stub::set_valid_profile | ( | void | ) |
NON-THREAD-SAFE. Will set profile_success_ to true.
Definition at line 173 of file Stub.inl.
00174 { 00175 this->profile_success_ = true; 00176 }
| TAO::Transport_Queueing_Strategy * TAO_Stub::transport_queueing_strategy | ( | void | ) |
Return the queueing strategy to be used in by the transport. Selection will be based on the SyncScope policies.
Definition at line 321 of file Stub.inl.
00322 { 00323 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) 00324 00325 bool has_synchronization; 00326 Messaging::SyncScope scope; 00327 00328 this->orb_core_->call_sync_scope_hook (this, has_synchronization, scope); 00329 00330 if (has_synchronization == true) 00331 return this->orb_core_->get_transport_queueing_strategy (this, scope); 00332 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ 00333 00334 // No queueing strategy, let the transport use its default 00335 return 0; 00336 }
| CORBA::Boolean TAO_Stub::valid_forward_profile | ( | void | ) |
Returns true if a forward profile has successfully been used. profile_success_ && forward_profiles_
Definition at line 167 of file Stub.inl.
00168 { 00169 return (this->profile_success_ && this->forward_profiles_); 00170 }
| CORBA::Boolean TAO_Stub::valid_profile | ( | void | ) | const |
Returns true if a connection was successful with at least one profile.
Definition at line 179 of file Stub.inl.
00180 { 00181 return this->profile_success_; 00182 }
TAO_MProfile TAO_Stub::base_profiles_ [protected] |
TAO_Abstract_ServantBase* TAO_Stub::collocated_servant_ [protected] |
CORBA::Boolean const TAO_Stub::collocation_opt_ [protected] |
TRUE if we want to take advantage of collocation optimization in this ORB. This should be the same value as cached in the ORB_Core. The reason for caching this helps our generated code, notably the stubs to be decoubled from ORB_Core. Please do not move it away.
TAO_MProfile* TAO_Stub::forward_profiles_ [protected] |
The list of forwarding profiles. This is actually implemented as a linked list of TAO_MProfile objects.
TAO_MProfile* TAO_Stub::forward_profiles_perm_ [protected] |
IOP::IOR* TAO_Stub::forwarded_ior_info_ [protected] |
ACE_Atomic_Op<TAO_SYNCH_MUTEX, bool> TAO_Stub::forwarded_on_exception_ [protected] |
IOP::IOR* TAO_Stub::ior_info_ [protected] |
The ior info. This is needed for GIOP 1.2, as the clients could receive an exception from the server asking for this info. The exception that the client receives is LOC_NEEDS_ADDRESSING_MODE. The data is set up here to be passed on to Invocation classes when they receive an exception. This info is for the base profiles that this class stores
CORBA::Boolean TAO_Stub::is_collocated_ [protected] |
TAO::Object_Proxy_Broker* TAO_Stub::object_proxy_broker_ [protected] |
Pointer to the Proxy Broker.
This cached pointer instance takes care of routing the call for standard calls in CORBA::Object like _is_a (), _get_component () etc.
CORBA::ORB_var TAO_Stub::orb_ [protected] |
ORB required for reference counting. This will help us keep the ORB around until the CORBA::Object we represent dies.
TAO_ORB_Core_Auto_Ptr TAO_Stub::orb_core_ [protected] |
Automatically manage the ORB_Core reference count.
The ORB_Core cannot go away until the object references it creates are destroyed. There are multiple reasons for this, but in particular, the allocators used for some of the TAO_Profile objects contained on each TAO_Stub are owned by the TAO_ORB_Core.
This must be the first field of the class, otherwise the TAO_ORB_Core is destroyed too early!
TAO_Policy_Set* TAO_Stub::policies_ [protected] |
TAO_Profile* TAO_Stub::profile_in_use_ [protected] |
ACE_Lock* TAO_Stub::profile_lock_ptr_ [protected] |
CORBA::Boolean TAO_Stub::profile_success_ [protected] |
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> TAO_Stub::refcount_ [protected] |
CORBA::ORB_var TAO_Stub::servant_orb_ [protected] |
1.6.1