#include <Stub.h>
Collaboration diagram for TAO_Stub:

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 0. | |
| 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. | |
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, CORBA::ULong > | refcount_ |
| Reference counter. | |
| TAO_Policy_Set * | policies_ |
| IOP::IOR * | ior_info_ |
| IOP::IOR * | forwarded_ior_info_ |
| Forwarded IOR info. | |
| const CORBA::Boolean | collocation_opt_ |
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.
|
||||||||||||||||
|
Construct from a repository ID and a list of profiles.
Definition at line 35 of file Stub.cpp. References CORBA::ORB::_duplicate(), ACE_DEBUG, ACE_TEXT, base_profiles(), TAO_ORB_Core_Auto_Ptr::get(), LM_DEBUG, profile_lock_ptr_, TAO_ORB_Core_Auto_Ptr::reset(), TAO_debug_level, TAO_HAS_CORBA_MESSAGING, TAO_ORB_Core_instance(), and the_tao_remote_object_proxy_broker().
00038 : type_id (repository_id) 00039 , orb_core_ (orb_core) 00040 , orb_ () 00041 , is_collocated_ (false) 00042 , servant_orb_ () 00043 , collocated_servant_ (0) 00044 , object_proxy_broker_ (the_tao_remote_object_proxy_broker ()) 00045 , base_profiles_ ((CORBA::ULong) 0) 00046 , forward_profiles_ (0) 00047 , forward_profiles_perm_ (0) 00048 , profile_in_use_ (0) 00049 , profile_lock_ptr_ (0) 00050 , profile_success_ (false) 00051 , refcount_ (1) 00052 #if (TAO_HAS_CORBA_MESSAGING == 1) 00053 , policies_ (0) 00054 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00055 , ior_info_ (0) 00056 , forwarded_ior_info_ (0) 00057 , collocation_opt_ (orb_core->optimize_collocation_objects ()) 00058 { 00059 if (this->orb_core_.get() == 0) 00060 { 00061 if (TAO_debug_level > 0) 00062 { 00063 ACE_DEBUG ((LM_DEBUG, 00064 ACE_TEXT ("TAO: (%P|%t) TAO_Stub created with default ") 00065 ACE_TEXT ("ORB core\n"))); 00066 } 00067 00068 this->orb_core_.reset (TAO_ORB_Core_instance ()); 00069 } 00070 00071 // Duplicate the ORB_Core, otherwise the allocators and other 00072 // resources that this class references (directly or indirectly) 00073 // could be destroyed before it is time. 00074 (void) this->orb_core_->_incr_refcnt (); 00075 00076 // Cache the ORB pointer to respond faster to certain queries. 00077 this->orb_ = CORBA::ORB::_duplicate (this->orb_core_->orb ()); 00078 00079 this->profile_lock_ptr_ = 00080 this->orb_core_->client_factory ()->create_profile_lock (); 00081 00082 this->base_profiles (profiles); 00083 } |
|
|
Destructor is to be called only through _decr_refcnt() to enforce proper reference counting. Definition at line 85 of file Stub.cpp. References TAO_Profile::_decr_refcnt(), ACE_ASSERT, forward_profiles_, forwarded_ior_info_, ior_info_, policies_, profile_in_use_, profile_lock_ptr_, and reset_profiles().
00086 {
00087 ACE_ASSERT (this->refcount_ == 0);
00088
00089 if (this->forward_profiles_)
00090 reset_profiles ();
00091
00092 if (this->profile_in_use_ != 0)
00093 {
00094 // decrease reference count on profile
00095 this->profile_in_use_->_decr_refcnt ();
00096 this->profile_in_use_ = 0;
00097 }
00098
00099 delete this->profile_lock_ptr_;
00100
00101 #if (TAO_HAS_CORBA_MESSAGING == 1)
00102
00103 delete this->policies_;
00104
00105 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00106
00107 if (this->ior_info_)
00108 delete this->ior_info_;
00109
00110 if (this->forwarded_ior_info_)
00111 delete this->forwarded_ior_info_;
00112 }
|
|
|
|
|
|
Definition at line 355 of file Stub.cpp. Referenced by TAO_Stub_Auto_Ptr::reset(), CORBA::Object::~Object(), and TAO_Stub_Auto_Ptr::~TAO_Stub_Auto_Ptr().
00356 {
00357 const CORBA::ULong new_count = --this->refcount_;
00358
00359 if (new_count == 0)
00360 delete this;
00361 }
|
|
|
Definition at line 349 of file Stub.cpp. Referenced by TAO::Narrow_Utils< T >::unchecked_narrow().
00350 {
00351 ++this->refcount_;
00352 }
|
|
||||||||||||
|
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 115 of file Stub.cpp. References ACE_GUARD, ACE_NEW, base_profiles_, forward_profiles_, forward_profiles_perm_, TAO_Profile::forward_to(), profile_in_use_, profile_success_, and reset_forward(). Referenced by TAO::Invocation_Adapter::object_forwarded().
00117 {
00118 // we assume that the profile_in_use_ is being
00119 // forwarded! Grab the lock so things don't change.
00120 ACE_MT (ACE_GUARD (ACE_Lock,
00121 guard,
00122 *this->profile_lock_ptr_));
00123
00124 if (permanent_forward)
00125 {
00126 // paranoid, reset the bookmark, then clear the forward-stack
00127 this->forward_profiles_perm_ = 0;
00128
00129 this->reset_forward ();
00130 }
00131
00132 TAO_MProfile *now_pfiles = this->forward_profiles_;
00133 if (now_pfiles == 0)
00134 now_pfiles = &this->base_profiles_;
00135
00136 ACE_NEW (this->forward_profiles_,
00137 TAO_MProfile (mprofiles));
00138
00139 if (permanent_forward)
00140 // bookmark the new element at bottom of stack
00141 this->forward_profiles_perm_ = this->forward_profiles_;
00142
00143 // forwarded profile points to the new IOR (profiles)
00144 this->profile_in_use_->forward_to (this->forward_profiles_);
00145
00146 // new profile list points back to the list which was forwarded.
00147 this->forward_profiles_->forward_from (now_pfiles);
00148
00149 // make sure we start at the beginning of mprofiles
00150 this->forward_profiles_->rewind ();
00151
00152 // Since we have been forwarded, we must set profile_success_ to false
00153 // since we are starting a new with a new set of profiles!
00154 this->profile_success_ = false;
00155
00156 // Reset any flags that may be appropriate in the services that
00157 // selects profiles for invocation
00158 this->orb_core_->reset_service_profile_flags ();
00159 }
|
|
|
Initialize the base_profiles_ and set profile_in_use_ to reference the first profile. Definition at line 172 of file Stub.i. References ACE_GUARD_RETURN, base_profiles_, profile_in_use_, reset_base(), reset_forward(), and TAO_MProfile::set().
00173 {
00174 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00175 guard,
00176 *this->profile_lock_ptr_,
00177 0));
00178
00179 // first reset things so we start from scratch!
00180
00181 // @note This reset forward could effect the collocation status
00182 // but as this method is only used from the Stub ctr, when the status
00183 // is already correctly set, we don't reinitialise here. sm.
00184 this->reset_forward ();
00185 this->base_profiles_.set (mprofiles);
00186 this->reset_base ();
00187 return this->profile_in_use_;
00188
00189 }
|
|
|
Obtain a reference to the basic profile set.
Definition at line 242 of file Stub.i. References base_profiles_.
00243 {
00244 return this->base_profiles_;
00245 }
|
|
|
Obtain a reference to the basic profile set.
Definition at line 236 of file Stub.i. References base_profiles_. Referenced by TAO_ORB_Core::create_object(), TAO_ORB_Core::create_stub_object(), TAO_ORB_Core::initialize_object(), TAO::Invocation_Adapter::object_forwarded(), TAO_ORB_Core::reinitialize_object(), and TAO_Stub().
00237 {
00238 return this->base_profiles_;
00239 }
|
|
|
Accessor for the servant reference in collocated cases.
Definition at line 286 of file Stub.i. References collocated_servant_.
00287 {
00288 return collocated_servant_;
00289 }
|
|
|
Mutator for setting the servant in collocated cases.
Definition at line 292 of file Stub.i. References collocated_servant_. Referenced by CORBA::Object::_servant(), TAO_Adapter_Registry::create_collocated_object(), CORBA::Object::Object(), and CORBA::Object::set_collocated_servant().
00293 {
00294 this->collocated_servant_ = servant;
00295 }
|
|
||||||||||||
|
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 162 of file Stub.cpp. References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_GUARD_RETURN, base_profiles_, forward_profiles_, forwarded_ior_info_, TAO_MProfile::get_profile(), get_profile_ior_info(), ior_info_, TAO_MProfile::profile_count(), and profile_in_use_. Referenced by TAO::Remote_Invocation::init_target_spec().
00165 {
00166 // We are creating the IOR info. Let us not be disturbed. So grab a
00167 // lock.
00168 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00169 guard,
00170 *this->profile_lock_ptr_,
00171 -1));
00172
00173 IOP::IOR *tmp_info = 0;
00174
00175 if (this->forward_profiles_ != 0)
00176 {
00177 if (this->forwarded_ior_info_ == 0)
00178 {
00179 this->get_profile_ior_info (*this->forward_profiles_,
00180 tmp_info
00181 ACE_ENV_ARG_PARAMETER);
00182 ACE_CHECK_RETURN (-1);
00183
00184 this->forwarded_ior_info_ = tmp_info;
00185 }
00186
00187 // First we look at the forward profiles to see whether the
00188 // profile_in_use is any of it.
00189 for (CORBA::ULong i = 0;
00190 i < this->forward_profiles_->profile_count ();
00191 ++i)
00192 {
00193 if (this->forward_profiles_->get_profile (i)
00194 == this->profile_in_use_)
00195 {
00196 ior_info = this->forwarded_ior_info_;
00197 index = i;
00198 return 0;
00199 }
00200 }
00201 }
00202
00203 // Else we look at the base profiles
00204 if (this->ior_info_ == 0)
00205 {
00206 this->get_profile_ior_info (this->base_profiles_,
00207 tmp_info
00208 ACE_ENV_ARG_PARAMETER);
00209 ACE_CHECK_RETURN (-1);
00210
00211 this->ior_info_ = tmp_info;
00212 }
00213
00214
00215 for (CORBA::ULong ind = 0;
00216 ind < this->base_profiles_.profile_count ();
00217 ++ind)
00218 {
00219 if (this->base_profiles_.get_profile (ind) ==
00220 this->profile_in_use_)
00221 {
00222 index = ind;
00223 ior_info = this->ior_info_;
00224 return 0;
00225 }
00226 }
00227
00228 // Error, there was no match
00229 return -1;
00230 }
|
|
|
Deallocate the TAO_Stub object. This method is intended to be used only by the CORBA::Object class. Definition at line 310 of file Stub.i.
00311 {
00312 // The reference count better be zero at this point!
00313 delete this;
00314 }
|
|
|
NON-THREAD-SAFE. Utility method which unrolls (removes or pops) the top most forwarding profile list. Definition at line 386 of file Stub.cpp. References base_profiles_, TAO_MProfile::forward_from(), forward_profiles_, TAO_Profile::forward_to(), and TAO_MProfile::get_current_profile(). Referenced by next_forward_profile(), and reset_forward().
00387 {
00388 TAO_MProfile *from = forward_profiles_->forward_from ();
00389
00390 delete this->forward_profiles_;
00391
00392 // the current profile in this profile list is no
00393 // longer being forwarded, so set the reference to zero.
00394 if (from == &this->base_profiles_)
00395 {
00396 this->base_profiles_.get_current_profile ()->forward_to (0);
00397 this->forward_profiles_ = 0;
00398 }
00399 else
00400 {
00401 from->get_current_profile ()->forward_to (0);
00402 this->forward_profiles_ = from;
00403 }
00404 }
|
|
|
Obtain a pointer to the forwarded profile set.
Definition at line 248 of file Stub.i. References forward_profiles_. Referenced by TAO_ORB_Core::reinitialize_object().
00249 {
00250 return this->forward_profiles_;
00251 }
|
|
|
Definition at line 511 of file Stub.cpp. References TAO_Objref_Var_T< T >::_retn(), ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, TAO_Policy_Set::get_cached_policy(), TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), policies_, and CORBA::Policy_var. Referenced by CORBA::Object::_get_cached_policy(), and TAO::Eager_Transport_Queueing_Strategy::buffering_constraints_reached().
00513 {
00514 // No need to lock, the stub only changes its policies at
00515 // construction time...
00516
00517 CORBA::Policy_var result;
00518 if (this->policies_ != 0)
00519 {
00520 result =
00521 this->policies_->get_cached_policy (type
00522 ACE_ENV_ARG_PARAMETER);
00523
00524 ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00525
00526 }
00527
00528 if (CORBA::is_nil (result.in ()))
00529 {
00530 result =
00531 this->orb_core_->get_cached_policy_including_current (type
00532 ACE_ENV_ARG_PARAMETER);
00533 ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00534 }
00535
00536 return result._retn ();
00537 }
|
|
|
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 484 of file Stub.cpp. References TAO_Objref_Var_T< T >::_retn(), ACE_CHECK, ACE_ENV_ARG_PARAMETER, TAO_Policy_Set::get_policy(), TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), policies_, CORBA::Policy_var, and CORBA::PolicyType. Referenced by CORBA::Object::_get_policy().
00486 {
00487 // No need to lock, the stub only changes its policies at
00488 // construction time...
00489
00490 CORBA::Policy_var result;
00491 if (this->policies_ != 0)
00492 {
00493 result =
00494 this->policies_->get_policy (type
00495 ACE_ENV_ARG_PARAMETER);
00496 ACE_CHECK (CORBA::Policy::_nil ());
00497 }
00498
00499 if (CORBA::is_nil (result.in ()))
00500 {
00501 result =
00502 this->orb_core_->get_policy_including_current (type
00503 ACE_ENV_ARG_PARAMETER);
00504 ACE_CHECK (CORBA::Policy::_nil ());
00505 }
00506
00507 return result._retn ();
00508 }
|
|
|
Definition at line 588 of file Stub.cpp. References ACE_ENV_ARG_PARAMETER, TAO_Policy_Set::get_policy_overrides(), and policies_. Referenced by CORBA::Object::_get_policy_overrides().
00590 {
00591 if (this->policies_ == 0)
00592 return 0;
00593
00594 return this->policies_->get_policy_overrides (types
00595 ACE_ENV_ARG_PARAMETER);
00596 }
|
|
||||||||||||
|
THREAD-SAFE Create the IOR info.
Definition at line 253 of file Stub.cpp. References ACE_CHECK_RETURN, ACE_NEW_THROW_EX, ACE_THROW_RETURN, TAO_Profile::create_tagged_profile(), TAO_MProfile::get_profile(), and TAO_MProfile::profile_count(). Referenced by create_ior_info().
00256 {
00257
00258
00259 ACE_NEW_THROW_EX (ior_info,
00260 IOP::IOR (),
00261 CORBA::NO_MEMORY ());
00262 ACE_CHECK_RETURN (-1);
00263
00264
00265 // Get the number of elements
00266 CORBA::ULong count = profiles.profile_count ();
00267
00268 // Set the number of elements in the sequence of tagged_profile
00269 ior_info->profiles.length (count);
00270
00271 // Call the create_tagged_profile one every member of the
00272 // profile and make the sequence
00273 for (CORBA::ULong index = 0; index < count; ++index)
00274 {
00275 TAO_Profile *prof = profiles.get_profile (index);
00276
00277 IOP::TaggedProfile *tp =
00278 prof->create_tagged_profile ();
00279
00280 if (tp == 0)
00281 ACE_THROW_RETURN (CORBA::NO_MEMORY (),
00282 -1);
00283 ior_info->profiles[index] = *tp;
00284 }
00285
00286 return 0;
00287 }
|
|
|
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 315 of file Stub.cpp. References ACE_ENV_ARG_PARAMETER, base_profiles_, and TAO_MProfile::hash(). Referenced by CORBA::Object::_hash().
00317 {
00318 // we rely on the profile objects that its address info
00319 return this->base_profiles_.hash (max ACE_ENV_ARG_PARAMETER);
00320 }
|
|
|
Mutator to mark this stub as being collocated with the servant.
Definition at line 290 of file Stub.cpp. References _TAO_Object_Proxy_Broker_Factory_function_pointer, is_collocated_, object_proxy_broker_, and the_tao_remote_object_proxy_broker().
00291 {
00292 if (this->is_collocated_ != collocated)
00293 {
00294 if (collocated &&
00295 _TAO_Object_Proxy_Broker_Factory_function_pointer != 0)
00296 {
00297 this->object_proxy_broker_ =
00298 _TAO_Object_Proxy_Broker_Factory_function_pointer ();
00299 }
00300 else
00301 {
00302 this->object_proxy_broker_ =
00303 the_tao_remote_object_proxy_broker ();
00304 }
00305 this->is_collocated_ = collocated;
00306 }
00307 }
|
|
|
Is this stub collocated with the servant?
Definition at line 254 of file Stub.i. References is_collocated_. Referenced by CORBA::Object::_is_collocated(), CORBA::Object::Object(), and CORBA::Object::set_collocated_servant().
00255 {
00256 return this->is_collocated_;
00257 }
|
|
|
Implement the is_equivalent() method for the CORBA::Object.
Definition at line 331 of file Stub.cpp. References CORBA::Object::_stubobj(), TAO_Profile::is_equivalent(), CORBA::is_nil(), CORBA::Object_ptr, and profile_in_use_.
00332 {
00333 if (CORBA::is_nil (other_obj))
00334 return false;
00335
00336 TAO_Profile * const other_profile = other_obj->_stubobj ()->profile_in_use_;
00337 TAO_Profile * const this_profile = this->profile_in_use_;
00338
00339 if (other_profile == 0 || this_profile == 0)
00340 return false;
00341
00342 // Compare the profiles
00343 return this_profile->is_equivalent (other_profile);
00344 }
|
|
|
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 55 of file Stub.i. References ACE_NEW_RETURN, and base_profiles_.
00056 {
00057 TAO_MProfile *mp = 0;
00058
00059 ACE_NEW_RETURN (mp,
00060 TAO_MProfile (base_profiles_),
00061 0);
00062
00063 return mp;
00064 }
|
|
|
Needed to avoid copying forward_profiles for thread safety.
Definition at line 622 of file Stub.cpp. References ACE_ASSERT, ACE_GUARD_RETURN, base_profiles_, TAO_Profile::encode(), forward_profiles_perm_, TAO_MProfile::get_profile(), ACE_OutputCDR::good_bit(), TAO::String_var< charT >::in(), and TAO_MProfile::profile_count(). Referenced by operator<<().
00623 {
00624 // do as many outside of locked else-branch as posssible
00625
00626 // STRING, a type ID hint
00627 if ((cdr << this->type_id.in()) == 0)
00628 return 0;
00629
00630 if ( ! this->forward_profiles_perm_)
00631 {
00632 const TAO_MProfile& mprofile = this->base_profiles_;
00633
00634 CORBA::ULong profile_count = mprofile.profile_count ();
00635 if ((cdr << profile_count) == 0)
00636 return 0;
00637
00638 // @@ The MProfile should be locked during this iteration, is there
00639 // anyway to achieve that?
00640 for (CORBA::ULong i = 0; i < profile_count; ++i)
00641 {
00642 const TAO_Profile* p = mprofile.get_profile (i);
00643 if (p->encode (cdr) == 0)
00644 return 0;
00645 }
00646 }
00647 else
00648 {
00649 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00650 guard,
00651 *this->profile_lock_ptr_,
00652 0));
00653
00654 ACE_ASSERT(this->forward_profiles_ !=0);
00655
00656 // paranoid - in case of FT the basic_profiles_ would do, too,
00657 // but might be dated
00658 const TAO_MProfile& mprofile =
00659 this->forward_profiles_perm_
00660 ? *(this->forward_profiles_perm_)
00661 : this->base_profiles_;
00662
00663 CORBA::ULong profile_count = mprofile.profile_count ();
00664 if ((cdr << profile_count) == 0)
00665 return 0;
00666
00667 // @@ The MProfile should be locked during this iteration, is there
00668 // anyway to achieve that?
00669 for (CORBA::ULong i = 0; i < profile_count; ++i)
00670 {
00671 const TAO_Profile* p = mprofile.get_profile (i);
00672 if (p->encode (cdr) == 0)
00673 return 0;
00674 }
00675
00676 // release ACE_Lock
00677 }
00678
00679 return (CORBA::Boolean) cdr.good_bit ();
00680 }
|
|
|
NON-THREAD-SAFE. utility method for next_profile.
Definition at line 67 of file Stub.i. References forward_back_one(), forward_profiles_, forward_profiles_perm_, and TAO_MProfile::get_next(). Referenced by next_profile_i().
00068 {
00069 TAO_Profile *pfile_next = 0;
00070
00071 while (this->forward_profiles_
00072 && (pfile_next = this->forward_profiles_->get_next ()) == 0
00073 && this->forward_profiles_ != this->forward_profiles_perm_) // do not remove permanent forward from bottom of stack
00074 // that was the last profile. Now we clean up our forward profiles.
00075 // since we own the forward MProfiles, we must delete them when done.
00076 this->forward_back_one ();
00077
00078 return pfile_next;
00079 }
|
|
|
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 143 of file Stub.i. References ACE_GUARD_RETURN, and next_profile_i(). Referenced by TAO::Invocation_Adapter::object_forwarded().
00144 {
00145
00146 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00147 guard,
00148 *this->profile_lock_ptr_,
00149 0));
00150 return this->next_profile_i ();
00151 }
|
|
|
NON-THREAD SAFE version of next_profile (void).
Definition at line 82 of file Stub.i. References base_profiles_, forward_profiles_, forward_profiles_perm_, TAO_MProfile::get_next(), next_forward_profile(), profile_success_, reset_base(), TAO_MProfile::rewind(), and set_profile_in_use_i(). Referenced by next_profile(), and next_profile_retry().
00083 {
00084 TAO_Profile *pfile_next = 0;
00085
00086 // First handle the case that a permanent forward occured
00087 if (this->forward_profiles_perm_) // the permanent forward defined
00088 // at bottom of stack
00089 // forward_profiles_
00090 {
00091 // In case of permanent forward the base_profiles are ingored.
00092
00093 pfile_next = this->next_forward_profile ();
00094
00095 if (pfile_next == 0)
00096 {
00097 // COND: this->forward_profiles_ == this->forward_profiles_perm_
00098
00099 // reached end of list of permanent forward profiles
00100 // now, reset forward_profiles_perm_
00101
00102 this->forward_profiles_->rewind ();
00103 this->profile_success_ = false;
00104 this->set_profile_in_use_i (this->forward_profiles_->get_next());
00105 }
00106 else
00107 this->set_profile_in_use_i (pfile_next);
00108
00109 // We may have been forwarded to / from a collocated situation
00110 // Check for this and apply / remove optimisation if required.
00111 this->orb_core_->reinitialize_object (this);
00112
00113 return pfile_next;
00114 }
00115 else
00116 {
00117 if (this->forward_profiles_) // Now do the common operation
00118 {
00119 pfile_next = this->next_forward_profile ();
00120 if (pfile_next == 0)
00121 {
00122 // Fall back to base profiles
00123 pfile_next = this->base_profiles_.get_next ();
00124 }
00125
00126 // We may have been forwarded to / from a collocated situation
00127 // Check for this and apply / remove optimisation if required.
00128 this->orb_core_->reinitialize_object (this);
00129 }
00130 else
00131 pfile_next = this->base_profiles_.get_next ();
00132
00133 if (pfile_next == 0)
00134 this->reset_base ();
00135 else
00136 this->set_profile_in_use_i (pfile_next);
00137
00138 return pfile_next;
00139 }
00140 }
|
|
|
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 192 of file Stub.i. References ACE_GUARD_RETURN, forward_profiles_, next_profile_i(), profile_success_, and reset_profiles_i(). Referenced by TAO_Default_Endpoint_Selector::select_endpoint().
00193 {
00194 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00195 guard,
00196 *this->profile_lock_ptr_,
00197 0));
00198
00199 if (this->profile_success_ && this->forward_profiles_)
00200 {
00201 // We have a forwarded reference that we have managed to *send* a message to
00202 // previously in the remote path only (but not counting object proxy broker ops).
00203 // @todo I can see little sense to this. It is at best highly inconsistent. sm.
00204
00205 // In this case we are falling back from the forwarded IOR stright to the base IOR
00206 this->reset_profiles_i ();
00207 return true;
00208 }
00209 else if (this->next_profile_i ())
00210 {
00211 return true;
00212 }
00213
00214 return false;
00215 #if 0
00216 else
00217 {
00218 // Check whether the loaded services have something to say about
00219 // this condition
00220 TAO_Profile *prof = 0;
00221 this->orb_core_->service_profile_reselection (this,
00222 prof);
00223
00224 // If the service is loaded and has a profile then try it.
00225 if (prof)
00226 {
00227 return true;
00228 }
00229 this->reset_profiles_i ();
00230 return false;
00231 }
00232 #endif /*If 0 */
00233 }
|
|
|
Return the ObjectKey.
Definition at line 233 of file Stub.cpp. References base_profiles_, forward_profiles_, TAO_MProfile::get_profile(), ACE_Guard< ACE_LOCK >::locked(), TAO_Profile::object_key(), and profile_in_use_. Referenced by TAO_ServerRequest::TAO_ServerRequest().
00234 {
00235 // Return the profile in use's object key if you see one.
00236 if (this->profile_in_use_)
00237 return this->profile_in_use_->object_key ();
00238
00239 if (this->forward_profiles_)
00240 {
00241 // Double-checked
00242 ACE_Guard<ACE_Lock> obj (*this->profile_lock_ptr_);
00243
00244 if (obj.locked () != 0 && this->forward_profiles_ != 0)
00245 return this->forward_profiles_->get_profile (0)->object_key ();
00246 }
00247
00248 // If no forwarded profiles, just use the base profile
00249 return this->base_profiles_.get_profile (0)->object_key ();
00250 }
|
|
|
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 298 of file Stub.i. References object_proxy_broker_.
00299 {
00300 return this->object_proxy_broker_;
00301 }
|
|
|
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 304 of file Stub.i. References object_proxy_broker_. Referenced by CORBA::Object::_proxy_broker(), and CORBA::Object::proxy_broker().
00305 {
00306 this->object_proxy_broker_ = object_proxy_broker;
00307 }
|
|
|
|
|
|
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 317 of file Stub.i. References collocation_opt_. Referenced by TAO::Narrow_Utils< T >::unchecked_narrow().
00318 {
00319 return this->collocation_opt_;
00320 }
|
|
|
|
returns a pointer to the profile_in_use object. This object retains ownership of this profile. Definition at line 49 of file Stub.i. References profile_in_use_. Referenced by CORBA::Object::_key(), and TAO_Default_Endpoint_Selector::select_endpoint().
00050 {
00051 return this->profile_in_use_;
00052 }
|
|
|
Return the Profile lock. This lock can be used at places where profiles need to be edited. Definition at line 20 of file Stub.i. References profile_lock_ptr_.
00021 {
00022 return this->profile_lock_ptr_;
00023 }
|
|
|
NON-THREAD-SAFE. Utility method which resets or initializes the base_profile list and forward flags. Definition at line 10 of file Stub.i. References base_profiles_, TAO_MProfile::get_next(), profile_success_, TAO_MProfile::rewind(), and set_profile_in_use_i(). Referenced by base_profiles(), next_profile_i(), and reset_profiles_i().
00011 {
00012 this->base_profiles_.rewind ();
00013 this->profile_success_ = false;
00014
00015 this->set_profile_in_use_i (base_profiles_.get_next ());
00016 }
|
|
|
NOT THREAD-SAFE. Utility method which pops all forward profile lists and resets the forward_profiles_ pointer. Definition at line 26 of file Stub.i. References forward_back_one(), and forward_profiles_. Referenced by add_forward_profiles(), base_profiles(), and reset_profiles_i().
00027 {
00028 while (this->forward_profiles_ != 0)
00029 this->forward_back_one ();
00030 }
|
|
|
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 40 of file Stub.i. References ACE_GUARD, and reset_profiles_i(). Referenced by TAO::Remote_Invocation::send_message(), and ~TAO_Stub().
00041 {
00042 ACE_MT (ACE_GUARD (ACE_Lock,
00043 guard,
00044 *this->profile_lock_ptr_));
00045 this->reset_profiles_i ();
00046 }
|
|
|
NON-THREAD SAFE version of reset_profiles (void);.
Definition at line 33 of file Stub.i. References reset_base(), and reset_forward(). Referenced by next_profile_retry(), and reset_profiles().
00034 {
00035 this->reset_forward ();
00036 this->reset_base ();
00037 }
|
|
|
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 280 of file Stub.i. References CORBA::ORB::_duplicate(), CORBA::ORB_ptr, and servant_orb_. Referenced by set_policy_overrides().
00281 {
00282 this->servant_orb_ = CORBA::ORB::_duplicate (orb);
00283 }
|
|
|
This returns a duplicated ORB pointer.
Definition at line 273 of file Stub.i. References CORBA::ORB::_duplicate(). Referenced by TAO::Collocated_Invocation::invoke().
00274 {
00275 // Simply pass back the ORB pointer for temporary use.
00276 return CORBA::ORB::_duplicate (this->servant_orb_.in ());
00277 }
|
|
|
This returns the ORB var itself (generally for temporary use).
Definition at line 266 of file Stub.i. References servant_orb_. Referenced by TAO_ORB_Core::collocation_strategy(), and TAO::Narrow_Utils< T >::unchecked_narrow().
00267 {
00268 // Simply pass back the ORB pointer for temporary use.
00269 return this->servant_orb_;
00270 }
|
|
||||||||||||
|
Definition at line 540 of file Stub.cpp. References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, base_profiles_, policies_, ACE_Auto_Basic_Ptr< X >::release(), servant_orb(), and TAO_POLICY_OBJECT_SCOPE. Referenced by CORBA::Object::_set_policy_overrides().
00543 {
00544 // Notice the use of an explicit constructor....
00545 auto_ptr<TAO_Policy_Set> policy_manager (
00546 new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE));
00547
00548 if (set_add == CORBA::SET_OVERRIDE)
00549 {
00550 policy_manager->set_policy_overrides (policies,
00551 set_add
00552 ACE_ENV_ARG_PARAMETER);
00553 ACE_CHECK_RETURN (0);
00554 }
00555 else if (this->policies_ == 0)
00556 {
00557 policy_manager->set_policy_overrides (policies,
00558 CORBA::SET_OVERRIDE
00559 ACE_ENV_ARG_PARAMETER);
00560 ACE_CHECK_RETURN (0);
00561 }
00562 else
00563 {
00564 policy_manager->copy_from (this->policies_
00565 ACE_ENV_ARG_PARAMETER);
00566 ACE_CHECK_RETURN (0);
00567
00568 policy_manager->set_policy_overrides (policies,
00569 set_add
00570 ACE_ENV_ARG_PARAMETER);
00571 ACE_CHECK_RETURN (0);
00572 }
00573
00574 TAO_Stub* stub = this->orb_core_->create_stub (this->type_id.in (),
00575 this->base_profiles_
00576 ACE_ENV_ARG_PARAMETER);
00577 ACE_CHECK_RETURN (0);
00578
00579 stub->policies_ = policy_manager.release ();
00580
00581 // Copy the servant ORB if it is present.
00582 stub->servant_orb (this->servant_orb_var ().in ());
00583
00584 return stub;
00585 }
|
|
|
Makes a copy of the profile and frees the existing profile_in_use. NOT THREAD SAFE Definition at line 364 of file Stub.cpp. References TAO_Profile::_decr_refcnt(), TAO_Profile::_incr_refcnt(), ACE_ERROR_RETURN, ACE_TEXT, LM_ERROR, and profile_in_use_. Referenced by next_profile_i(), and reset_base().
00365 {
00366 TAO_Profile *const old = this->profile_in_use_;
00367
00368 // Since we are actively using this profile we dont want
00369 // it to disappear, so increase the reference count by one!!
00370 if (pfile && (pfile->_incr_refcnt () == 0))
00371 {
00372 ACE_ERROR_RETURN ((LM_ERROR,
00373 ACE_TEXT ("(%P|%t) unable to increment profile ref!\n")),
00374 0);
00375 }
00376
00377 this->profile_in_use_ = pfile;
00378
00379 if (old)
00380 old->_decr_refcnt ();
00381
00382 return this->profile_in_use_;
00383 }
|
|
|
NON-THREAD-SAFE. Will set profile_success_ to 0.
Definition at line 160 of file Stub.i. References profile_success_. Referenced by TAO::Remote_Invocation::send_message().
00161 {
00162 this->profile_success_ = true;
00163 }
|
|
|
Return the queueing strategy to be used in by the transport. Selection will be based on the SyncScope policies. Definition at line 601 of file Stub.cpp. References Messaging::SyncScope. Referenced by TAO_Transport::check_buffering_constraints_i(), and TAO_Transport::send_asynchronous_message_i().
00602 {
00603 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00604
00605 bool has_synchronization;
00606 Messaging::SyncScope scope;
00607
00608 this->orb_core_->call_sync_scope_hook (this,
00609 has_synchronization,
00610 scope);
00611
00612 if (has_synchronization == true)
00613 return this->orb_core_->get_transport_queueing_strategy (this,
00614 scope);
00615
00616 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
00617
00618 return this->orb_core_->default_transport_queueing_strategy ();
00619 }
|
|
|
Returns 1 if a forward profile has successfully been used. profile_success_ && forward_profiles_ Definition at line 154 of file Stub.i. References forward_profiles_, and profile_success_.
00155 {
00156 return (this->profile_success_ && this->forward_profiles_);
00157 }
|
|
|
Returns TRUE if a connection was successful with at least one profile. Definition at line 166 of file Stub.i. References profile_success_.
00167 {
00168 return this->profile_success_;
00169 }
|
|
|
Ordered list of profiles for this object.
Definition at line 367 of file Stub.h. Referenced by add_forward_profiles(), base_profiles(), create_ior_info(), forward_back_one(), hash(), make_profiles(), marshal(), next_profile_i(), object_key(), reset_base(), and set_policy_overrides(). |
|
|
Servant pointer. It is 0 except for collocated objects.
Definition at line 355 of file Stub.h. Referenced by collocated_servant(). |
|
|
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. Definition at line 413 of file Stub.h. Referenced by optimize_collocation_objects(). |
|
|
The list of forwarding profiles. This is actually implemented as a linked list of TAO_MProfile objects. Definition at line 371 of file Stub.h. Referenced by add_forward_profiles(), create_ior_info(), forward_back_one(), forward_profiles(), next_forward_profile(), next_profile_i(), next_profile_retry(), object_key(), reset_forward(), valid_forward_profile(), and ~TAO_Stub(). |
|
|
Definition at line 375 of file Stub.h. Referenced by add_forward_profiles(), marshal(), next_forward_profile(), and next_profile_i(). |
|
|
Forwarded IOR info.
Definition at line 404 of file Stub.h. Referenced by create_ior_info(), and ~TAO_Stub(). |
|
|
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 Definition at line 401 of file Stub.h. Referenced by create_ior_info(), and ~TAO_Stub(). |
|
|
Flag that indicates that this stub is collocated (and that it belongs to an ORB for which collocation optimisation is active). Definition at line 343 of file Stub.h. Referenced by is_collocated(). |
|
|
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. Definition at line 363 of file Stub.h. Referenced by is_collocated(), and object_proxy_broker(). |
|
|
|
|
|
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! |
|
|
The policy overrides in this object, if nil then use the default policies. Definition at line 391 of file Stub.h. Referenced by get_cached_policy(), get_policy(), get_policy_overrides(), set_policy_overrides(), and ~TAO_Stub(). |
|
|
This is the profile that we are currently sending/receiving with.
Definition at line 378 of file Stub.h. Referenced by add_forward_profiles(), base_profiles(), create_ior_info(), is_equivalent(), object_key(), profile_in_use(), set_profile_in_use_i(), and ~TAO_Stub(). |
|
|
Mutex to protect access to the forwarding profile.
Definition at line 381 of file Stub.h. Referenced by profile_lock(), TAO_Stub(), and ~TAO_Stub(). |
|
|
Have we successfully talked to the forward profile yet?
Definition at line 384 of file Stub.h. Referenced by add_forward_profiles(), next_profile_i(), next_profile_retry(), reset_base(), set_valid_profile(), valid_forward_profile(), and valid_profile(). |
|
|
Reference counter.
|
|
|
If this stub refers to a collocated object then we need to hold on to the servant's ORB (which may be different from the client ORB) so that, 1. we know that the ORB will stay alive long enough, and, 2. we can search for the servant/POA's status starting from the ORB's RootPOA. Definition at line 352 of file Stub.h. Referenced by servant_orb(), and servant_orb_var(). |
|
|
All objref representations carry around a type ID.
Definition at line 100 of file Stub.h. Referenced by CORBA::Object::_is_a(). |
1.3.6