TAO_Profile Class Reference

Defines the Profile interface. More...

#include <Profile.h>

Inheritance diagram for TAO_Profile:

Inheritance graph
[legend]
Collaboration diagram for TAO_Profile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Profile (CORBA::ULong tag, TAO_ORB_Core *orb_core, const TAO_GIOP_Message_Version &version)
 Constructor.

Non virtual methods for the profile classes.
CORBA::ULong tag (void) const
 The tag, each concrete class will have a specific tag value.

const TAO_GIOP_Message_Versionversion (void) const
TAO_ORB_Coreorb_core (void) const
 Get a pointer to the TAO_ORB_Core.

CORBA::ULong _incr_refcnt (void)
 Increase the reference count by one on this object.

CORBA::ULong _decr_refcnt (void)
void forward_to (TAO_MProfile *mprofiles)
 Keep a pointer to the forwarded profile.

TAO_MProfileforward_to (void)
 MProfile accessor.

const TAO_Tagged_Componentstagged_components (void) const
TAO_Tagged_Componentstagged_components (void)
 The tag, each concrete class will have a specific tag value.

void add_tagged_component (const IOP::TaggedComponent &component)
 Add the given tagged component to the profile.

CORBA::Short addressing_mode (void) const
const TAO::ObjectKeyobject_key (void) const
TAO::ObjectKey_key (void) const
Template methods that needs to be implemented by the
concrete classes. Some of the methods may be overridden only under specila circumstances.

virtual int encode (TAO_OutputCDR &stream) const
 Encode this profile in a stream, i.e. marshal it.

virtual int decode (TAO_InputCDR &cdr)
 Initialize this object using the given CDR octet string.

IOP::TaggedProfilecreate_tagged_profile (void)
virtual void policies (CORBA::PolicyList *policy_list)
virtual void get_policies (CORBA::PolicyList &policy_list)
 Accessor for the client exposed policies of this profile.

virtual int supports_multicast (void) const
 Returns true if this profile can specify multicast endpoints.

virtual bool supports_non_blocking_oneways (void) const
 Returns true if this profile supports non blocking oneways.

virtual void addressing_mode (CORBA::Short addr_mode)
virtual char object_key_delimiter (void) const=0
 The object key delimiter.

virtual void parse_string (const char *string)
virtual char * to_string ()=0
virtual int encode_endpoints (void)=0
virtual int encode_alternate_endpoints (void)
virtual TAO_Endpointendpoint (void)=0
virtual CORBA::ULong endpoint_count (void) const=0
 Return how many endpoints this profile contains.

TAO_Endpointfirst_filtered_endpoint (void)
TAO_Endpointnext_filtered_endpoint (TAO_Endpoint *source)
virtual void remove_generic_endpoint (TAO_Endpoint *ep)
virtual void add_generic_endpoint (TAO_Endpoint *ep)
 Add a protocol-agnostic endpoint.

CORBA::Boolean is_equivalent (const TAO_Profile *other_profile)
 Verify profile equivalance.

CORBA::Boolean compare_key (const TAO_Profile *other) const
virtual CORBA::ULong hash (CORBA::ULong max)=0
 Return a hash value for this object.


Protected Member Functions

virtual ~TAO_Profile (void)
 If you have a virtual method you need a virtual dtor.

 TAO_Profile (CORBA::ULong tag, TAO_ORB_Core *orb_core, const TAO::ObjectKey &key, const TAO_GIOP_Message_Version &version)
 To be used by inherited classes.

void set_tagged_components (TAO_OutputCDR &cdr)
virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other)=0
 Profile equivalence template method invoked on subclasses.

virtual TAO_Service_Callbacks::Profile_Equivalence is_equivalent_hook (const TAO_Profile *other)
 Allow services to apply their own definition of "equivalence.".

CORBA::ULong hash_service_i (CORBA::ULong m)
Protected template methods.
virtual int decode_profile (TAO_InputCDR &cdr)=0
 Decode the protocol specific profile details.

virtual void create_profile_body (TAO_OutputCDR &cdr) const=0
 Creates an encapsulation of the ProfileBody struct in the cdr.

virtual int decode_endpoints (void)=0
virtual void parse_string_i (const char *string)=0
 Protocol specific implementation of parse_string ().


Protected Attributes

TAO_GIOP_Message_Version version_
 IIOP version number.

TAO_Tagged_Components tagged_components_
 The tagged components.

CORBA::Boolean are_policies_parsed_
CORBA::Short addressing_mode_
IOP::TaggedProfiletagged_profile_
 Our tagged profile.

TAO::Refcounted_ObjectKeyref_object_key_
 object_key associated with this profile.


Private Member Functions

TAO_MProfileforward_to_i (void)
 This object keeps ownership of this object.

void verify_orb_configuration ()
void verify_profile_version ()
 TAO_Profile (const TAO_Profile &)
void operator= (const TAO_Profile &)

Private Attributes

CORBA::ULong const  tag_
 IOP protocol tag.

TAO_ORB_Core *const  orb_core_
 Pointer to the ORB core.

TAO_MProfileforward_to_
ACE_Lockrefcount_lock_
 Mutex to protect reference count.

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


Detailed Description

Defines the Profile interface.

An abstract base class for representing object location information. This is based on the CORBA IOR definitions.

Definition at line 53 of file Profile.h.


Constructor & Destructor Documentation

TAO_Profile::TAO_Profile CORBA::ULong  tag,
TAO_ORB_Core orb_core,
const TAO_GIOP_Message_Version version
 

Constructor.

Definition at line 55 of file Profile.cpp.

References TAO_ORB_Core::client_factory(), and TAO_Client_Strategy_Factory::create_profile_lock().

00058   : version_ (version)
00059     , are_policies_parsed_ (false)
00060     , addressing_mode_ (0)
00061     , tagged_profile_ (0)
00062     , ref_object_key_ (0)
00063     , tag_ (tag)
00064     , orb_core_ (orb_core)
00065     , forward_to_ (0)
00066     , refcount_lock_ (0)
00067     , refcount_ (1)
00068 {
00069   // @@ NOTE: Need to probably use a different type of lock.
00070   this->refcount_lock_ =
00071     this->orb_core_->client_factory ()->create_profile_lock ();
00072 }

TAO_Profile::~TAO_Profile void   )  [protected, virtual]
 

If you have a virtual method you need a virtual dtor.

Definition at line 74 of file Profile.cpp.

References TAO_ORB_Core::object_key_table(), tagged_profile_, and TAO::ObjectKey_Table::unbind().

00075 {
00076   if (this->tagged_profile_)
00077     {
00078       delete this->tagged_profile_;
00079     }
00080 
00081   this->orb_core_->object_key_table ().unbind (this->ref_object_key_);
00082   delete this->refcount_lock_;
00083 
00084   //@@ TAO_PROFILE_SPL_DESTRUCTOR_ADD_HOOK
00085 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Profile::TAO_Profile CORBA::ULong  tag,
TAO_ORB_Core orb_core,
const TAO::ObjectKey key,
const TAO_GIOP_Message_Version version
[protected]
 

To be used by inherited classes.

Definition at line 32 of file Profile.cpp.

References TAO::ObjectKey_Table::bind(), TAO_ORB_Core::client_factory(), TAO_Client_Strategy_Factory::create_profile_lock(), and TAO_ORB_Core::object_key_table().

00036   : version_ (version)
00037     , are_policies_parsed_ (false)
00038     , addressing_mode_ (0)
00039     , tagged_profile_ (0)
00040     , ref_object_key_ (0)
00041     , tag_ (tag)
00042     , orb_core_ (orb_core)
00043     , forward_to_ (0)
00044     , refcount_lock_ (0)
00045     , refcount_ (1)
00046 {
00047   // @@ NOTE: Need to probably use a different type of lock.
00048   this->refcount_lock_ =
00049     this->orb_core_->client_factory ()->create_profile_lock ();
00050 
00051   (void) this->orb_core_->object_key_table ().bind (obj_key,
00052                                                     this->ref_object_key_);
00053 }

TAO_Profile::TAO_Profile const TAO_Profile  )  [private]
 


Member Function Documentation

CORBA::ULong TAO_Profile::_decr_refcnt void   ) 
 

Decrement the object's reference count. When this count goes to 0 this object will be deleted.

Definition at line 95 of file Profile.cpp.

References ACE_GUARD_RETURN.

Referenced by TAO_MProfile::cleanup(), TAO_IIOP_Acceptor::create_new_profile(), TAO_IIOP_Connector::create_profile(), TAO_Connector_Registry::create_profile(), TAO_IIOP_Acceptor::create_shared_profile(), TAO_MProfile::give_shared_profile(), TAO_Connector::make_mprofile(), TAO::Profile_Transport_Resolver::profile(), TAO_MProfile::remove_profile(), TAO_MProfile::set(), TAO_Stub::set_profile_in_use_i(), TAO_CORBALOC_Parser::parsed_endpoint::~parsed_endpoint(), TAO::Profile_Transport_Resolver::~Profile_Transport_Resolver(), and TAO_Stub::~TAO_Stub().

00096 {
00097   {
00098     ACE_GUARD_RETURN (ACE_Lock, mon, *this->refcount_lock_, 0);
00099     --this->refcount_;
00100 
00101     if (this->refcount_ != 0)
00102       {
00103         return this->refcount_;
00104       }
00105   }
00106 
00107   // refcount is 0, so delete us!
00108   // delete will call our ~ destructor which in turn deletes stuff.
00109   delete this;
00110   return 0;
00111 }

CORBA::ULong TAO_Profile::_incr_refcnt void   ) 
 

Increase the reference count by one on this object.

Definition at line 88 of file Profile.cpp.

References ACE_GUARD_RETURN.

Referenced by TAO::Profile_Transport_Resolver::profile(), TAO_MProfile::set(), and TAO_Stub::set_profile_in_use_i().

00089 {
00090   ACE_GUARD_RETURN (ACE_Lock, guard, *this->refcount_lock_, 0);
00091   return ++this->refcount_;
00092 }

TAO::ObjectKey * TAO_Profile::_key void   )  const
 

Obtain the object key, return 0 if the profile cannot be parsed. The memory is owned by the caller!

Reimplemented in TAO_Unknown_Profile.

Definition at line 134 of file Profile.cpp.

References ACE_NEW_RETURN, and ref_object_key_.

Referenced by CORBA::Object::_key().

00135 {
00136   TAO::ObjectKey *key = 0;
00137 
00138   if (this->ref_object_key_)
00139     {
00140       ACE_NEW_RETURN (key,
00141                       TAO::ObjectKey (this->ref_object_key_->object_key ()),
00142                       0);
00143     }
00144   return key;
00145 }

void TAO_Profile::add_generic_endpoint TAO_Endpoint ep  )  [virtual]
 

Add a protocol-agnostic endpoint.

Reimplemented in TAO_IIOP_Profile.

Definition at line 754 of file Profile.cpp.

Referenced by TAO_MProfile::give_shared_profile().

00755 {
00756   // noop for the base type
00757 }

void TAO_Profile::add_tagged_component const IOP::TaggedComponent component  ) 
 

Add the given tagged component to the profile.

Definition at line 114 of file Profile.cpp.

References ACE_CHECK, ACE_ENV_SINGLE_ARG_PARAMETER, TAO_Tagged_Components::set_component(), tagged_components_, verify_orb_configuration(), and verify_profile_version().

00116 {
00117   // Sanity checks.
00118   this->verify_orb_configuration (ACE_ENV_SINGLE_ARG_PARAMETER);
00119   ACE_CHECK;
00120 
00121   this->verify_profile_version (ACE_ENV_SINGLE_ARG_PARAMETER);
00122   ACE_CHECK;
00123 
00124   // ----------------------------------------------------------------
00125 
00126   // Add the given tagged component to this profile.
00127   //
00128   // Note that multiple tagged profiles with the same tag value may be
00129   // added, unless the tagged component is known to be unique by TAO.
00130   this->tagged_components_.set_component (component);
00131 }

void TAO_Profile::addressing_mode CORBA::Short  addr_mode  )  [virtual]
 

Set the addressing mode if a remote servant replies with an addressing mode exception. If this profile doesn't support a particular addressing mode, this method needs to be overridden signal the appropriate error.

** RACE CONDITION NOTE **

Currently, getting and setting the addressing mode is not protected by a mutex. Theoretically, this could cause a race condition if one thread sends a request, then gets an exception from the remote servant to change the addressing mode, and then another thread sends a different request to the same servant using the wrong addressing mode. The result of this is that we'll get another address change exception. (Annoying, but not that bad.)

In practice at the current time, the above theoretical case never happens since the target specification always uses the object key except for MIOP requests. Remote ORBs can't respond to MIOP requests even to send exceptions, so even in this case, the race condition can't happen.

Therefore, for the time being, there is no lock to protect the addressing mode. Given that the addressing mode is checked in the critical path, this decision seems like a good thing.

Definition at line 633 of file Profile.cpp.

References ACE_THROW.

00635 {
00636   // ** See race condition note about addressing mode in Profile.h **
00637   switch (addr)
00638     {
00639     case TAO_Target_Specification::Key_Addr:
00640     case TAO_Target_Specification::Profile_Addr:
00641     case TAO_Target_Specification::Reference_Addr:
00642       this->addressing_mode_ = addr;
00643       break;
00644 
00645     default:
00646       ACE_THROW (CORBA::BAD_PARAM (
00647              CORBA::SystemException::_tao_minor_code (
00648                0,
00649                EINVAL),
00650              CORBA::COMPLETED_NO));
00651     }
00652 }

ACE_INLINE CORBA::Short TAO_Profile::addressing_mode void   )  const
 

Return the current addressing mode for this profile. In almost all cases, this is TAO_Target_Specification::Key_Addr.

Definition at line 56 of file Profile.i.

Referenced by TAO::Remote_Invocation::init_target_spec().

00057 {
00058   return this->addressing_mode_;
00059 }

CORBA::Boolean TAO_Profile::compare_key const TAO_Profile other  )  const
 

Compare the object key for this profile with that of another. This is weaker than is_equivalent

Definition at line 730 of file Profile.cpp.

References TAO::Refcounted_ObjectKey::object_key(), and ref_object_key_.

Referenced by TAO_MProfile::give_shared_profile().

00731 {
00732   return (this->ref_object_key_ == other->ref_object_key_) ||
00733     ((this->ref_object_key_ != 0 &&
00734       other->ref_object_key_ != 0 &&
00735       this->ref_object_key_->object_key() ==
00736       other->ref_object_key_->object_key()));
00737 }

virtual void TAO_Profile::create_profile_body TAO_OutputCDR cdr  )  const [protected, pure virtual]
 

Creates an encapsulation of the ProfileBody struct in the cdr.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by create_tagged_profile(), and encode().

IOP::TaggedProfile * TAO_Profile::create_tagged_profile void   ) 
 

This method is used to get the IOP::TaggedProfile. The profile information that is received from the server side would have already been decoded. So this method will just make a IOP::TaggedProfile struct from the existing information and return the reference to that. This method is necessary for GIOP 1.2.

Definition at line 267 of file Profile.cpp.

References ACE_DEFAULT_CDR_BUFSIZE, ACE_NEW_RETURN, ACE_OutputCDR::begin(), TAO_ORB_Parameters::cdr_memcpy_tradeoff(), create_profile_body(), ACE_OutputCDR::end(), TAO::unbounded_value_sequence< T >::get_buffer(), ACE_Message_Block::length(), TAO::unbounded_value_sequence< T >::length(), ACE_OS::memcpy(), ACE_Message_Block::next(), orb_core(), TAO_ORB_Core::orb_params(), TAO_ORB_Core::output_cdr_dblock_allocator(), TAO_ORB_Core::output_cdr_msgblock_allocator(), IOP::TaggedProfile::profile_data, ACE_Message_Block::rd_ptr(), TAO::unbounded_value_sequence< T >::replace(), IOP::TaggedProfile::tag, tagged_profile_, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, and ACE_OutputCDR::total_length().

Referenced by TAO_Stub::get_profile_ior_info(), and TAO::Remote_Invocation::init_target_spec().

00268 {
00269   if (this->tagged_profile_ == 0)
00270     {
00271       ACE_NEW_RETURN (this->tagged_profile_,
00272                       IOP::TaggedProfile,
00273                       0);
00274 
00275       // As we have not created we will now create the TaggedProfile
00276       this->tagged_profile_->tag = this->tag_;
00277 
00278       // Create the encapsulation....
00279       TAO_OutputCDR encap (ACE_DEFAULT_CDR_BUFSIZE,
00280                            TAO_ENCAP_BYTE_ORDER,
00281                            this->orb_core ()->output_cdr_buffer_allocator (),
00282                            this->orb_core ()->output_cdr_dblock_allocator (),
00283                            this->orb_core ()->output_cdr_msgblock_allocator (),
00284                            this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (),
00285                            TAO_DEF_GIOP_MAJOR,
00286                            TAO_DEF_GIOP_MINOR);
00287 
00288       // Create the profile body
00289       this->create_profile_body (encap);
00290 
00291       CORBA::ULong const length =
00292         static_cast <CORBA::ULong> (encap.total_length ());
00293 
00294 #if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
00295       // Place the message block in to the Sequence of Octets that we
00296       // have
00297       this->tagged_profile_->profile_data.replace (length,
00298                                                    encap.begin ());
00299 #else
00300       this->tagged_profile_->profile_data.length (length);
00301       CORBA::Octet *buffer =
00302         this->tagged_profile_->profile_data.get_buffer ();
00303 
00304       for (const ACE_Message_Block *i = encap.begin ();
00305            i != encap.end ();
00306            i = i->next ())
00307         {
00308           ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ());
00309           buffer += i->length ();
00310         }
00311 #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
00312     }
00313 
00314   return this->tagged_profile_;
00315 }

int TAO_Profile::decode TAO_InputCDR cdr  )  [virtual]
 

Initialize this object using the given CDR octet string.

Reimplemented in TAO_Unknown_Profile.

Definition at line 175 of file Profile.cpp.

References ACE_DEBUG, ACE_TEXT, TAO::ObjectKey_Table::bind(), TAO_Tagged_Components::decode(), decode_endpoints(), decode_profile(), TAO::ObjectKey::demarshal_key(), ACE_InputCDR::length(), LM_DEBUG, TAO_GIOP_Message_Version::major, TAO_GIOP_Message_Version::minor, TAO_ORB_Core::object_key_table(), orb_core(), ACE_InputCDR::read_octet(), tagged_components_, TAO_debug_level, TAO_DEF_GIOP_MAJOR, and TAO_DEF_GIOP_MINOR.

Referenced by TAO_IIOP_Connector::create_profile(), and TAO_Connector_Registry::create_profile().

00176 {
00177   size_t const encap_len = cdr.length ();
00178 
00179   // Read and verify major, minor versions, ignoring profiles
00180   // whose versions we don't understand.
00181   if (!(cdr.read_octet (this->version_.major)
00182         && this->version_.major == TAO_DEF_GIOP_MAJOR
00183         && cdr.read_octet (this->version_.minor)
00184         && this->version_.minor <= TAO_DEF_GIOP_MINOR))
00185     {
00186       if (TAO_debug_level > 0)
00187         {
00188           ACE_DEBUG ((LM_DEBUG,
00189                       ACE_TEXT ("TAO (%P|%t) - Profile::decode - v%d.%d\n"),
00190                       this->version_.major,
00191                       this->version_.minor));
00192         }
00193 
00194       return -1;
00195     }
00196 
00197   // Transport specific details
00198   if (this->decode_profile (cdr) < 0)
00199     {
00200       return -1;
00201     }
00202 
00203   // @@NOTE: This place *may* need strategizing. Here are the
00204   // issues. Placing the ObjectKey in the table adds an allocation and
00205   // a lock while decoding. This is bad for some cases especially if
00206   // the application is marshalling object references across to the
00207   // server end. But the server could use "lazy" evaluation and avoid
00208   // this during marshalling.
00209   //
00210   // The only place this will get important is when a thead tries to
00211   // use the object reference to create a CORBA object to make an
00212   // invocation. Since creation of a CORBA object itself is expensive,
00213   // it looks like we may not need to worry much.
00214   //
00215   // Remember strategizing needs  reconciliation of forces imposed
00216   // by runtime memory growth. Doing a random strategization would
00217   // destroy the wins in runtime memory growth got by using this
00218   // table scheme.
00219   TAO::ObjectKey ok;
00220 
00221   // ... and object key.
00222   if (TAO::ObjectKey::demarshal_key (ok,
00223                                      cdr) == 0)
00224     {
00225       return -1;
00226     }
00227 
00228   TAO::ObjectKey_Table &okt = this->orb_core ()->object_key_table ();
00229 
00230   if (okt.bind (ok, this->ref_object_key_) == -1)
00231     {
00232       return -1;
00233     }
00234 
00235   // Tagged Components *only* exist after version 1.0!
00236   // For GIOP 1.2, IIOP and GIOP have same version numbers!
00237   if (this->version_.major > 1
00238       || this->version_.minor > 0)
00239     {
00240       if (this->tagged_components_.decode (cdr) == 0)
00241         {
00242           return -1;
00243         }
00244     }
00245 
00246   if (cdr.length () != 0 && TAO_debug_level)
00247     {
00248       // If there is extra data in the profile we are supposed to
00249       // ignore it, but print a warning just in case...
00250       ACE_DEBUG ((LM_DEBUG,
00251                   ACE_TEXT ("%d bytes out of %d left after profile data\n"),
00252                   cdr.length (),
00253                   encap_len));
00254     }
00255 
00256   // Decode any additional endpoints per profile. This is used by RTCORBA
00257   // and by IIOP when TAG_ALTERNATE_IIOP_ADDRESS components are present.
00258   if (this->decode_endpoints () == -1)
00259     {
00260       return -1;
00261     }
00262 
00263   return 1;
00264 }

virtual int TAO_Profile::decode_endpoints void   )  [protected, pure virtual]
 

Helper for decode(). Decodes endpoints from a tagged component. Decode only if RTCORBA is enabled. Furthermore, we may not find TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT version of TAO or some other ORB. This is not an error, and we must proceed. Return 0 on success and -1 on failure.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by decode().

virtual int TAO_Profile::decode_profile TAO_InputCDR cdr  )  [protected, pure virtual]
 

Decode the protocol specific profile details.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by decode().

virtual CORBA::Boolean TAO_Profile::do_is_equivalent const TAO_Profile other  )  [protected, pure virtual]
 

Profile equivalence template method invoked on subclasses.

TAO_Profile subclasses must implement this template method so that they can apply their own definition of profile equivalence.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by is_equivalent().

int TAO_Profile::encode TAO_OutputCDR stream  )  const [virtual]
 

Encode this profile in a stream, i.e. marshal it.

Reimplemented in TAO_Unknown_Profile.

Definition at line 149 of file Profile.cpp.

References ACE_OutputCDR::begin(), TAO_ORB_Parameters::cdr_memcpy_tradeoff(), create_profile_body(), orb_core(), TAO_ORB_Core::orb_params(), TAO_ORB_Core::output_cdr_dblock_allocator(), TAO_ORB_Core::output_cdr_msgblock_allocator(), TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, ACE_OutputCDR::total_length(), CORBA::ULong, ACE_OutputCDR::write_octet_array_mb(), and ACE_OutputCDR::write_ulong().

Referenced by TAO_Stub::marshal().

00150 {
00151   // UNSIGNED LONG, protocol tag
00152   stream.write_ulong (this->tag_);
00153 
00154   // Create the encapsulation....
00155   TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE,
00156                        TAO_ENCAP_BYTE_ORDER,
00157                        this->orb_core ()->output_cdr_buffer_allocator (),
00158                        this->orb_core ()->output_cdr_dblock_allocator (),
00159                        this->orb_core ()->output_cdr_msgblock_allocator (),
00160                        this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (),
00161                        TAO_DEF_GIOP_MAJOR,
00162                        TAO_DEF_GIOP_MINOR);
00163 
00164   // Create the profile body
00165   this->create_profile_body (encap);
00166 
00167   // write the encapsulation as an octet sequence...
00168   stream << CORBA::ULong (encap.total_length ());
00169   stream.write_octet_array_mb (encap.begin ());
00170 
00171   return 1;
00172 }

int TAO_Profile::encode_alternate_endpoints void   )  [virtual]
 

Encodes this profile's endpoints into protocol specific tagged components. This is used for non-RTCORBA applications that share endpoints on profiles. The only known implementation is IIOP, using TAG_ALTERNATE_IIOP_ADDRESS components.

Reimplemented in TAO_IIOP_Profile.

Definition at line 780 of file Profile.cpp.

00781 {
00782   // this should be a pure virtual, but there are many
00783   // existing specializations that would need to be
00784   // modified. This maintains the existing behavior, since
00785   // the previous version of the POA did not gather alternate
00786   // endpoints.
00787 
00788   return 0;
00789 }

virtual int TAO_Profile::encode_endpoints void   )  [pure virtual]
 

Encodes this profile's endpoints into a tagged component. This is done only if RTCORBA is enabled, since currently this is the only case when we have more than one endpoint per profile.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

virtual TAO_Endpoint* TAO_Profile::endpoint void   )  [pure virtual]
 

Return a pointer to this profile's endpoint. If the profile contains more than one endpoint, i.e., a list, the method returns the head of the list.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by first_filtered_endpoint(), TAO_MProfile::give_shared_profile(), and TAO_Acceptor_Registry::is_collocated().

virtual CORBA::ULong TAO_Profile::endpoint_count void   )  const [pure virtual]
 

Return how many endpoints this profile contains.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by is_equivalent().

TAO_Endpoint * TAO_Profile::first_filtered_endpoint void   ) 
 

Return the first endpoint in the list that matches some filtering constraint, such as IPv6 compatibility for IIOP endpoints. This method is implemented in terms of TAO_Endpoint;:next_filtered().

Definition at line 740 of file Profile.cpp.

References endpoint(), and TAO_Endpoint::next_filtered().

Referenced by next_filtered_endpoint().

00741 {
00742   return this->endpoint()->next_filtered(this->orb_core_,0);
00743 }

ACE_INLINE TAO_MProfile * TAO_Profile::forward_to void   ) 
 

MProfile accessor.

Definition at line 32 of file Profile.i.

References forward_to_.

00033 {
00034   return this->forward_to_;
00035 }

ACE_INLINE void TAO_Profile::forward_to TAO_MProfile mprofiles  ) 
 

Keep a pointer to the forwarded profile.

Definition at line 26 of file Profile.i.

References forward_to_.

Referenced by TAO_Stub::add_forward_profiles(), and TAO_Stub::forward_back_one().

00027 {
00028   this->forward_to_ = mprofiles;
00029 }

ACE_INLINE TAO_MProfile * TAO_Profile::forward_to_i void   )  [private]
 

This object keeps ownership of this object.

Definition at line 38 of file Profile.i.

References forward_to_.

00039 {
00040   return this->forward_to_;
00041 }

void TAO_Profile::get_policies CORBA::PolicyList policy_list  )  [virtual]
 

Accessor for the client exposed policies of this profile.

Definition at line 441 of file Profile.cpp.

References CORBA::ORB::_create_policy(), TAO_Objref_Var_T< T >::_retn(), ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DEBUG, ACE_ENDTRY, ACE_ENV_ARG_NOT_USED, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_THROW, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, ACE_TRY_THROW, are_policies_parsed_, IOP::TaggedComponent::component_data, TAO::unbounded_value_sequence< PolicyValue >::get_buffer(), TAO::unbounded_value_sequence< T >::get_buffer(), TAO_Tagged_Components::get_component(), TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), TAO::unbounded_value_sequence< PolicyValue >::length(), TAO::unbounded_value_sequence< T >::length(), LM_DEBUG, TAO_ORB_Core::orb(), CORBA::Policy_var, ACE_InputCDR::reset_byte_order(), IOP::TaggedComponent::tag, tagged_components_, and TAO_debug_level.

Referenced by TAO_MProfile::init_policy_list().

00443 {
00444 #if (TAO_HAS_CORBA_MESSAGING == 1) && !defined (CORBA_E_MICRO)
00445 
00446   if (!this->are_policies_parsed_)
00447     // None has already parsed the policies.
00448     {
00449       IOP::TaggedComponent tagged_component;
00450       tagged_component.tag = Messaging::TAG_POLICIES;
00451 
00452       // This gets a component with the proper "tag" field
00453       // if it exists.
00454       if (this->tagged_components_.get_component (tagged_component))
00455         {
00456           const CORBA::Octet *buf =
00457             tagged_component.component_data.get_buffer ();
00458 
00459           TAO_InputCDR in_cdr (reinterpret_cast <const char *> (buf),
00460                                tagged_component.component_data.length ());
00461 
00462           // Extract the Byte Order
00463           CORBA::Boolean byte_order;
00464 
00465           if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
00466             {
00467               return ;
00468             }
00469 
00470           in_cdr.reset_byte_order (static_cast <int> (byte_order));
00471 
00472           // Now we take out the Messaging::PolicyValueSeq out from the
00473           // CDR.
00474           Messaging::PolicyValueSeq policy_value_seq;
00475 
00476           if (!(in_cdr >> policy_value_seq))
00477             {
00478               ACE_THROW (CORBA::INV_OBJREF ());
00479             }
00480 
00481           // Here we extract the Messaging::PolicyValue out of the sequence
00482           // and we convert those into the proper CORBA::Policy
00483 
00484           CORBA::Policy_var policy;
00485           CORBA::ULong const length = policy_value_seq.length ();
00486 
00487           // Set the policy list length.
00488           pl.length (length);
00489 
00490           for (CORBA::ULong i = 0; i < length; ++i)
00491             {
00492               ACE_TRY_NEW_ENV
00493                 {
00494                   policy =
00495                     this->orb_core_->orb ()->_create_policy (
00496                       policy_value_seq[i].ptype
00497                       ACE_ENV_ARG_PARAMETER);
00498                   ACE_TRY_CHECK;
00499 
00500                   if (!CORBA::is_nil (policy.in ()))
00501                     {
00502                       buf = policy_value_seq[i].pvalue.get_buffer ();
00503 
00504                       TAO_InputCDR in_cdr (
00505                         reinterpret_cast <const char*>  (buf),
00506                         policy_value_seq[i].pvalue.length ());
00507 
00508                       if (!(in_cdr >> ACE_InputCDR::to_boolean (byte_order)))
00509                         ACE_TRY_THROW (CORBA::INV_OBJREF ());
00510 
00511                       in_cdr.reset_byte_order (static_cast <int> (byte_order));
00512 
00513                       policy->_tao_decode (in_cdr);
00514                       pl[i] = policy._retn ();
00515                     }
00516                   else
00517                     {
00518                       // This case should occure when in the IOR are
00519                       // embedded policies that TAO doesn't support,
00520                       // so as specified by the RT-CORBA
00521                       // spec. ptc/99-05-03 we just ignore these
00522                       // un-understood policies.
00523 
00524                       if (TAO_debug_level >= 5)
00525                         ACE_DEBUG ((LM_DEBUG,
00526                                     ACE_TEXT ("The IOR contains unsupported ")
00527                                     ACE_TEXT ("policies.\n")));
00528                     }
00529                 }
00530               ACE_CATCHANY
00531                 {
00532                   // This case should occur when in the IOR are
00533                   // embedded policies that TAO doesn't support, so as
00534                   // specified by the RT-CORBA spec. ptc/99-05-03 we
00535                   // just ignore these un-understood policies.
00536 
00537                   if (TAO_debug_level >= 5)
00538                     ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
00539                                         ACE_TEXT ("IOR contains ")
00540                                         ACE_TEXT ("unsupported policies."));
00541                 }
00542               ACE_ENDTRY;
00543             }
00544         }
00545     }
00546 
00547 #else
00548   ACE_UNUSED_ARG (pl);
00549   ACE_ENV_ARG_NOT_USED;    // FUZZ: ignore check_for_ace_check
00550 #endif /* (TAO_HAS_CORBA_MESSAGING == 1) */
00551 
00552 }

virtual CORBA::ULong TAO_Profile::hash CORBA::ULong  max  )  [pure virtual]
 

Return a hash value for this object.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by TAO_MProfile::hash().

CORBA::ULong TAO_Profile::hash_service_i CORBA::ULong  m  )  [protected]
 

Definition at line 767 of file Profile.cpp.

References TAO_ORB_Core::hash_service().

Referenced by TAO_IIOP_Profile::hash().

00768 {
00769   return this->orb_core_->hash_service (this, m);
00770 }

CORBA::Boolean TAO_Profile::is_equivalent const TAO_Profile other_profile  ) 
 

Verify profile equivalance.

Two profiles are equivalent if their tag, object_key, version and all endpoints are the same.

See also:
do_is_equivalent_i()

is_equivalent_hook()

Returns:
true if this profile is equivalent to other_profile.

Definition at line 704 of file Profile.cpp.

References do_is_equivalent(), endpoint_count(), is_equivalent_hook(), object_key(), tag(), and version().

Referenced by TAO_Stub::is_equivalent(), TAO_MProfile::is_equivalent(), and TAO_MProfile::remove_profile().

00705 {
00706   CORBA::Boolean result = false;
00707   if (other)
00708     {
00709       TAO_Service_Callbacks::Profile_Equivalence callback
00710         = this->is_equivalent_hook (other);
00711       switch (callback)
00712         {
00713           case TAO_Service_Callbacks::DONT_KNOW:
00714             return this->tag () == other->tag ()
00715                 && this->version_ == other->version ()
00716                 && this->endpoint_count () == other->endpoint_count ()
00717                 && this->object_key () == other->object_key ()
00718                 && this->do_is_equivalent (other);
00719           case TAO_Service_Callbacks::EQUIVALENT:
00720             result = true;
00721             break;
00722           case TAO_Service_Callbacks::NOT_EQUIVALENT:
00723             break;
00724         }
00725     }
00726   return result;
00727 }

TAO_Service_Callbacks::Profile_Equivalence TAO_Profile::is_equivalent_hook const TAO_Profile other  )  [protected, virtual]
 

Allow services to apply their own definition of "equivalence.".

This method differs from the do_is_equivalent() template method in that it has a default implementation that may or not be applicable to all TAO_Profile subclasses.

Reimplemented in TAO_Unknown_Profile.

Definition at line 760 of file Profile.cpp.

References TAO_ORB_Core::is_profile_equivalent().

Referenced by is_equivalent().

00761 {
00762   // Allow services to apply their own definition of "equivalence."
00763   return this->orb_core_->is_profile_equivalent (this, other);
00764 }

TAO_Endpoint * TAO_Profile::next_filtered_endpoint TAO_Endpoint source  ) 
 

Return the next filtered endpoint in the list after the one passed in. This method is implemented in terms of TAO_Endpoint;:next_filtered(). If the supplied source endpoint is null, this returns the first filtered endpoint.

Definition at line 746 of file Profile.cpp.

References first_filtered_endpoint(), and TAO_Endpoint::next_filtered().

00747 {
00748   if (source == 0)
00749     return this->first_filtered_endpoint();
00750   return source->next_filtered(this->orb_core_,this->endpoint());
00751 }

ACE_INLINE const TAO::ObjectKey & TAO_Profile::object_key void   )  const
 

Deprecated:
Return a reference to the Object Key.

Reimplemented in TAO_Unknown_Profile.

Definition at line 62 of file Profile.i.

References TAO::Refcounted_ObjectKey::object_key(), and ref_object_key_.

Referenced by TAO::Remote_Invocation::init_target_spec(), is_equivalent(), and TAO_Stub::object_key().

00063 {
00064   return this->ref_object_key_->object_key ();
00065 }

virtual char TAO_Profile::object_key_delimiter void   )  const [pure virtual]
 

The object key delimiter.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

void TAO_Profile::operator= const TAO_Profile  )  [private]
 

ACE_INLINE TAO_ORB_Core * TAO_Profile::orb_core void   )  const
 

Get a pointer to the TAO_ORB_Core.

Definition at line 20 of file Profile.i.

Referenced by create_tagged_profile(), decode(), TAO_IIOP_Profile::decode_profile(), encode(), TAO::Profile_Transport_Resolver::find_transport(), and TAO_IIOP_Profile::parse_string_i().

00021 {
00022   return this->orb_core_;
00023 }

void TAO_Profile::parse_string const char *  string  )  [virtual]
 

Initialize this object using the given input string. Supports URL style of object references

Reimplemented in TAO_Unknown_Profile.

Definition at line 655 of file Profile.cpp.

References ACE_ENV_ARG_PARAMETER, ACE_THROW, TAO_GIOP_Message_Version::major, TAO_GIOP_Message_Version::minor, parse_string_i(), TAO_GIOP_Message_Version::set_version(), TAO_DEF_GIOP_MAJOR, and TAO_DEF_GIOP_MINOR.

Referenced by TAO_Connector::make_mprofile().

00657 {
00658   if (!ior || !*ior)
00659     {
00660       ACE_THROW (CORBA::INV_OBJREF (
00661                    CORBA::SystemException::_tao_minor_code (
00662                      0,
00663                      EINVAL),
00664                    CORBA::COMPLETED_NO));
00665     }
00666 
00667   // Remove the "N.n@" version prefix, if it exists, and verify the
00668   // version is one that we accept.
00669 
00670   // Check for version
00671   if (isdigit (ior [0]) &&
00672       ior[1] == '.' &&
00673       isdigit (ior [2]) &&
00674       ior[3] == '@')
00675     {
00676       // @@ This may fail for non-ascii character sets [but take that
00677       // with a grain of salt]
00678       this->version_.set_version ((char) (ior[0] - '0'),
00679                                   (char) (ior[2] - '0'));
00680       ior += 4;
00681       // Skip over the "N.n@"
00682     }
00683   else
00684     {
00685       // CORBA spec requires 1.0 if a version isn't specified.
00686       this->version_.set_version (1, 0);
00687     }
00688 
00689   if (this->version_.major != TAO_DEF_GIOP_MAJOR ||
00690       this->version_.minor >  TAO_DEF_GIOP_MINOR)
00691     {
00692       ACE_THROW (CORBA::INV_OBJREF (
00693                    CORBA::SystemException::_tao_minor_code (
00694                      0,
00695                      EINVAL),
00696                    CORBA::COMPLETED_NO));
00697     }
00698 
00699   this->parse_string_i (ior
00700                         ACE_ENV_ARG_PARAMETER);
00701 }

virtual void TAO_Profile::parse_string_i const char *  string  )  [protected, pure virtual]
 

Protocol specific implementation of parse_string ().

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by parse_string().

void TAO_Profile::policies CORBA::PolicyList policy_list  )  [virtual]
 

This method sets the client exposed policies, i.e., the ones propagated in the IOR, for this profile.

Definition at line 345 of file Profile.cpp.

References ACE_CHECK, ACE_DEBUG, ACE_ENV_ARG_NOT_USED, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_TEXT, are_policies_parsed_, ACE_OutputCDR::begin(), IOP::TaggedComponent::component_data, ACE_Message_Block::cont(), TAO::unbounded_value_sequence< T >::get_buffer(), TAO::unbounded_value_sequence< PolicyValue >::get_buffer(), TAO::unbounded_value_sequence< T >::length(), ACE_Message_Block::length(), TAO::unbounded_value_sequence< PolicyValue >::length(), LM_DEBUG, ACE_OS::memcpy(), ACE_Message_Block::rd_ptr(), TAO_Tagged_Components::set_component(), IOP::TaggedComponent::tag, tagged_components_, TAO_debug_level, TAO_ENCAP_BYTE_ORDER, and ACE_OutputCDR::total_length().

Referenced by TAO_ORB_Core::create_stub_object().

00347 {
00348 #if (TAO_HAS_CORBA_MESSAGING == 1)
00349 
00350   if (policy_list == 0)
00351     {
00352       if (TAO_debug_level)
00353         {
00354           ACE_DEBUG ((LM_DEBUG,
00355                       ACE_TEXT ("TAO_Profile::policies: ")
00356                       ACE_TEXT ("Null Policy List!\n")));
00357         }
00358 
00359       return;
00360     }
00361 
00362   Messaging::PolicyValue pv;
00363   Messaging::PolicyValueSeq policy_value_seq;
00364 
00365   size_t length;
00366   CORBA::Octet *buf = 0;
00367 
00368   policy_value_seq.length (policy_list->length ());
00369 
00370   // This loop iterates through CORBA::PolicyList to convert
00371   // each CORBA::Policy into a CORBA::PolicyValue
00372   const size_t plen = policy_list->length ();
00373 
00374   for (CORBA::ULong i = 0; i < plen; ++i)
00375     {
00376       TAO_OutputCDR out_CDR;
00377       policy_value_seq[i].ptype =
00378         (*policy_list)[i]->policy_type (ACE_ENV_SINGLE_ARG_PARAMETER);
00379       ACE_CHECK;
00380 
00381       out_CDR << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
00382       (*policy_list)[i]->_tao_encode (out_CDR);
00383 
00384       length = out_CDR.total_length ();
00385       policy_value_seq[i].pvalue.length (static_cast <CORBA::ULong>(length));
00386 
00387       buf = policy_value_seq[i].pvalue.get_buffer ();
00388 
00389       // Copy the CDR buffer data into the octet sequence buffer.
00390 
00391       for (const ACE_Message_Block *iterator = out_CDR.begin ();
00392            iterator != 0;
00393            iterator = iterator->cont ())
00394         {
00395           ACE_OS::memcpy (buf, iterator->rd_ptr (), iterator->length ());
00396           buf += iterator->length ();
00397         }
00398     }
00399 
00400   TAO_OutputCDR out_cdr;
00401   // Now we have to embed the Messaging::PolicyValueSeq into
00402   // a TaggedComponent.
00403 
00404   IOP::TaggedComponent tagged_component;
00405   tagged_component.tag = Messaging::TAG_POLICIES;
00406 
00407   out_cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
00408   out_cdr << policy_value_seq;
00409 
00410   length = out_cdr.total_length ();
00411 
00412   tagged_component.component_data.length (static_cast <CORBA::ULong>(length));
00413   buf = tagged_component.component_data.get_buffer ();
00414 
00415   for (const ACE_Message_Block *iterator = out_cdr.begin ();
00416        iterator != 0;
00417        iterator = iterator->cont ())
00418     {
00419       size_t const i_length = iterator->length ();
00420       ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
00421 
00422       buf += i_length;
00423     }
00424 
00425   // Eventually we add the TaggedComponent to the TAO_TaggedComponents
00426   // member variable.
00427   tagged_components_.set_component (tagged_component);
00428   this->are_policies_parsed_ = true;
00429 
00430 #else /* TAO_HAS_CORBA_MESSAGING == 1 */
00431 
00432   ACE_UNUSED_ARG (policy_list);
00433   ACE_ENV_ARG_NOT_USED;  // FUZZ: ignore check_for_ace_check
00434 
00435 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00436 }

void TAO_Profile::remove_generic_endpoint TAO_Endpoint ep  )  [virtual]
 

Remove the provided endpoint from the profile. Some subclasses of TAO_Profile already have a protocol-specific version of remove_endpoint, but this generic interface is required. The default implementation is a no-op. Protocol maintainers wishing to add support for the EndpointPolicy must implement remove_generic_endpoint to call their protocol-specific version of remove_endpoint

Reimplemented in TAO_IIOP_Profile.

Definition at line 792 of file Profile.cpp.

00793 {
00794   // default for virtual methods, thus a no-op
00795 }

void TAO_Profile::set_tagged_components TAO_OutputCDR cdr  )  [protected]
 

Helper method that encodes the endpoints for RTCORBA as tagged_components.

Definition at line 318 of file Profile.cpp.

References ACE_OutputCDR::begin(), IOP::TaggedComponent::component_data, ACE_Message_Block::cont(), TAO::unbounded_value_sequence< T >::get_buffer(), ACE_Message_Block::length(), TAO::unbounded_value_sequence< T >::length(), ACE_OS::memcpy(), ACE_Message_Block::rd_ptr(), TAO_Tagged_Components::set_component(), IOP::TaggedComponent::tag, tagged_components_, and ACE_OutputCDR::total_length().

Referenced by TAO_IIOP_Profile::encode_endpoints().

00319 {
00320   CORBA::ULong const length = static_cast <CORBA::ULong> (out_cdr.total_length ());
00321 
00322   IOP::TaggedComponent tagged_component;
00323   tagged_component.tag = TAO_TAG_ENDPOINTS;
00324   tagged_component.component_data.length (length);
00325   CORBA::Octet *buf =
00326     tagged_component.component_data.get_buffer ();
00327 
00328   for (const ACE_Message_Block *iterator = out_cdr.begin ();
00329        iterator != 0;
00330        iterator = iterator->cont ())
00331     {
00332       size_t const i_length = iterator->length ();
00333       ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
00334 
00335       buf += i_length;
00336     }
00337 
00338   // Add component with encoded endpoint data to this profile's
00339   // TaggedComponents.
00340   tagged_components_.set_component (tagged_component);
00341 }

int TAO_Profile::supports_multicast void   )  const [virtual]
 

Returns true if this profile can specify multicast endpoints.

Definition at line 620 of file Profile.cpp.

00621 {
00622   // Most profiles do not support multicast endpoints.
00623   return 0;
00624 }

bool TAO_Profile::supports_non_blocking_oneways void   )  const [virtual]
 

Returns true if this profile supports non blocking oneways.

Definition at line 627 of file Profile.cpp.

References TAO_GIOP_Message_Version::major, and TAO_GIOP_Message_Version::minor.

00628 {
00629   return !(this->version_.major == 1 && this->version_.minor == 0);
00630 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::ULong TAO_Profile::tag void   )  const
 

The tag, each concrete class will have a specific tag value.

Definition at line 8 of file Profile.i.

Referenced by TAO_IIOP_Acceptor::create_shared_profile(), TAO_MProfile::give_shared_profile(), TAO_IIOP_Profile::hash(), TAO_Acceptor_Registry::is_collocated(), and is_equivalent().

00009 {
00010   return this->tag_;
00011 }

ACE_INLINE TAO_Tagged_Components & TAO_Profile::tagged_components void   ) 
 

The tag, each concrete class will have a specific tag value.

Definition at line 50 of file Profile.i.

References tagged_components_.

00051 {
00052   return this->tagged_components_;
00053 }

ACE_INLINE const TAO_Tagged_Components & TAO_Profile::tagged_components void   )  const
 

Access the tagged components, notice that they they could be empty (or ignored) for non-GIOP protocols (and even for GIOP-1.0)

Definition at line 44 of file Profile.i.

References tagged_components_.

Referenced by TAO_IIOP_Acceptor::create_new_profile(), TAO_IIOP_Profile::create_profile_body(), and TAO_IIOP_Acceptor::create_shared_profile().

00045 {
00046   return this->tagged_components_;
00047 }

virtual char* TAO_Profile::to_string  )  [pure virtual]
 

Return a string representation for this profile. Client must deallocate memory. Only one endpoint is included into the string.

Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile.

Referenced by CORBA::ORB::object_to_string().

void TAO_Profile::verify_orb_configuration  )  [private]
 

Verify that the current ORB's configuration supports tagged components in IORs.

Definition at line 556 of file Profile.cpp.

References CORBA::ORB::_use_omg_ior_format(), ACE_ERROR, ACE_TEXT, ACE_THROW, LM_ERROR, TAO_ORB_Core::orb(), TAO_ORB_Core::orb_params(), TAO_ORB_Parameters::std_profile_components(), and TAO_debug_level.

Referenced by add_tagged_component().

00557 {
00558   // If the ORB isn't configured to support tagged components, then
00559   // throw an exception.
00560   if (this->orb_core_->orb_params ()->std_profile_components () == 0
00561       || !this->orb_core_->orb ()->_use_omg_ior_format ())
00562     {
00563       if (TAO_debug_level > 0)
00564         {
00565           ACE_ERROR ((LM_ERROR,
00566                       ACE_TEXT ("(%P|%t) Cannot add ")
00567                       ACE_TEXT ("IOP::TaggedComponent to profile.\n")
00568                       ACE_TEXT ("(%P|%t) Standard profile components ")
00569                       ACE_TEXT ("have been disabled or URL style IORs\n")
00570                       ACE_TEXT ("(%P|%t) are in use.  Try ")
00571                       ACE_TEXT ("\"-ORBStdProfileComponents 1\" and/or\n")
00572                       ACE_TEXT ("(%P|%t) \"-ORBObjRefStyle IOR\".\n")));
00573         }
00574 
00575       // According to the Portable Interceptor specification, we're
00576       // supposed to throw a CORBA::BAD_PARAM exception if it isn't
00577       // possible to add components to the profile.
00578       // @todo: We need the proper minor code as soon as the spec is
00579       //        updated.
00580       ACE_THROW (CORBA::BAD_PARAM (
00581                    CORBA::SystemException::_tao_minor_code (
00582                       0,
00583                       EINVAL),
00584                    CORBA::COMPLETED_NO));
00585     }
00586 }

void TAO_Profile::verify_profile_version  )  [private]
 

Verify that the given profile supports tagged components, i.e. is not a GIOP 1.0 profile.

Definition at line 589 of file Profile.cpp.

References ACE_ERROR, ACE_TEXT, ACE_THROW, LM_ERROR, TAO_GIOP_Message_Version::major, TAO_GIOP_Message_Version::minor, and TAO_debug_level.

Referenced by add_tagged_component().

00590 {
00591   // GIOP 1.0 does not support tagged components.  Throw an exception
00592   // if the profile is a GIOP 1.0 profile.
00593 
00594   if (this->version_.major == 1 && this->version_.minor == 0)
00595     {
00596       if (TAO_debug_level > 0)
00597         {
00598           ACE_ERROR ((LM_ERROR,
00599                       ACE_TEXT ("(%P|%t) Cannot add ")
00600                       ACE_TEXT ("IOP::TaggedComponent to GIOP 1.0")
00601                       ACE_TEXT ("IOR profile.\n")
00602                       ACE_TEXT ("(%P|%t) Try using a GIOP 1.1 or ")
00603                       ACE_TEXT ("greater endpoint.\n")));
00604         }
00605 
00606       // According to the Portable Interceptor specification, we're
00607       // supposed to throw a CORBA::BAD_PARAM exception if it isn't
00608       // possible to add components to the profile.
00609       // @todo: We need the proper minor code as soon as the spec is
00610       //        updated.
00611       ACE_THROW (CORBA::BAD_PARAM (
00612                    CORBA::SystemException::_tao_minor_code (
00613                      0,
00614                      EINVAL),
00615                    CORBA::COMPLETED_NO));
00616     }
00617 }

ACE_INLINE const TAO_GIOP_Message_Version & TAO_Profile::version void   )  const
 

Return a pointer to this profile's version. This object maintains ownership.

Definition at line 14 of file Profile.i.

Referenced by is_equivalent(), and TAO_IIOP_Profile::parse_string_i().

00015 {
00016   return this->version_;
00017 }


Member Data Documentation

CORBA::Short TAO_Profile::addressing_mode_ [protected]
 

The current addressing mode. This may be changed if a remote server sends back an address mode exception.

Definition at line 359 of file Profile.h.

CORBA::Boolean TAO_Profile::are_policies_parsed_ [protected]
 

Flag indicating whether the lazy decoding of the client exposed policies has taken place.

Definition at line 354 of file Profile.h.

Referenced by get_policies(), and policies().

TAO_MProfile* TAO_Profile::forward_to_ [private]
 

The TAO_MProfile which contains the profiles for the forwarded object.

Definition at line 376 of file Profile.h.

Referenced by forward_to(), and forward_to_i().

TAO_ORB_Core* const TAO_Profile::orb_core_ [private]
 

Pointer to the ORB core.

Definition at line 372 of file Profile.h.

TAO::Refcounted_ObjectKey* TAO_Profile::ref_object_key_ [protected]
 

object_key associated with this profile.

Definition at line 365 of file Profile.h.

Referenced by _key(), compare_key(), and object_key().

CORBA::ULong TAO_Profile::refcount_ [private]
 

Number of outstanding references to this object.

Definition at line 382 of file Profile.h.

ACE_Lock* TAO_Profile::refcount_lock_ [private]
 

Mutex to protect reference count.

Definition at line 379 of file Profile.h.

CORBA::ULong const TAO_Profile::tag_ [private]
 

IOP protocol tag.

Definition at line 369 of file Profile.h.

TAO_Tagged_Components TAO_Profile::tagged_components_ [protected]
 

The tagged components.

Definition at line 350 of file Profile.h.

Referenced by add_tagged_component(), decode(), get_policies(), policies(), set_tagged_components(), and tagged_components().

IOP::TaggedProfile* TAO_Profile::tagged_profile_ [protected]
 

Our tagged profile.

Definition at line 362 of file Profile.h.

Referenced by create_tagged_profile(), and ~TAO_Profile().

TAO_GIOP_Message_Version TAO_Profile::version_ [protected]
 

IIOP version number.

Definition at line 347 of file Profile.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:23:12 2006 for TAO by doxygen 1.3.6