TAO  2.2.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TAO_Stub Class Reference

TAO_Stub. More...

#include <Stub.h>

Collaboration diagram for TAO_Stub:
Collaboration graph

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_Stubset_policy_overrides (const CORBA::PolicyList &policies, CORBA::SetOverrideType set_add)
 
virtual CORBA::PolicyListget_policy_overrides (const CORBA::PolicyTypeSeq &types)
 
TAO::Transport_Queueing_Strategytransport_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. 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...
 
void _incr_refcnt (void)
 
void _decr_refcnt (void)
 
const TAO_SYNCH_MUTEXprofile_lock (void) const
 
TAO_Profileprofile_in_use (void)
 
const TAO::ObjectKeyobject_key (void) const
 Return the ObjectKey. 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_MProfileforward_profiles (void)
 Obtain a pointer to the forwarded profile set. More...
 
TAO_Profilenext_profile (void)
 True if permanent location forward occured, in this case the lock must be set and the. More...
 
void reset_profiles (void)
 
CORBA::Boolean at_starting_profile (void) const
 
CORBA::Boolean valid_forward_profile (void)
 
void set_valid_profile (void)
 NON-THREAD-SAFE. Will set profile_success_ to true. More...
 
CORBA::Boolean valid_profile (void) const
 
TAO_Profilebase_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_Coreorb_core (void) const
 Accessor. More...
 
CORBA::Boolean is_collocated (void) const
 Is this stub collocated with the servant? More...
 
void is_collocated (CORBA::Boolean)
 Mutator to mark this stub as being collocated with the servant. 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)
 
void collocated_servant (TAO_Abstract_ServantBase *servant)
 Mutator for setting the servant in collocated cases. More...
 
TAO_Abstract_ServantBasecollocated_servant (void) const
 Accessor for the servant reference in collocated cases. More...
 
void object_proxy_broker (TAO::Object_Proxy_Broker *proxy_broker)
 
TAO::Object_Proxy_Brokerobject_proxy_broker (void) const
 
int create_ior_info (IOP::IOR *&ior_info, CORBA::ULong &index)
 
void destroy (void)
 Deallocate the TAO_Stub object. More...
 
CORBA::Boolean optimize_collocation_objects (void) const
 Return the cached value from the ORB_Core. More...
 
CORBA::Boolean marshal (TAO_OutputCDR &)
 Needed to avoid copying forward_profiles for thread safety. More...
 
void forwarded_on_exception (bool forwarded)
 
bool forwarded_on_exception () const
 

Public Attributes

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

Protected Member Functions

virtual ~TAO_Stub (void)
 
void reset_profiles_i (void)
 NON-THREAD SAFE version of reset_profiles (void);. More...
 
TAO_Profilenext_profile_i (void)
 NON-THREAD SAFE version of next_profile (void) More...
 

Protected Attributes

TAO_ORB_Core_Auto_Ptr orb_core_
 Automatically manage the ORB_Core reference count. More...
 
CORBA::ORB_var orb_
 
CORBA::Boolean is_collocated_
 
CORBA::ORB_var servant_orb_
 
TAO_Abstract_ServantBasecollocated_servant_
 Servant pointer. It is 0 except for collocated objects. More...
 
TAO::Object_Proxy_Brokerobject_proxy_broker_
 Pointer to the Proxy Broker. More...
 
TAO_MProfile base_profiles_
 Ordered list of profiles for this object. More...
 
TAO_MProfileforward_profiles_
 
TAO_MProfileforward_profiles_perm_
 
TAO_Profileprofile_in_use_
 This is the profile that we are currently sending/receiving with. More...
 
TAO_SYNCH_MUTEX profile_lock_
 Mutex to protect access to the forwarding profile. More...
 
CORBA::Boolean profile_success_
 Have we successfully talked to the forward profile yet? More...
 
ACE_Atomic_Op< TAO_SYNCH_MUTEX,
unsigned long > 
refcount_
 Reference counter. More...
 
TAO_Policy_Setpolicies_
 
IOP::IOR * ior_info_
 
IOP::IOR * forwarded_ior_info_
 Forwarded IOR info. More...
 
CORBA::Boolean const collocation_opt_
 
ACE_Atomic_Op< TAO_SYNCH_MUTEX,
bool > 
forwarded_on_exception_
 

Private Member Functions

TAO_Profileset_profile_in_use_i (TAO_Profile *pfile)
 
void reset_base ()
 
void forward_back_one (void)
 
void reset_forward ()
 
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)
 THREAD-SAFE Create the IOR info. More...
 
 TAO_Stub (const TAO_Stub &)
 
TAO_Stuboperator= (const TAO_Stub &)
 

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.

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.

TAO_Stub::~TAO_Stub ( void  )
protectedvirtual

Destructor is to be called only through _decr_refcnt() to enforce proper reference counting.

TAO_Stub::TAO_Stub ( const TAO_Stub )
private

Member Function Documentation

void TAO_Stub::_decr_refcnt ( void  )
void TAO_Stub::_incr_refcnt ( void  )
void TAO_Stub::add_forward_profiles ( const TAO_MProfile mprofiles,
const CORBA::Boolean  permanent_forward = false 
)

THREAD SAFE. Set the forward_profiles. This object will assume ownership of this TAO_MProfile object!! if permanent_forward is true, currently used profiles will be replaced permanently, otherwise stub may fallback to current profiles later. The flag permanent_forward=true is only valid if currently used profile set represents a GroupObject (IOGR), otherwise this flag will be ignored.

CORBA::Boolean TAO_Stub::at_starting_profile ( void  ) const

Returns true if the profile in use is the same as the profile in use after reset_profiles() is called.

const TAO_MProfile & TAO_Stub::base_profiles ( void  ) const

Obtain a reference to the basic profile set.

TAO_MProfile & TAO_Stub::base_profiles ( void  )

Obtain a reference to the basic profile set.

TAO_Profile * TAO_Stub::base_profiles ( const TAO_MProfile mprofiles)

Initialize the base_profiles_ and set profile_in_use_ to reference the first profile.

void TAO_Stub::collocated_servant ( TAO_Abstract_ServantBase servant)

Mutator for setting the servant in collocated cases.

TAO_Abstract_ServantBase * TAO_Stub::collocated_servant ( void  ) const

Accessor for the servant reference in collocated cases.

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

Create the IOP::IOR info. We will create the info at most once. Get the index of the profile we are using to make the invocation.

void TAO_Stub::destroy ( void  )

Deallocate the TAO_Stub object.

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

void TAO_Stub::forward_back_one ( void  )
private

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

const TAO_MProfile * TAO_Stub::forward_profiles ( void  ) const

Obtain a pointer to the forwarded profile set.

TAO_MProfile * TAO_Stub::forward_profiles ( void  )

Obtain a pointer to the forwarded profile set.

void TAO_Stub::forwarded_on_exception ( bool  forwarded)
bool TAO_Stub::forwarded_on_exception ( ) const
CORBA::Policy_ptr TAO_Stub::get_cached_policy ( TAO_Cached_Policy_Type  type)
virtual
CORBA::Policy_ptr TAO_Stub::get_policy ( CORBA::PolicyType  type)
virtual

Returns the effective policy if type is a known client-exposed policy type. Returns the effective override for all other policy types.

CORBA::PolicyList * TAO_Stub::get_policy_overrides ( const CORBA::PolicyTypeSeq types)
virtual
int TAO_Stub::get_profile_ior_info ( TAO_MProfile profile,
IOP::IOR *&  ior_info 
)
private

THREAD-SAFE Create the IOR info.

CORBA::ULong TAO_Stub::hash ( CORBA::ULong  maximum)

All objref representations know how to hash themselves and compare themselves for equivalence to others. It's easily possible to have two objrefs that are distinct copies of data that refers/points to the same remote object (i.e. are equivalent).

CORBA::Boolean TAO_Stub::is_collocated ( void  ) const

Is this stub collocated with the servant?

void TAO_Stub::is_collocated ( CORBA::Boolean  collocated)

Mutator to mark this stub as being collocated with the servant.

CORBA::Boolean TAO_Stub::is_equivalent ( CORBA::Object_ptr  other_obj)

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

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.

CORBA::Boolean TAO_Stub::marshal ( TAO_OutputCDR cdr)

Needed to avoid copying forward_profiles for thread safety.

TAO_Profile * TAO_Stub::next_forward_profile ( void  )
private

NON-THREAD-SAFE. utility method for next_profile.

TAO_Profile * TAO_Stub::next_profile ( void  )

True if permanent location forward occured, in this case the lock must be set and the.

THREAD SAFE. If forward_profiles is null then this will get the next profile in the base_profiles list. If forward is not null then this will get the next profile for the list of forwarding profiles. If all profiles have been tried then 0 is returned and profile_in_use_ is set to the first profile in the base_profiles list.

TAO_Profile * TAO_Stub::next_profile_i ( void  )
protected

NON-THREAD SAFE version of next_profile (void)

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!

const TAO::ObjectKey & TAO_Stub::object_key ( void  ) const

Return the ObjectKey.

void TAO_Stub::object_proxy_broker ( TAO::Object_Proxy_Broker proxy_broker)

Mutator for setting the object proxy broker pointer. CORBA::Objects using this stub will use this for standard calls like is_a; get_interface; etc...

TAO::Object_Proxy_Broker * TAO_Stub::object_proxy_broker ( void  ) const

Accessor for getting the object proxy broker pointer. CORBA::Objects using this stub use this for standard calls like is_a; get_interface; etc...

TAO_Stub& TAO_Stub::operator= ( const TAO_Stub )
private
CORBA::Boolean TAO_Stub::optimize_collocation_objects ( void  ) const

Return the cached value from the ORB_Core.

This flag indicates whether the stub code should make use of the collocation opportunities that are available to the ORB.

TAO_ORB_Core * TAO_Stub::orb_core ( void  ) const

Accessor.

TAO_Profile * TAO_Stub::profile_in_use ( void  )

Manage the base (non-forwarded) profiles. Returns a pointer to the profile_in_use object. This object retains ownership of this profile.

const TAO_SYNCH_MUTEX & TAO_Stub::profile_lock ( void  ) const

Return the Profile lock. This lock can be used at places where profiles need to be edited.

void TAO_Stub::reset_base ( void  )
private

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

void TAO_Stub::reset_forward ( void  )
private

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

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.

void TAO_Stub::reset_profiles_i ( void  )
protected

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

void TAO_Stub::servant_orb ( CORBA::ORB_ptr  orb)

Accesor and mutator for the servant ORB. Notice that the mutator assumes the ownership of the passed in ORB and the accesor does not return a copy of the orb since the accessing of the ORB is considered temporary.

CORBA::ORB_ptr TAO_Stub::servant_orb_ptr ( void  )

This returns a duplicated ORB pointer.

CORBA::ORB_var & TAO_Stub::servant_orb_var ( void  )

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

TAO_Stub * TAO_Stub::set_policy_overrides ( const CORBA::PolicyList policies,
CORBA::SetOverrideType  set_add 
)
virtual
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

void TAO_Stub::set_valid_profile ( void  )

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

TAO::Transport_Queueing_Strategy * TAO_Stub::transport_queueing_strategy ( void  )

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

CORBA::Boolean TAO_Stub::valid_forward_profile ( void  )

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

CORBA::Boolean TAO_Stub::valid_profile ( void  ) const

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

Member Data Documentation

TAO_MProfile TAO_Stub::base_profiles_
protected

Ordered list of profiles for this object.

TAO_Abstract_ServantBase* TAO_Stub::collocated_servant_
protected

Servant pointer. It is 0 except for collocated objects.

CORBA::Boolean const TAO_Stub::collocation_opt_
protected

TRUE if we want to take advantage of collocation optimization in this ORB. This should be the same value as cached in the ORB_Core. The reason for caching this helps our generated code, notably the stubs to be decoupled from ORB_Core. Please do not move it away.

TAO_MProfile* TAO_Stub::forward_profiles_
protected

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

TAO_MProfile* TAO_Stub::forward_profiles_perm_
protected

The bookmark indicating permanent forward occurred, the pointer is used to identify bottom of stack forward_profiles_

IOP::IOR* TAO_Stub::forwarded_ior_info_
protected

Forwarded IOR info.

ACE_Atomic_Op<TAO_SYNCH_MUTEX, bool> TAO_Stub::forwarded_on_exception_
protected

True if forwarding request upon some specific exceptions (e.g. OBJECT_NOT_EXIST) already happened.

IOP::IOR* TAO_Stub::ior_info_
protected

The ior info. This is needed for GIOP 1.2, as the clients could receive an exception from the server asking for this info. The exception that the client receives is LOC_NEEDS_ADDRESSING_MODE. The data is set up here to be passed on to Invocation classes when they receive an exception. This info is for the base profiles that this class stores

CORBA::Boolean TAO_Stub::is_collocated_
protected

Flag that indicates that this stub is collocated (and that it belongs to an ORB for which collocation optimisation is active).

TAO::Object_Proxy_Broker* TAO_Stub::object_proxy_broker_
protected

Pointer to the Proxy Broker.

This cached pointer instance takes care of routing the call for standard calls in CORBA::Object like _is_a (), _get_component () etc.

CORBA::ORB_var TAO_Stub::orb_
protected

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

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....
TAO_ORB_Core_Auto_Ptr TAO_Stub::orb_core_
protected

Automatically manage the ORB_Core reference count.

The ORB_Core cannot go away until the object references it creates are destroyed. There are multiple reasons for this, but in particular, the allocators used for some of the TAO_Profile objects contained on each TAO_Stub are owned by the TAO_ORB_Core.

This must be the first field of the class, otherwise the TAO_ORB_Core is destroyed too early!

TAO_Policy_Set* TAO_Stub::policies_
protected

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

TAO_Profile* TAO_Stub::profile_in_use_
protected

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

TAO_SYNCH_MUTEX TAO_Stub::profile_lock_
protected

Mutex to protect access to the forwarding profile.

CORBA::Boolean TAO_Stub::profile_success_
protected

Have we successfully talked to the forward profile yet?

ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> TAO_Stub::refcount_
protected

Reference counter.

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.
CORBA::String_var TAO_Stub::type_id

All objref representations carry around a type ID.


The documentation for this class was generated from the following files: