Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Stub Class Reference

TAO_Stub. More...

#include <Stub.h>

Collaboration diagram for TAO_Stub:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual CORBA::Policy_ptr get_policy (CORBA::PolicyType type ACE_ENV_ARG_DECL_WITH_DEFAULTS)
virtual CORBA::Policy_ptr get_client_policy (CORBA::PolicyType type ACE_ENV_ARG_DECL_WITH_DEFAULTS)
virtual TAO_Stub * set_policy_overrides (const CORBA::PolicyList &policies, CORBA::SetOverrideType set_add ACE_ENV_ARG_DECL_WITH_DEFAULTS)
virtual CORBA::PolicyListget_policy_overrides (const CORBA::PolicyTypeSeq &types ACE_ENV_ARG_DECL_WITH_DEFAULTS)
CORBA::Boolean validate_connection (CORBA::PolicyList_out inconsistent_policies ACE_ENV_ARG_DECL_WITH_DEFAULTS)
CORBA::Policy_ptr relative_roundtrip_timeout (void)
CORBA::Policy_ptr sync_scope (void)
CORBA::Policy_ptr buffering_constraint (void)
CORBA::Policy_ptr connection_timeout (void)
TAO_Sync_Strategysync_strategy (void)
 Return the sync strategy to be used in by the transport. Selection will be based on the SyncScope policies. More...

CORBA::ULong hash (CORBA::ULong maximum ACE_ENV_ARG_DECL_WITH_DEFAULTS)
CORBA::Boolean is_equivalent (CORBA::Object_ptr other_obj)
 Implement the is_equivalent() method for the CORBA::Object. More...

 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. More...

CORBA::ULong _incr_refcnt (void)
CORBA::ULong _decr_refcnt (void)
ACE_Lockprofile_lock (void) const
 Return the Profile lock. This lock can be used at places where profiles need to be edited. More...

TAO_Profileprofile_in_use (void)
 returns a pointer to the profile_in_use object. This object retains ownership of this profile. More...

TAO_MProfilemake_profiles (void)
const TAO_MProfilebase_profiles (void) const
 Obtain a reference to the basic profile set. More...

TAO_MProfilebase_profiles (void)
 Obtain a reference to the basic profile set. More...

const TAO_MProfileforward_profiles (void) const
 Obtain a pointer to the forwarded profile set. More...

TAO_Profilenext_profile (void)
TAO_Profilenext_profile_i (void)
 NON-THREAD SAFE version of next_profile (void). More...

void reset_profiles (void)
void reset_profiles_i (void)
 NON-THREAD SAFE version of reset_profiles (void);. More...

CORBA::Boolean valid_forward_profile (void)
 Returns 1 if a forward profile has successfully been used. profile_success_ && forward_profiles_. More...

void set_valid_profile (void)
 NON-THREAD-SAFE. Will set profile_success_ to 0. More...

CORBA::Boolean valid_profile (void)
 Returns TRUE if a connection was successful with at least one profile. More...

TAO_Profilebase_profiles (const TAO_MProfile &mprofiles)
 Initialize the base_profiles_ and set profile_in_use_ to reference the first profile. More...

void add_forward_profiles (const TAO_MProfile &mprofiles)
CORBA::Boolean next_profile_retry (void)
TAO_ORB_Coreorb_core (void) const
 Accessor. More...

CORBA::ORB_ptr servant_orb_ptr (void)
 This returns a duplicated ORB pointer. More...

CORBA::ORB_varservant_orb_var (void)
 This returns the ORB var itself (generally for temporary use). More...

void servant_orb (CORBA::ORB_ptr orb)
CORBA::Boolean service_profile_selection (void)
 Make a call on to services to see whether they have some preferences on selecting the right profiles. More...

int create_ior_info (IOP::IOR *&ior_info, CORBA::ULong &index ACE_ENV_ARG_DECL) throw (CORBA::SystemException)
TAO_SYNCH_MUTEX & refcount_lock (void)
 Return a reference to the reference count lock. More...

CORBA::ULongrefcount (void)
 Return number of outstanding references to this object. More...

void destroy (void)
 Deallocate the TAO_Stub object. More...


Public Attributes

CORBA::String_var type_id
 All objref representations carry around a type ID. More...


Protected Methods

virtual ~TAO_Stub (void)
 Destructor is to be called only through _decr_refcnt() to enforce proper reference counting. More...

 TAO_Stub (const TAO_Stub &)
TAO_Stub & operator= (const TAO_Stub &)

Protected Attributes

TAO_ORB_Core_Auto_Ptr orb_core_
 Automatically manage the ORB_Core reference count. More...

CORBA::ORB_var orb_
 ORB required for reference counting. This will help us keep the ORB around until the CORBA::Object we represent dies. More...

CORBA::ORB_var servant_orb_
TAO_MProfile base_profiles_
 Ordered list of profiles for this object. More...

TAO_MProfileforward_profiles_
 The list of forwarding profiles. This is actually implemented as a linked list of TAO_MProfile objects. More...

TAO_Profileprofile_in_use_
 This is the profile that we are currently sending/receiving with. More...

ACE_Lockprofile_lock_ptr_
 Mutex to protect access to the forwarding profile. More...

size_t profile_success_
 Have we successfully talked to the forward profile yet? More...

TAO_SYNCH_MUTEX refcount_lock_
 Mutex to protect reference count. More...

CORBA::ULong refcount_
 Number of outstanding references to this object. More...

TAO_Policy_Setpolicies_
 The policy overrides in this object, if nil then use the default policies. More...

IOP::IORior_info_
IOP::IORforwarded_ior_info_
 Forwarded IOR info. More...


Private Methods

TAO_Profileset_profile_in_use_i (TAO_Profile *pfile)
 Makes a copy of the profile and frees the existing profile_in_use. NOT THREAD SAFE. More...

void reset_base ()
 NON-THREAD-SAFE. Utility method which resets or initializes the base_profile list and forward flags. More...

void forward_back_one (void)
 NON-THREAD-SAFE. Utility method which unrolls (removes or pops) the top most forwarding profile list. More...

void reset_forward ()
 NOT THREAD-SAFE. Utility method which pops all forward profile lists and resets the forward_profiles_ pointer. More...

TAO_Profilenext_forward_profile (void)
 NON-THREAD-SAFE. utility method for next_profile. More...

int get_profile_ior_info (TAO_MProfile &profile, IOP::IOR *&ior_info ACE_ENV_ARG_DECL) throw (CORBA::SystemException)
 THREAD-SAFE Create the IOR info. More...


Detailed Description

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 85 of file Stub.h.


Constructor & Destructor Documentation

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.

Definition at line 35 of file Stub.cpp.

References ACE_DEBUG, ACE_TEXT, base_profiles, base_profiles_, TAO_ORB_Core_Auto_Ptr::get, TAO_MProfile::get_profile, LM_DEBUG, orb_, orb_core_, TAO_MProfile::profile_count, profile_lock_ptr_, TAO_ORB_Core_Auto_Ptr::reset, TAO_HAS_CORBA_MESSAGING, TAO_ORB_Core_instance, TAO_Profile::the_stub, and CORBA::ULong.

00038   : type_id (repository_id),
00039     orb_core_ (orb_core),
00040     orb_ (),
00041     servant_orb_ (),
00042     base_profiles_ ((CORBA::ULong) 0),
00043     forward_profiles_ (0),
00044     profile_in_use_ (0),
00045     profile_lock_ptr_ (0),
00046     profile_success_ (0),
00047     refcount_lock_ (),
00048     refcount_ (1),
00049 #if (TAO_HAS_CORBA_MESSAGING == 1)
00050     policies_ (0),
00051 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00052     ior_info_ (0),
00053     forwarded_ior_info_ (0)
00054 {
00055   if (this->orb_core_.get() == 0)
00056     {
00057       if (TAO_debug_level > 0)
00058         {
00059           ACE_DEBUG ((LM_DEBUG,
00060                       ACE_TEXT ("TAO: (%P|%t) TAO_Stub created with default ")
00061                       ACE_TEXT ("ORB core\n")));
00062         }
00063       this->orb_core_.reset (TAO_ORB_Core_instance ());
00064     }
00065 
00066   // Duplicate the ORB_Core, otherwise the allocators and other
00067   // resources that this class references (directly or indirectly)
00068   // could be destroyed before it is time.
00069   (void) this->orb_core_->_incr_refcnt ();
00070 
00071   // Cache the ORB pointer to respond faster to certain queries.
00072   this->orb_ = CORBA::ORB::_duplicate (this->orb_core_->orb ());
00073 
00074   this->profile_lock_ptr_ =
00075     this->orb_core_->client_factory ()->create_profile_lock ();
00076 
00077   this->base_profiles (profiles);
00078   TAO_Profile *profile = 0;
00079   for (CORBA::ULong i = 0; i < this->base_profiles_.profile_count (); ++i)
00080     {
00081       // Get the ith profile
00082       profile = this->base_profiles_.get_profile (i);
00083       profile->the_stub (this);
00084     }
00085 }

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.

References TAO_Profile::_decr_refcnt, ACE_ASSERT, TAO_Profile::endpoint, forward_profiles_, forwarded_ior_info_, ior_info_, orb_, policies_, profile_in_use_, profile_lock_ptr_, TAO_Endpoint::reset_hint, and reset_profiles.

00088 {
00089   ACE_ASSERT (this->refcount_ == 0);
00090 
00091   if (this->forward_profiles_)
00092     reset_profiles ();
00093 
00094   if (this->profile_in_use_ != 0)
00095     {
00096       if (this->orb_->orb_core () != 0)
00097         {
00098           // The hint in the profile is a hint for a client connection
00099           // handler.  If the ORB core doesn't exist, perhaps due to
00100           // it being destroy()ed, then no connectors exist so do not
00101           // reset the hint in case it points to non-existent
00102           // connection handler.
00103           TAO_Endpoint* ep = this->profile_in_use_->endpoint ();
00104           if (ep)
00105             ep->reset_hint ();
00106         }
00107 
00108       // decrease reference count on profile
00109       this->profile_in_use_->_decr_refcnt ();
00110       this->profile_in_use_ = 0;
00111     }
00112 
00113   delete this->profile_lock_ptr_;
00114 
00115 #if (TAO_HAS_CORBA_MESSAGING == 1)
00116 
00117   delete this->policies_;
00118 
00119 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00120 
00121   if (this->ior_info_)
00122     delete this->ior_info_;
00123 
00124   if (this->forwarded_ior_info_)
00125     delete this->forwarded_ior_info_;
00126 }

TAO_Stub::TAO_Stub const TAO_Stub &    [protected]
 


Member Function Documentation

CORBA::ULong TAO_Stub::_decr_refcnt void   
 

Definition at line 321 of file Stub.cpp.

References ACE_GUARD_RETURN, refcount_, and TAO_SYNCH_MUTEX.

Referenced by TAO_Stub_Auto_Ptr::reset, CORBA_AbstractBase::~CORBA_AbstractBase, CORBA_Object::~CORBA_Object, and TAO_Stub_Auto_Ptr::~TAO_Stub_Auto_Ptr.

00322 {
00323   {
00324     ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
00325                       mon,
00326                       this->refcount_lock_,
00327                       0);
00328 
00329     this->refcount_--;
00330     if (this->refcount_ != 0)
00331       return this->refcount_;
00332   }
00333 
00334   delete this;
00335   return 0;
00336 }

CORBA::ULong TAO_Stub::_incr_refcnt void   
 

Definition at line 310 of file Stub.cpp.

References ACE_GUARD_RETURN, refcount_, and TAO_SYNCH_MUTEX.

Referenced by CORBA_AbstractBase::_to_object, CORBA::Policy::_unchecked_narrow, CORBA::ConstructionPolicy::_unchecked_narrow, CORBA::DomainManager::_unchecked_narrow, and CORBA_AbstractBase::CORBA_AbstractBase.

00311 {
00312   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
00313                     guard,
00314                     this->refcount_lock_,
00315                     0);
00316 
00317   return this->refcount_++;
00318 }

void TAO_Stub::add_forward_profiles const TAO_MProfile   mprofiles
 

THREAD SAFE. Set the forward_profiles. This object will assume ownership of this TAO_MProfile object!!

Definition at line 129 of file Stub.cpp.

References ACE_GUARD, ACE_MT, ACE_NEW, base_profiles_, TAO_MProfile::forward_from, forward_profiles_, TAO_Profile::forward_to, orb_core_, profile_in_use_, profile_success_, and TAO_MProfile::rewind.

Referenced by TAO_Default_Endpoint_Selector::forward.

00130 {
00131   // we assume that the profile_in_use_ is being
00132   // forwarded!  Grab the lock so things don't change.
00133   ACE_MT (ACE_GUARD (ACE_Lock,
00134                      guard,
00135                      *this->profile_lock_ptr_));
00136 
00137   TAO_MProfile *now_pfiles = this->forward_profiles_;
00138   if (now_pfiles == 0)
00139     now_pfiles = &this->base_profiles_;
00140 
00141   ACE_NEW (this->forward_profiles_,
00142            TAO_MProfile (mprofiles));
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 0
00154   // since we are starting a new with a new set of profiles!
00155   this->profile_success_ = 0;
00156 
00157   // Reset any flags that may be appropriate in the services that
00158   // selects profiles for invocation
00159   this->orb_core_->reset_service_profile_flags ();
00160 }

ACE_INLINE 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 146 of file Stub.i.

References ACE_GUARD_RETURN, ACE_MT, base_profiles_, profile_in_use_, reset_base, reset_forward, and TAO_MProfile::set.

00147 {
00148   ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00149                             guard,
00150                             *this->profile_lock_ptr_,
00151                             0));
00152 
00153   // first reset things so we start from scratch!
00154   this->reset_forward ();
00155   this->base_profiles_.set (mprofiles);
00156   this->reset_base ();
00157   return this->profile_in_use_;
00158 
00159 }

ACE_INLINE TAO_MProfile & TAO_Stub::base_profiles void   
 

Obtain a reference to the basic profile set.

Definition at line 207 of file Stub.i.

References base_profiles_.

00208 {
00209   return this->base_profiles_;
00210 }

ACE_INLINE const TAO_MProfile & TAO_Stub::base_profiles void    const
 

Obtain a reference to the basic profile set.

Definition at line 201 of file Stub.i.

References base_profiles_.

Referenced by TAO_ORB_Core::create_object, TAO_ORB_Core::create_stub_object, operator<<, TAO_Profile::policies, and TAO_Stub.

00202 {
00203   return this->base_profiles_;
00204 }

CORBA::Policy_ptr TAO_Stub::buffering_constraint void   
 

Definition at line 767 of file Stub.cpp.

References CORBA::Policy_var::_retn, TAO_Policy_Manager::get_cached_policy, TAO_Policy_Current::get_cached_policy, TAO_Policy_Set::get_cached_policy, CORBA::Policy_var::in, CORBA::is_nil, orb_core_, policies_, and TAO_CACHED_POLICY_BUFFERING_CONSTRAINT.

Referenced by TAO_Eager_Buffering_Sync_Strategy::buffering_constraints_reached.

00768 {
00769   CORBA::Policy_var p;
00770 
00771   // No need to lock, the stub only changes its policies at
00772   // construction time...
00773 
00774   if (this->policies_ != 0)
00775     {
00776       p =
00777         this->policies_->get_cached_policy (
00778           TAO_CACHED_POLICY_BUFFERING_CONSTRAINT);
00779     }
00780 
00781   // No need to lock, the object is in TSS storage....
00782   if (CORBA::is_nil (p.in ()))
00783     {
00784       TAO_Policy_Current &policy_current =
00785         this->orb_core_->policy_current ();
00786 
00787       p =
00788         policy_current.get_cached_policy (
00789           TAO_CACHED_POLICY_BUFFERING_CONSTRAINT);
00790     }
00791 
00792   // @@ Must lock, but is is harder to implement than just modifying
00793   //    this call: the ORB does take a lock to modify the policy
00794   //    manager
00795   if (CORBA::is_nil (p.in ()))
00796     {
00797       TAO_Policy_Manager *policy_manager =
00798         this->orb_core_->policy_manager ();
00799       if (policy_manager != 0)
00800         {
00801           p =
00802             policy_manager->get_cached_policy (
00803               TAO_CACHED_POLICY_BUFFERING_CONSTRAINT);
00804         }
00805     }
00806 
00807   if (CORBA::is_nil (p.in ()))
00808     p = this->orb_core_->default_buffering_constraint ();
00809 
00810   return p._retn ();
00811 }

CORBA::Policy_ptr TAO_Stub::connection_timeout void   
 

Definition at line 723 of file Stub.cpp.

References CORBA::Policy_var::_retn, TAO_Policy_Manager::get_cached_policy, TAO_Policy_Current::get_cached_policy, TAO_Policy_Set::get_cached_policy, CORBA::Policy_var::in, CORBA::is_nil, orb_core_, policies_, and TAO_CACHED_POLICY_CONNECTION_TIMEOUT.

00724 {
00725   CORBA::Policy_var p;
00726 
00727   // No need to lock, the stub only changes its policies at
00728   // construction time...
00729   if (this->policies_ != 0)
00730     p = this->policies_->get_cached_policy (
00731           TAO_CACHED_POLICY_CONNECTION_TIMEOUT);
00732 
00733   // No need to lock, the object is in TSS storage....
00734   if (CORBA::is_nil (p.in ()))
00735     {
00736       TAO_Policy_Current &policy_current =
00737         this->orb_core_->policy_current ();
00738       p = policy_current.get_cached_policy (
00739             TAO_CACHED_POLICY_CONNECTION_TIMEOUT);
00740     }
00741 
00742   // @@ Must lock, but is is harder to implement than just modifying
00743   //    this call: the ORB does take a lock to modify the policy
00744   //    manager
00745   if (CORBA::is_nil (p.in ()))
00746     {
00747       TAO_Policy_Manager *policy_manager =
00748         this->orb_core_->policy_manager ();
00749       if (policy_manager != 0)
00750         p = policy_manager->get_cached_policy (
00751               TAO_CACHED_POLICY_CONNECTION_TIMEOUT);
00752     }
00753 
00754   if (CORBA::is_nil (p.in ()))
00755     p = this->orb_core_->get_default_policies ()->get_cached_policy (
00756           TAO_CACHED_POLICY_CONNECTION_TIMEOUT);
00757 
00758   return p._retn ();
00759 }

int TAO_Stub::create_ior_info IOP::IOR *&    ior_info,
CORBA::ULong &index    ACE_ENV_ARG_DECL
throw (CORBA::SystemException)
 

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 164 of file Stub.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_GUARD_RETURN, and ACE_MT.

00168 {
00169   // We are creating the IOR info. Let us not be disturbed. So grab a
00170   // lock.
00171   ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00172                             guard,
00173                             *this->profile_lock_ptr_,
00174                             -1));
00175 
00176   IOP::IOR *tmp_info = 0;
00177 
00178   if (this->forward_profiles_ != 0)
00179     {
00180       if (this->forwarded_ior_info_ == 0)
00181         {
00182           this->get_profile_ior_info (*this->forward_profiles_,
00183                                       tmp_info
00184                                        ACE_ENV_ARG_PARAMETER);
00185           ACE_CHECK_RETURN (-1);
00186 
00187           this->forwarded_ior_info_ = tmp_info;
00188         }
00189 
00190       // First we look at the forward profiles to see whether the
00191       // profile_in_use is any of it.
00192       for (CORBA::ULong i = 0;
00193            i < this->forward_profiles_->profile_count ();
00194            ++i)
00195         {
00196           if (this->forward_profiles_->get_profile (i)
00197               == this->profile_in_use_)
00198             {
00199               ior_info = this->forwarded_ior_info_;
00200               index = i;
00201               return 0;
00202             }
00203         }
00204     }
00205 
00206   // Else we look at the base profiles
00207   if (this->ior_info_ == 0)
00208     {
00209       this->get_profile_ior_info (this->base_profiles_,
00210                                   tmp_info
00211                                    ACE_ENV_ARG_PARAMETER);
00212       ACE_CHECK_RETURN (-1);
00213 
00214       this->ior_info_ = tmp_info;
00215     }
00216 
00217 
00218   for (CORBA::ULong ind = 0;
00219        ind < this->base_profiles_.profile_count ();
00220        ++ind)
00221     {
00222       if (this->base_profiles_.get_profile (ind) ==
00223           this->profile_in_use_)
00224         {
00225           index = ind;
00226           ior_info = this->ior_info_;
00227           return 0;
00228         }
00229     }
00230 
00231   // Error, there was no match
00232   return -1;
00233 }

ACE_INLINE void TAO_Stub::destroy void   
 

Deallocate the TAO_Stub object.

This method is intended to be used only by the CORBA::Object class.

Definition at line 257 of file Stub.i.

00258 {
00259   // The reference count better be zero at this point!
00260   delete this;
00261 }

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 361 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.

00362 {
00363   TAO_MProfile *from = forward_profiles_->forward_from ();
00364 
00365   delete this->forward_profiles_;
00366 
00367   // the current profile in this profile list is no
00368   // longer being forwarded, so set the reference to zero.
00369   if (from == &this->base_profiles_)
00370     {
00371       this->base_profiles_.get_current_profile ()->forward_to (0);
00372       this->forward_profiles_ = 0;
00373     }
00374   else
00375     {
00376       from->get_current_profile ()->forward_to (0);
00377       this->forward_profiles_ = from;
00378     }
00379 
00380 }

ACE_INLINE const TAO_MProfile * TAO_Stub::forward_profiles void    const
 

Obtain a pointer to the forwarded profile set.

Definition at line 213 of file Stub.i.

References forward_profiles_.

00214 {
00215   return this->forward_profiles_;
00216 }

CORBA::Policy_ptr TAO_Stub::get_client_policy CORBA::PolicyType type    ACE_ENV_ARG_DECL_WITH_DEFAULTS [virtual]
 

Definition at line 473 of file Stub.cpp.

References CORBA::Policy::_nil, CORBA::Policy_var::_retn, ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, TAO_Policy_Manager::get_policy, TAO_Policy_Current::get_policy, TAO_Policy_Set::get_policy, CORBA::Policy_var::in, CORBA::is_nil, orb_core_, and policies_.

Referenced by CORBA_Object::_get_client_policy, and get_policy.

00475 {
00476   // No need to lock, the stub only changes its policies at
00477   // construction time...
00478 
00479 
00480   CORBA::Policy_var result;
00481   if (this->policies_ != 0)
00482     {
00483       result = this->policies_->get_policy (type
00484                                             ACE_ENV_ARG_PARAMETER);
00485       ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00486     }
00487 
00488   if (CORBA::is_nil (result.in ()))
00489     {
00490       TAO_Policy_Current &policy_current = this->orb_core_->policy_current ();
00491       result = policy_current.get_policy (type
00492                                           ACE_ENV_ARG_PARAMETER);
00493       ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00494     }
00495 
00496   if (CORBA::is_nil (result.in ()))
00497     {
00498       // @@ Must lock, but is is harder to implement than just modifying
00499       //    this call: the ORB does take a lock to modify the policy
00500       //    manager
00501       TAO_Policy_Manager *policy_manager =
00502         this->orb_core_->policy_manager ();
00503       if (policy_manager != 0)
00504         {
00505           result = policy_manager->get_policy (type
00506                                                ACE_ENV_ARG_PARAMETER);
00507           ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00508         }
00509     }
00510 
00511   if (CORBA::is_nil (result.in ()))
00512     {
00513       result = this->orb_core_->
00514               get_default_policies ()->get_policy (type
00515                                                     ACE_ENV_ARG_PARAMETER);
00516       ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00517     }
00518 
00519   return result._retn ();
00520 }

CORBA::Policy_ptr TAO_Stub::get_policy CORBA::PolicyType type    ACE_ENV_ARG_DECL_WITH_DEFAULTS [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 446 of file Stub.cpp.

References CORBA::Policy::_nil, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, get_client_policy, and policies_.

Referenced by CORBA_Object::_get_policy.

00448 {
00449 
00450   if (this->policies_ == 0)
00451     return CORBA::Policy::_nil ();
00452 
00453   // Some policies can only be set locally on the client, while others
00454   // can only be exported in the IOR by the server, and yet others can
00455   // be set by both by client and server.  Furthermore, reconciliation
00456   // between client-set values and the ones exported in the IOR is
00457   // policy-specific.  Therefore, with the current state of things, it
00458   // isn't possible to write generic code for <get_policy> that will
00459   // work for any policy type.
00460   // Currently, we take specific action
00461   // for each of the known client-exposed policies (above), and simply
00462   // look up effective override for any other policy type (below).
00463   // Later, if there is a need/desire for generic code, it can be
00464   // done by pushing the smarts into the policies
00465   // implementations, and will involve modifying PolicyC* and friends,
00466   // e.g., to add methods for policy specific reconciliation, etc.
00467 
00468   return this->get_client_policy (type
00469                                   ACE_ENV_ARG_PARAMETER);
00470 }

CORBA::PolicyList * TAO_Stub::get_policy_overrides const CORBA::PolicyTypeSeq &types    ACE_ENV_ARG_DECL_WITH_DEFAULTS [virtual]
 

Definition at line 571 of file Stub.cpp.

References ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, TAO_Policy_Set::get_policy_overrides, and policies_.

Referenced by CORBA_Object::_get_policy_overrides.

00573 {
00574   if (this->policies_ == 0)
00575     return 0;
00576 
00577   return this->policies_->get_policy_overrides (types
00578                                                 ACE_ENV_ARG_PARAMETER);
00579 }

int TAO_Stub::get_profile_ior_info TAO_MProfile   profile,
IOP::IOR *&ior_info    ACE_ENV_ARG_DECL
throw (CORBA::SystemException) [private]
 

THREAD-SAFE Create the IOR info.

Definition at line 237 of file Stub.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, ACE_NEW_THROW_EX, and TAO_Profile::create_tagged_profile.

00241 {
00242 
00243 
00244   ACE_NEW_THROW_EX (ior_info,
00245                     IOP::IOR (),
00246                     CORBA::NO_MEMORY ());
00247   ACE_CHECK_RETURN (-1);
00248 
00249 
00250   // Get the number of elements
00251   CORBA::ULong count = profiles.profile_count ();
00252 
00253   // Set the number of elements in the sequence of tagged_profile
00254   ior_info->profiles.length (count);
00255 
00256   // Call the create_tagged_profile one every member of the
00257   // profile and make the sequence
00258   for (CORBA::ULong index = 0; index < count; ++index)
00259     {
00260       TAO_Profile *prof = profiles.get_profile (index);
00261 
00262       ior_info->profiles[index] = prof->create_tagged_profile ();
00263     }
00264 
00265   return 0;
00266 }

CORBA::ULong TAO_Stub::hash CORBA::ULong maximum    ACE_ENV_ARG_DECL_WITH_DEFAULTS
 

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).

Referenced by CORBA_Object::_hash.

CORBA::Boolean TAO_Stub::is_equivalent CORBA::Object_ptr    other_obj
 

Implement the is_equivalent() method for the CORBA::Object.

Definition at line 292 of file Stub.cpp.

References TAO_Profile::is_equivalent, CORBA::is_nil, and profile_in_use_.

00293 {
00294   if (CORBA::is_nil (other_obj) == 1)
00295     return 0;
00296 
00297   TAO_Profile *other_profile = other_obj->_stubobj ()->profile_in_use_;
00298   TAO_Profile *this_profile = this->profile_in_use_;
00299 
00300   if (other_profile == 0 || this_profile == 0)
00301     return 0;
00302 
00303   // Compare the profiles
00304   return this_profile->is_equivalent (other_profile);
00305 }

ACE_INLINE 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.i.

References ACE_NEW_RETURN, and base_profiles_.

00070 {
00071   TAO_MProfile *mp = 0;
00072 
00073   ACE_NEW_RETURN (mp,
00074                   TAO_MProfile (base_profiles_),
00075                   0);
00076 
00077   return mp;
00078 }

ACE_INLINE TAO_Profile * TAO_Stub::next_forward_profile void    [private]
 

NON-THREAD-SAFE. utility method for next_profile.

Definition at line 81 of file Stub.i.

References forward_back_one, forward_profiles_, and TAO_MProfile::get_next.

Referenced by next_profile_i.

00082 {
00083   TAO_Profile *pfile_next = 0;
00084 
00085   while (this->forward_profiles_
00086          && (pfile_next = this->forward_profiles_->get_next ()) == 0)
00087     // that was the last profile.  Now we clean up our forward profiles.
00088     // since we own the forward MProfiles, we must delete them when done.
00089     this->forward_back_one ();
00090 
00091   return pfile_next;
00092 }

ACE_INLINE TAO_Profile * TAO_Stub::next_profile void   
 

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 117 of file Stub.i.

References ACE_GUARD_RETURN, ACE_MT, and next_profile_i.

Referenced by TAO_Default_Endpoint_Selector::forward.

00118 {
00119 
00120   ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00121                             guard,
00122                             *this->profile_lock_ptr_,
00123                             0));
00124   return this->next_profile_i ();
00125 }

ACE_INLINE TAO_Profile * TAO_Stub::next_profile_i void   
 

NON-THREAD SAFE version of next_profile (void).

Definition at line 95 of file Stub.i.

References base_profiles_, forward_profiles_, TAO_MProfile::get_next, next_forward_profile, reset_base, and set_profile_in_use_i.

Referenced by next_profile, and next_profile_retry.

00096 {
00097 
00098   TAO_Profile *pfile_next = 0;
00099   if (this->forward_profiles_)
00100     {
00101       pfile_next = this->next_forward_profile ();
00102       if (pfile_next == 0)
00103         pfile_next = this->base_profiles_.get_next ();
00104     }
00105   else
00106     pfile_next = this->base_profiles_.get_next ();
00107 
00108   if (pfile_next == 0)
00109     this->reset_base ();
00110   else
00111     this->set_profile_in_use_i (pfile_next);
00112 
00113   return pfile_next;
00114 }

ACE_INLINE 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 162 of file Stub.i.

References ACE_GUARD_RETURN, ACE_MT, forward_profiles_, next_profile_i, orb_core_, profile_success_, and reset_profiles_i.

00163 {
00164   ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00165                             guard,
00166                             *this->profile_lock_ptr_,
00167                             0));
00168 
00169   if (this->profile_success_ && this->forward_profiles_)
00170     {
00171       this->reset_profiles_i ();
00172       return 1;
00173     }
00174   else if (this->next_profile_i ())
00175     {
00176       return 1;
00177     }
00178 
00179   return 0;
00180 #if 0
00181   else
00182     {
00183       // Check whether the loaded services have something to say about
00184       // this condition
00185       TAO_Profile *prof = 0;
00186       this->orb_core_->service_profile_reselection (this,
00187                                                     prof);
00188 
00189       // If the service is loaded and has a profile then try it.
00190       if (prof)
00191         {
00192           return 1;
00193         }
00194       this->reset_profiles_i ();
00195       return 0;
00196     }
00197 #endif /*If 0 */
00198 }

TAO_Stub& TAO_Stub::operator= const TAO_Stub &    [protected]
 

ACE_INLINE TAO_ORB_Core * TAO_Stub::orb_core void    const
 

Accessor.

Definition at line 219 of file Stub.i.

References TAO_ORB_Core_Auto_Ptr::get, and orb_core_.

Referenced by TAO_Remote_Object_Proxy_Impl::_get_component, TAO_Remote_Object_Proxy_Impl::_is_a, TAO_Remote_Object_Proxy_Impl::_non_existent, CORBA_AbstractBase::_to_object, CORBA::_TAO_Policy_Remote_Proxy_Impl::copy, CORBA::_TAO_Policy_Remote_Proxy_Impl::destroy, CORBA::_TAO_DomainManager_Remote_Proxy_Impl::get_domain_policy, CORBA::_TAO_ConstructionPolicy_Remote_Proxy_Impl::make_domain_manager, TAO_CORBANAME_Parser::parse_string_dynamic_request_helper, and CORBA::_TAO_Policy_Remote_Proxy_Impl::policy_type.

00220 {
00221   return this->orb_core_.get ();
00222 }

ACE_INLINE TAO_Profile * TAO_Stub::profile_in_use void   
 

returns a pointer to the profile_in_use object. This object retains ownership of this profile.

Definition at line 63 of file Stub.i.

References profile_in_use_.

00064 {
00065   return this->profile_in_use_;
00066 }

ACE_INLINE 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 16 of file Stub.i.

References profile_lock_ptr_.

00017 {
00018   return this->profile_lock_ptr_;
00019 }

ACE_INLINE CORBA::ULong & TAO_Stub::refcount void   
 

Return number of outstanding references to this object.

This method is meant to be used by the CORBA::Object implementation to allow it to directly manipulate the reference count.

Definition at line 251 of file Stub.i.

References refcount_.

00252 {
00253   return this->refcount_;
00254 }

ACE_INLINE TAO_SYNCH_MUTEX & TAO_Stub::refcount_lock void   
 

Return a reference to the reference count lock.

This method is meant to be used by the CORBA::Object implementation to allow it to directly manipulate the reference count.

Definition at line 245 of file Stub.i.

References refcount_lock_.

00246 {
00247   return this->refcount_lock_;
00248 }

CORBA::Policy_ptr TAO_Stub::relative_roundtrip_timeout void   
 

Definition at line 657 of file Stub.cpp.

References CORBA::Policy_var::_retn, TAO_Policy_Manager::get_cached_policy, TAO_Policy_Current::get_cached_policy, TAO_Policy_Set::get_cached_policy, CORBA::Policy_var::in, CORBA::is_nil, orb_core_, policies_, and TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT.

00658 {
00659   CORBA::Policy_var p;
00660 
00661   // No need to lock, the stub only changes its policies at
00662   // construction time...
00663   if (this->policies_ != 0)
00664     p = this->policies_->get_cached_policy (
00665           TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT);
00666 
00667   // No need to lock, the object is in TSS storage....
00668   if (CORBA::is_nil (p.in ()))
00669     {
00670       TAO_Policy_Current &policy_current =
00671         this->orb_core_->policy_current ();
00672       p = policy_current.get_cached_policy (
00673             TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT);
00674     }
00675 
00676   // @@ Must lock, but is is harder to implement than just modifying
00677   //    this call: the ORB does take a lock to modify the policy
00678   //    manager
00679   if (CORBA::is_nil (p.in ()))
00680     {
00681       TAO_Policy_Manager *policy_manager =
00682         this->orb_core_->policy_manager ();
00683       if (policy_manager != 0)
00684         p = policy_manager->get_cached_policy (
00685               TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT);
00686     }
00687 
00688   if (CORBA::is_nil (p.in ()))
00689     p = this->orb_core_->get_default_policies ()->get_cached_policy (
00690           TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT);
00691 
00692   return p._retn ();
00693 }

ACE_INLINE void TAO_Stub::reset_base   [private]
 

NON-THREAD-SAFE. Utility method which resets or initializes the base_profile list and forward flags.

Definition at line 6 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.

00007 {
00008   this->base_profiles_.rewind ();
00009   this->profile_success_ = 0;
00010 
00011   this->set_profile_in_use_i (base_profiles_.get_next ());
00012 }

ACE_INLINE void TAO_Stub::reset_forward   [private]
 

NOT THREAD-SAFE. Utility method which pops all forward profile lists and resets the forward_profiles_ pointer.

Definition at line 40 of file Stub.i.

References forward_back_one, and forward_profiles_.

Referenced by base_profiles, and reset_profiles_i.

00041 {
00042   while (this->forward_profiles_ != 0)
00043     this->forward_back_one ();
00044 }

ACE_INLINE 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.i.

References ACE_GUARD, ACE_MT, and reset_profiles_i.

Referenced by TAO_Default_Endpoint_Selector::close_connection, and ~TAO_Stub.

00055 {
00056   ACE_MT (ACE_GUARD (ACE_Lock,
00057                      guard,
00058                      *this->profile_lock_ptr_));
00059   this->reset_profiles_i ();
00060 }

ACE_INLINE void TAO_Stub::reset_profiles_i void   
 

NON-THREAD SAFE version of reset_profiles (void);.

Definition at line 47 of file Stub.i.

References reset_base, and reset_forward.

Referenced by next_profile_retry, and reset_profiles.

00048 {
00049   this->reset_forward ();
00050   this->reset_base ();
00051 }

ACE_INLINE void TAO_Stub::servant_orb CORBA::ORB_ptr    orb
 

Accesor and mutator for the servant ORB. Notice that the muatator 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 239 of file Stub.i.

References servant_orb_.

Referenced by set_policy_overrides.

00240 {
00241   this->servant_orb_ = CORBA::ORB::_duplicate (orb);
00242 }

ACE_INLINE CORBA::ORB_ptr TAO_Stub::servant_orb_ptr void   
 

This returns a duplicated ORB pointer.

Definition at line 232 of file Stub.i.

00233 {
00234   // Simply pass back the ORB pointer for temporary use.
00235   return CORBA::ORB::_duplicate (this->servant_orb_.in ());
00236 }

ACE_INLINE CORBA::ORB_var & TAO_Stub::servant_orb_var void   
 

This returns the ORB var itself (generally for temporary use).

Definition at line 225 of file Stub.i.

References servant_orb_.

Referenced by CORBA::Policy::_unchecked_narrow, CORBA::ConstructionPolicy::_unchecked_narrow, CORBA::DomainManager::_unchecked_narrow, TAO_ORB_Core::collocation_strategy, and operator>>.

00226 {
00227   // Simply pass back the ORB pointer for temporary use.
00228   return this->servant_orb_;
00229 }

ACE_INLINE CORBA::Boolean TAO_Stub::service_profile_selection void   
 

Make a call on to services to see whether they have some preferences on selecting the right profiles.

Definition at line 22 of file Stub.i.

References orb_core_, and set_profile_in_use_i.

00023 {
00024   // @@todo: This method is depreacted. Needs to be removed after
00025   // 1.2.1 goes out.
00026   TAO_Profile *profile = 0;
00027 
00028   this->orb_core_->service_profile_selection (this->base_profiles_,
00029                                               profile);
00030   if (profile)
00031     {
00032       this->set_profile_in_use_i (profile);
00033       return 1;
00034     }
00035 
00036   return 0;
00037 }

TAO_Stub * TAO_Stub::set_policy_overrides const CORBA::PolicyList   policies,
CORBA::SetOverrideType set_add    ACE_ENV_ARG_DECL_WITH_DEFAULTS
[virtual]
 

Definition at line 523 of file Stub.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, base_profiles_, orb_core_, policies_, servant_orb, and TAO_POLICY_OBJECT_SCOPE.

Referenced by CORBA_Object::_set_policy_overrides.

00526 {
00527   // Notice the use of an explicit constructor....
00528   auto_ptr<TAO_Policy_Set> policy_manager (
00529     new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE));
00530 
00531   if (set_add == CORBA::SET_OVERRIDE)
00532     {
00533       policy_manager->set_policy_overrides (policies,
00534                                             set_add
00535                                              ACE_ENV_ARG_PARAMETER);
00536       ACE_CHECK_RETURN (0);
00537     }
00538   else if (this->policies_ == 0)
00539     {
00540       policy_manager->set_policy_overrides (policies,
00541                                             CORBA::SET_OVERRIDE
00542                                              ACE_ENV_ARG_PARAMETER);
00543       ACE_CHECK_RETURN (0);
00544     }
00545   else
00546     {
00547       policy_manager->copy_from (this->policies_
00548                                   ACE_ENV_ARG_PARAMETER);
00549       ACE_CHECK_RETURN (0);
00550 
00551       policy_manager->set_policy_overrides (policies,
00552                                             set_add
00553                                              ACE_ENV_ARG_PARAMETER);
00554       ACE_CHECK_RETURN (0);
00555     }
00556 
00557   TAO_Stub* stub = this->orb_core_->create_stub (this->type_id.in (),
00558                                                  this->base_profiles_
00559                                                   ACE_ENV_ARG_PARAMETER);
00560   ACE_CHECK_RETURN (0);
00561 
00562   stub->policies_ = policy_manager.release ();
00563 
00564   // Copy the servant ORB if it is present.
00565   stub->servant_orb (this->servant_orb_var ().in ());
00566 
00567   return stub;
00568 }

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 339 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, reset_base, and service_profile_selection.

00340 {
00341   TAO_Profile *old = this->profile_in_use_;
00342 
00343   // Since we are actively using this profile we dont want
00344   // it to disappear, so increase the reference count by one!!
00345   if (pfile && (pfile->_incr_refcnt () == 0))
00346     {
00347       ACE_ERROR_RETURN ((LM_ERROR,
00348                         ACE_TEXT ("(%P|%t) unable to increment profile ref!\n")),
00349                         0);
00350     }
00351 
00352   this->profile_in_use_ = pfile;
00353 
00354   if (old)
00355     old->_decr_refcnt ();
00356 
00357   return this->profile_in_use_;
00358 }

ACE_INLINE void TAO_Stub::set_valid_profile void   
 

NON-THREAD-SAFE. Will set profile_success_ to 0.

Definition at line 134 of file Stub.i.

References profile_success_.

Referenced by TAO_Default_Endpoint_Selector::success.

00135 {
00136   this->profile_success_ = 1;
00137 }

CORBA::Policy_ptr TAO_Stub::sync_scope void   
 

Definition at line 701 of file Stub.cpp.

References CORBA::Policy_var::_retn, TAO_Policy_Set::get_cached_policy, CORBA::Policy_var::in, CORBA::is_nil, orb_core_, policies_, and TAO_CACHED_POLICY_SYNC_SCOPE.

00702 {
00703   CORBA::Policy_var p;
00704 
00705   // No need to lock, the stub only changes its policies at
00706   // construction time...
00707   if (this->policies_ != 0)
00708     p = this->policies_->get_cached_policy (TAO_CACHED_POLICY_SYNC_SCOPE);
00709 
00710   // If there are no cached policies, look at the thread or ORB level
00711   // for the policy.
00712   if (CORBA::is_nil (p.in ()))
00713     p = this->orb_core_->stubless_sync_scope ();
00714 
00715   return p._retn ();
00716 }

TAO_Sync_Strategy & TAO_Stub::sync_strategy void   
 

Return the sync strategy to be used in by the transport. Selection will be based on the SyncScope policies.

Definition at line 634 of file Stub.cpp.

References orb_core_.

Referenced by TAO_Transport::check_buffering_constraints_i, and TAO_Transport::send_message_shared_i.

00635 {
00636 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00637 
00638   int has_synchronization;
00639   Messaging::SyncScope scope;
00640 
00641   this->orb_core_->call_sync_scope_hook (this,
00642                                          has_synchronization,
00643                                          scope);
00644 
00645   if (has_synchronization == 1)
00646     return this->orb_core_->get_sync_strategy (this,
00647                                                scope);
00648 
00649 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
00650 
00651   return this->orb_core_->transport_sync_strategy ();
00652 }

ACE_INLINE CORBA::Boolean TAO_Stub::valid_forward_profile void   
 

Returns 1 if a forward profile has successfully been used. profile_success_ && forward_profiles_.

Definition at line 128 of file Stub.i.

References forward_profiles_, and profile_success_.

00129 {
00130   return (this->profile_success_ && this->forward_profiles_);
00131 }

ACE_INLINE CORBA::Boolean TAO_Stub::valid_profile void   
 

Returns TRUE if a connection was successful with at least one profile.

Definition at line 140 of file Stub.i.

References profile_success_.

00141 {
00142   return (CORBA::Boolean) this->profile_success_;
00143 }

CORBA::Boolean TAO_Stub::validate_connection CORBA::PolicyList_out inconsistent_policies    ACE_ENV_ARG_DECL_WITH_DEFAULTS
 

Definition at line 582 of file Stub.cpp.

References ACE_CATCH, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_ARG_DECL, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, ACE_TRY_THROW, TAO_GIOP_Invocation::get_inconsistent_policies, TAO_GIOP_Invocation::init_inconsistent_policies, TAO_GIOP_Locate_Request_Invocation::invoke, TAO_GIOP_Locate_Request_Invocation::start, TAO_DEFAULT_MINOR_CODE, TAO_INVOKE_OK, and TAO_INVOKE_RESTART.

Referenced by CORBA_Object::_validate_connection.

00584 {
00585   // Use Locate Request to establish connection/make sure the object
00586   // is there ...
00587   TAO_GIOP_Locate_Request_Invocation locate_request (this,
00588                                                      this->orb_core_.get ());
00589 
00590   locate_request.init_inconsistent_policies (ACE_ENV_SINGLE_ARG_PARAMETER);
00591   ACE_CHECK_RETURN (0);
00592 
00593   // @@ For some combinations of RTCORBA policies, location forwarding
00594   // isn't supported.  See <forward> method implementations in
00595   // Invocation_Endpoint_Selectors.cpp for more information.
00596   //
00597   ACE_TRY
00598     {
00599       for (;;)
00600         {
00601           locate_request.start (ACE_ENV_SINGLE_ARG_PARAMETER);
00602           ACE_TRY_CHECK;
00603 
00604           int status = locate_request.invoke (ACE_ENV_SINGLE_ARG_PARAMETER);
00605           ACE_TRY_CHECK;
00606 
00607           // We'll get this only if the object was, in fact, forwarded.
00608           if (status == TAO_INVOKE_RESTART)
00609               continue;
00610 
00611           if (status != TAO_INVOKE_OK)
00612             {
00613               ACE_TRY_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE,
00614                                              CORBA::COMPLETED_YES));
00615             }
00616           break;
00617         }
00618     }
00619   ACE_CATCH (CORBA::INV_POLICY, ex)
00620     {
00621       inconsistent_policies =
00622         locate_request.get_inconsistent_policies ();
00623       return 0;
00624     }
00625   ACE_ENDTRY;
00626   ACE_CHECK_RETURN (0);
00627 
00628   return 1;
00629 }


Member Data Documentation

TAO_MProfile TAO_Stub::base_profiles_ [protected]
 

Ordered list of profiles for this object.

Definition at line 378 of file Stub.h.

Referenced by add_forward_profiles, base_profiles, forward_back_one, make_profiles, next_profile_i, reset_base, set_policy_overrides, and TAO_Stub.

TAO_MProfile* TAO_Stub::forward_profiles_ [protected]
 

The list of forwarding profiles. This is actually implemented as a linked list of TAO_MProfile objects.

Definition at line 382 of file Stub.h.

Referenced by add_forward_profiles, forward_back_one, forward_profiles, next_forward_profile, next_profile_i, next_profile_retry, reset_forward, valid_forward_profile, and ~TAO_Stub.

IOP::IOR* TAO_Stub::forwarded_ior_info_ [protected]
 

Forwarded IOR info.

Definition at line 414 of file Stub.h.

Referenced by ~TAO_Stub.

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

Definition at line 411 of file Stub.h.

Referenced by ~TAO_Stub.

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.

Todo:
Why do we need both a reference to the ORB_Core and its ORB? It think the memory management rules for the ORB_Core changed, in the good old days it was the CORBA::ORB class who owned the ORB_Core, now it is the other way around....

Definition at line 366 of file Stub.h.

Referenced by TAO_Stub, and ~TAO_Stub.

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!

Definition at line 356 of file Stub.h.

Referenced by add_forward_profiles, buffering_constraint, connection_timeout, get_client_policy, next_profile_retry, orb_core, relative_roundtrip_timeout, service_profile_selection, set_policy_overrides, sync_scope, sync_strategy, and TAO_Stub.

TAO_Policy_Set* TAO_Stub::policies_ [protected]
 

The policy overrides in this object, if nil then use the default policies.

Definition at line 401 of file Stub.h.

Referenced by buffering_constraint, connection_timeout, get_client_policy, get_policy, get_policy_overrides, relative_roundtrip_timeout, set_policy_overrides, sync_scope, and ~TAO_Stub.

TAO_Profile* TAO_Stub::profile_in_use_ [protected]
 

This is the profile that we are currently sending/receiving with.

Definition at line 385 of file Stub.h.

Referenced by add_forward_profiles, base_profiles, is_equivalent, profile_in_use, set_profile_in_use_i, and ~TAO_Stub.

ACE_Lock* TAO_Stub::profile_lock_ptr_ [protected]
 

Mutex to protect access to the forwarding profile.

Definition at line 388 of file Stub.h.

Referenced by profile_lock, TAO_Stub, and ~TAO_Stub.

size_t TAO_Stub::profile_success_ [protected]
 

Have we successfully talked to the forward profile yet?

Definition at line 391 of file Stub.h.

Referenced by add_forward_profiles, next_profile_retry, reset_base, set_valid_profile, valid_forward_profile, and valid_profile.

CORBA::ULong TAO_Stub::refcount_ [protected]
 

Number of outstanding references to this object.

Definition at line 397 of file Stub.h.

Referenced by _decr_refcnt, _incr_refcnt, and refcount.

TAO_SYNCH_MUTEX TAO_Stub::refcount_lock_ [protected]
 

Mutex to protect reference count.

Definition at line 394 of file Stub.h.

Referenced by refcount_lock.

CORBA::ORB_var TAO_Stub::servant_orb_ [protected]
 

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 375 of file Stub.h.

Referenced by servant_orb, and servant_orb_var.

CORBA::String_var TAO_Stub::type_id
 

All objref representations carry around a type ID.

Definition at line 153 of file Stub.h.

Referenced by operator<<.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:40:05 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002