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.
unsigned long _incr_refcnt (void)
 Increase the reference count by one on this object.
unsigned long _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::ObjectKey & object_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::TaggedProfile * create_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 (void)=0
virtual int encode_endpoints (void)=0
virtual int encode_alternate_endpoints (void)
virtual TAO_Endpointendpoint (void)=0
virtual TAO_Endpointbase_endpoint (void)
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::TaggedProfile * tagged_profile_
 Our tagged profile.
TAO::Refcounted_ObjectKey * ref_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)
void verify_profile_version (void)
 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_
TAO_Configurable_Refcount refcount_
 Number of outstanding references to this object.
TAO_SYNCH_MUTEX tagged_profile_lock_
 A lock that protects creation of the tagged profile.
bool tagged_profile_created_

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 54 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 53 of file Profile.cpp.

00056   : version_ (version)
00057     , are_policies_parsed_ (false)
00058     , addressing_mode_ (0)
00059     , tagged_profile_ (0)
00060     , ref_object_key_ (0)
00061     , tag_ (tag)
00062     , orb_core_ (orb_core)
00063     , forward_to_ (0)
00064     , refcount_ (this->orb_core_->
00065                    client_factory ()->create_profile_refcount ())
00066     , tagged_profile_lock_ ()
00067     , tagged_profile_created_ (false)
00068 {
00069 }

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

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

Definition at line 71 of file Profile.cpp.

References TAO_ORB_Core::object_key_table(), orb_core_, and tagged_profile_.

00072 {
00073   if (this->tagged_profile_)
00074     {
00075       delete this->tagged_profile_;
00076     }
00077 
00078   this->orb_core_->object_key_table ().unbind (this->ref_object_key_);
00079 
00080   //@@ TAO_PROFILE_SPL_DESTRUCTOR_ADD_HOOK
00081 }

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.

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_ (this->orb_core_->
00045                    client_factory ()->create_profile_refcount ())
00046     , tagged_profile_lock_ ()
00047     , tagged_profile_created_ (false)
00048 {
00049   (void) this->orb_core_->object_key_table ().bind (obj_key,
00050                                                     this->ref_object_key_);
00051 }

TAO_Profile::TAO_Profile ( const TAO_Profile  )  [private]


Member Function Documentation

ACE_INLINE unsigned long 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 74 of file Profile.inl.

References TAO_Configurable_Refcount::decrement(), and refcount_.

Referenced by 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_Stub::set_profile_in_use_i(), and TAO::Profile_Transport_Resolver::~Profile_Transport_Resolver().

00075 {
00076   unsigned long count = this->refcount_.decrement ();
00077   if (count != 0)
00078     return count;
00079 
00080   // refcount is 0, so delete us!
00081   // delete will call our ~ destructor which in turn deletes stuff.
00082   delete this;
00083   return 0;
00084 }

ACE_INLINE unsigned long TAO_Profile::_incr_refcnt ( void   ) 

Increase the reference count by one on this object.

Definition at line 68 of file Profile.inl.

References TAO_Configurable_Refcount::increment(), and refcount_.

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

00069 {
00070   return this->refcount_.increment ();
00071 }

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 108 of file Profile.cpp.

References ACE_NEW_RETURN.

00109 {
00110   TAO::ObjectKey *key = 0;
00111 
00112   if (this->ref_object_key_)
00113     {
00114       ACE_NEW_RETURN (key,
00115                       TAO::ObjectKey (this->ref_object_key_->object_key ()),
00116                       0);
00117     }
00118   return key;
00119 }

void TAO_Profile::add_generic_endpoint ( TAO_Endpoint ep  )  [virtual]

Add a protocol-agnostic endpoint.

Reimplemented in TAO_IIOP_Profile.

Definition at line 737 of file Profile.cpp.

00738 {
00739   // noop for the base type
00740 }

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

Add the given tagged component to the profile.

Definition at line 84 of file Profile.cpp.

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

00085 {
00086   // Sanity checks.
00087   this->verify_orb_configuration ();
00088 
00089   this->verify_profile_version ();
00090 
00091   // ----------------------------------------------------------------
00092 
00093   // Add the given tagged component to this profile.
00094   //
00095   // Note that multiple tagged profiles with the same tag value may be
00096   // added, unless the tagged component is known to be unique by TAO.
00097   this->tagged_components_.set_component (component);
00098 }

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 618 of file Profile.cpp.

References CORBA::SystemException::_tao_minor_code(), addressing_mode_, CORBA::COMPLETED_NO, TAO_Target_Specification::Key_Addr, TAO_Target_Specification::Profile_Addr, and TAO_Target_Specification::Reference_Addr.

00619 {
00620   // ** See race condition note about addressing mode in Profile.h **
00621   switch (addr)
00622     {
00623     case TAO_Target_Specification::Key_Addr:
00624     case TAO_Target_Specification::Profile_Addr:
00625     case TAO_Target_Specification::Reference_Addr:
00626       this->addressing_mode_ = addr;
00627       break;
00628 
00629     default:
00630       throw ::CORBA::BAD_PARAM (
00631              CORBA::SystemException::_tao_minor_code (
00632                0,
00633                EINVAL),
00634              CORBA::COMPLETED_NO);
00635     }
00636 }

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

References addressing_mode_.

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

00057 {
00058   return this->addressing_mode_;
00059 }

TAO_Endpoint * TAO_Profile::base_endpoint ( void   )  [virtual]

Return a pointer to this profile's endpoint. If the most derived profile type uses an endpoint that is a type that does not derive from the endpoint type of the base profile, then this method returns the base type's endpoint. For example, SSLIOP_Profile derives from IIOP_Profile, but SSLIOP_Endpoint does not derive from IIOP_Endpoint. Because SSLIOP is tagged the same as IIOP, this method is required to facilitate the Endpoint Policy's filtering function. The default implementation of base_endpoint simply returns endpoint.

Reimplemented in TAO_IIOP_Profile.

Definition at line 102 of file Profile.cpp.

References endpoint().

00103 {
00104   return this->endpoint();
00105 }

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 712 of file Profile.cpp.

References ref_object_key_.

Referenced by TAO_MProfile::give_shared_profile().

00713 {
00714   return (this->ref_object_key_ == other->ref_object_key_) ||
00715     ((this->ref_object_key_ != 0 &&
00716       other->ref_object_key_ != 0 &&
00717       this->ref_object_key_->object_key() ==
00718       other->ref_object_key_->object_key()));
00719 }

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 250 of file Profile.cpp.

References ACE_DEFAULT_CDR_BUFSIZE, ACE_GUARD_RETURN, ACE_NEW_RETURN, TAO_ORB_Parameters::cdr_memcpy_tradeoff(), create_profile_body(), ACE_OS::memcpy(), orb_core(), TAO_ORB_Core::orb_params(), TAO_ORB_Core::output_cdr_dblock_allocator(), TAO_ORB_Core::output_cdr_msgblock_allocator(), tag_, tagged_profile_, tagged_profile_created_, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, and TAO_SYNCH_MUTEX.

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

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

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 156 of file Profile.cpp.

References ACE_DEBUG, ACE_TEXT, 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(), TAO_debug_level, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, and version_.

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

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

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.

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.

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 123 of file Profile.cpp.

References TAO_ORB_Parameters::cdr_memcpy_tradeoff(), create_profile_body(), ACE_CDR::DEFAULT_BUFSIZE, ACE_OS::memset(), 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::write_octet_array_mb(), and ACE_OutputCDR::write_ulong().

00124 {
00125   // UNSIGNED LONG, protocol tag
00126   stream.write_ulong (this->tag_);
00127 
00128   // Create the encapsulation....
00129   TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE,
00130                        TAO_ENCAP_BYTE_ORDER,
00131                        this->orb_core ()->output_cdr_buffer_allocator (),
00132                        this->orb_core ()->output_cdr_dblock_allocator (),
00133                        this->orb_core ()->output_cdr_msgblock_allocator (),
00134                        this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (),
00135                        TAO_DEF_GIOP_MAJOR,
00136                        TAO_DEF_GIOP_MINOR);
00137 
00138 #if defined (TAO_ZERO_TAO_OUTPUTCDR_ALLOCATED_BUFFERS)
00139   // Support limited oref ACE_OS::strcmp
00140   (void) ACE_OS::memset (encap.current()->wr_ptr (),
00141                          0,
00142                          encap.current()->space ());
00143 #endif /* TAO_ZERO_TAO_OUTPUTCDR_ALLOCATED_BUFFERS */
00144 
00145   // Create the profile body
00146   this->create_profile_body (encap);
00147 
00148   // write the encapsulation as an octet sequence...
00149   stream << CORBA::ULong (encap.total_length ());
00150   stream.write_octet_array_mb (encap.begin ());
00151 
00152   return 1;
00153 }

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 763 of file Profile.cpp.

00764 {
00765   // this should be a pure virtual, but there are many
00766   // existing specializations that would need to be
00767   // modified. This maintains the existing behavior, since
00768   // the previous version of the POA did not gather alternate
00769   // endpoints.
00770 
00771   return 0;
00772 }

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 base_endpoint(), 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 722 of file Profile.cpp.

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

Referenced by next_filtered_endpoint().

00723 {
00724   TAO_Endpoint *ep = this->endpoint();
00725   return ep == 0 ? 0 : ep->next_filtered(this->orb_core_,0);
00726 }

ACE_INLINE TAO_MProfile * TAO_Profile::forward_to ( void   ) 

MProfile accessor.

Definition at line 32 of file Profile.inl.

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

References forward_to_.

Referenced by 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.inl.

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 431 of file Profile.cpp.

References TAO_Objref_Var_T< T >::_retn(), ACE_DEBUG, ACE_TEXT, TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), LM_DEBUG, and TAO_debug_level.

Referenced by TAO_MProfile::init_policy_list().

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

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.

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

Definition at line 750 of file Profile.cpp.

References TAO_ORB_Core::hash_service(), and orb_core_.

Referenced by TAO_IIOP_Profile::hash().

00751 {
00752   return this->orb_core_->hash_service (this, m);
00753 }

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 686 of file Profile.cpp.

References do_is_equivalent(), TAO_Service_Callbacks::DONT_KNOW, endpoint_count(), TAO_Service_Callbacks::EQUIVALENT, is_equivalent_hook(), TAO_Service_Callbacks::NOT_EQUIVALENT, object_key(), tag(), version(), and version_.

Referenced by TAO_Stub::is_equivalent().

00687 {
00688   CORBA::Boolean result = false;
00689   if (other)
00690     {
00691       TAO_Service_Callbacks::Profile_Equivalence callback
00692         = this->is_equivalent_hook (other);
00693       switch (callback)
00694         {
00695           case TAO_Service_Callbacks::DONT_KNOW:
00696             return this->tag () == other->tag ()
00697                 && this->version_ == other->version ()
00698                 && this->endpoint_count () == other->endpoint_count ()
00699                 && this->object_key () == other->object_key ()
00700                 && this->do_is_equivalent (other);
00701           case TAO_Service_Callbacks::EQUIVALENT:
00702             result = true;
00703             break;
00704           case TAO_Service_Callbacks::NOT_EQUIVALENT:
00705             break;
00706         }
00707     }
00708   return result;
00709 }

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 743 of file Profile.cpp.

References TAO_ORB_Core::is_profile_equivalent(), and orb_core_.

Referenced by is_equivalent().

00744 {
00745   // Allow services to apply their own definition of "equivalence."
00746   return this->orb_core_->is_profile_equivalent (this, other);
00747 }

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 729 of file Profile.cpp.

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

00730 {
00731   if (source == 0)
00732     return this->first_filtered_endpoint();
00733   return source->next_filtered(this->orb_core_,this->endpoint());
00734 }

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

Deprecated:
Return a reference to the Object Key.

Definition at line 62 of file Profile.inl.

References 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.inl.

References orb_core_.

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

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 639 of file Profile.cpp.

References CORBA::SystemException::_tao_minor_code(), ACE_OS::ace_isdigit(), CORBA::COMPLETED_NO, parse_string_i(), TAO_GIOP_Message_Version::set_version(), TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, and version_.

Referenced by TAO_Connector::make_mprofile().

00640 {
00641   if (!ior || !*ior)
00642     {
00643       throw ::CORBA::INV_OBJREF (
00644                    CORBA::SystemException::_tao_minor_code (
00645                      0,
00646                      EINVAL),
00647                    CORBA::COMPLETED_NO);
00648     }
00649 
00650   // Remove the "N.n@" version prefix, if it exists, and verify the
00651   // version is one that we accept.
00652 
00653   // Check for version
00654   if (ACE_OS::ace_isdigit (ior [0]) &&
00655       ior[1] == '.' &&
00656       ACE_OS::ace_isdigit (ior [2]) &&
00657       ior[3] == '@')
00658     {
00659       // @@ This may fail for non-ascii character sets [but take that
00660       // with a grain of salt]
00661       this->version_.set_version ((char) (ior[0] - '0'),
00662                                   (char) (ior[2] - '0'));
00663       ior += 4;
00664       // Skip over the "N.n@"
00665     }
00666   else
00667     {
00668       // CORBA spec requires 1.0 if a version isn't specified.
00669       this->version_.set_version (1, 0);
00670     }
00671 
00672   if (this->version_.major != TAO_DEF_GIOP_MAJOR ||
00673       this->version_.minor >  TAO_DEF_GIOP_MINOR)
00674     {
00675       throw ::CORBA::INV_OBJREF (
00676                    CORBA::SystemException::_tao_minor_code (
00677                      0,
00678                      EINVAL),
00679                    CORBA::COMPLETED_NO);
00680     }
00681 
00682   this->parse_string_i (ior);
00683 }

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 338 of file Profile.cpp.

References ACE_DEBUG, ACE_TEXT, are_policies_parsed_, ACE_OutputCDR::begin(), ACE_Message_Block::cont(), LM_DEBUG, ACE_OS::memcpy(), TAO_Tagged_Components::set_component(), tagged_components_, TAO_debug_level, TAO_ENCAP_BYTE_ORDER, and ACE_OutputCDR::total_length().

Referenced by TAO_ORB_Core::create_stub_object().

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

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 775 of file Profile.cpp.

00776 {
00777   // default for virtual methods, thus a no-op
00778 }

void TAO_Profile::set_tagged_components ( TAO_OutputCDR cdr  )  [protected]

Helper method that encodes the endpoints for RTCORBA as tagged_components.

Definition at line 311 of file Profile.cpp.

References ACE_OutputCDR::begin(), ACE_Message_Block::cont(), ACE_OS::memcpy(), TAO_Tagged_Components::set_component(), tagged_components_, TAO_TAG_ENDPOINTS, and ACE_OutputCDR::total_length().

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

int TAO_Profile::supports_multicast ( void   )  const [virtual]

Returns true if this profile can specify multicast endpoints.

Definition at line 605 of file Profile.cpp.

00606 {
00607   // Most profiles do not support multicast endpoints.
00608   return 0;
00609 }

bool TAO_Profile::supports_non_blocking_oneways ( void   )  const [virtual]

Returns true if this profile supports non blocking oneways.

Definition at line 612 of file Profile.cpp.

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

00613 {
00614   return !(this->version_.major == 1 && this->version_.minor == 0);
00615 }

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

References tag_.

Referenced by TAO_IIOP_Acceptor::create_shared_profile(), TAO_IIOP_Profile::decode_endpoints(), 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.inl.

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

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 ( void   )  [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 ( void   )  [private]

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

Definition at line 541 of file Profile.cpp.

References CORBA::SystemException::_tao_minor_code(), CORBA::ORB::_use_omg_ior_format(), ACE_ERROR, ACE_TEXT, CORBA::COMPLETED_NO, LM_ERROR, TAO_ORB_Core::orb(), orb_core_, and TAO_debug_level.

Referenced by add_tagged_component().

00542 {
00543   // If the ORB isn't configured to support tagged components, then
00544   // throw an exception.
00545   if (this->orb_core_->orb_params ()->std_profile_components () == 0
00546       || !this->orb_core_->orb ()->_use_omg_ior_format ())
00547     {
00548       if (TAO_debug_level > 0)
00549         {
00550           ACE_ERROR ((LM_ERROR,
00551                       ACE_TEXT ("(%P|%t) Cannot add ")
00552                       ACE_TEXT ("IOP::TaggedComponent to profile.\n")
00553                       ACE_TEXT ("(%P|%t) Standard profile components ")
00554                       ACE_TEXT ("have been disabled or URL style IORs\n")
00555                       ACE_TEXT ("(%P|%t) are in use.  Try ")
00556                       ACE_TEXT ("\"-ORBStdProfileComponents 1\" and/or\n")
00557                       ACE_TEXT ("(%P|%t) \"-ORBObjRefStyle IOR\".\n")));
00558         }
00559 
00560       // According to the Portable Interceptor specification, we're
00561       // supposed to throw a CORBA::BAD_PARAM exception if it isn't
00562       // possible to add components to the profile.
00563       // @todo: We need the proper minor code as soon as the spec is
00564       //        updated.
00565       throw ::CORBA::BAD_PARAM (
00566                    CORBA::SystemException::_tao_minor_code (
00567                       0,
00568                       EINVAL),
00569                    CORBA::COMPLETED_NO);
00570     }
00571 }

void TAO_Profile::verify_profile_version ( void   )  [private]

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

Definition at line 574 of file Profile.cpp.

References CORBA::SystemException::_tao_minor_code(), ACE_ERROR, ACE_TEXT, CORBA::COMPLETED_NO, LM_ERROR, and TAO_debug_level.

Referenced by add_tagged_component().

00575 {
00576   // GIOP 1.0 does not support tagged components.  Throw an exception
00577   // if the profile is a GIOP 1.0 profile.
00578 
00579   if (this->version_.major == 1 && this->version_.minor == 0)
00580     {
00581       if (TAO_debug_level > 0)
00582         {
00583           ACE_ERROR ((LM_ERROR,
00584                       ACE_TEXT ("(%P|%t) Cannot add ")
00585                       ACE_TEXT ("IOP::TaggedComponent to GIOP 1.0")
00586                       ACE_TEXT ("IOR profile.\n")
00587                       ACE_TEXT ("(%P|%t) Try using a GIOP 1.1 or ")
00588                       ACE_TEXT ("greater endpoint.\n")));
00589         }
00590 
00591       // According to the Portable Interceptor specification, we're
00592       // supposed to throw a CORBA::BAD_PARAM exception if it isn't
00593       // possible to add components to the profile.
00594       // @todo: We need the proper minor code as soon as the spec is
00595       //        updated.
00596       throw ::CORBA::BAD_PARAM (
00597                    CORBA::SystemException::_tao_minor_code (
00598                      0,
00599                      EINVAL),
00600                    CORBA::COMPLETED_NO);
00601     }
00602 }

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

References version_.

Referenced by is_equivalent(), TAO_IIOP_Profile::parse_string_i(), and TAO::Profile_Transport_Resolver::resolve().

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 366 of file Profile.h.

Referenced by addressing_mode().

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 361 of file Profile.h.

Referenced by policies().

TAO_MProfile* TAO_Profile::forward_to_ [private]

The TAO_MProfile which contains the profiles for the forwarded object.

Definition at line 383 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 379 of file Profile.h.

Referenced by hash_service_i(), is_equivalent_hook(), orb_core(), TAO_Muxed_TMS::TAO_Muxed_TMS(), verify_orb_configuration(), and ~TAO_Profile().

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

Object_key associated with this profile.

Definition at line 372 of file Profile.h.

Referenced by compare_key(), TAO_IIOP_Profile::create_profile_body(), TAO_IIOP_Profile::hash(), object_key(), and TAO_IIOP_Profile::to_string().

TAO_Configurable_Refcount TAO_Profile::refcount_ [private]

Number of outstanding references to this object.

Definition at line 386 of file Profile.h.

Referenced by _decr_refcnt(), and _incr_refcnt().

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

IOP protocol tag.

Definition at line 376 of file Profile.h.

Referenced by create_tagged_profile(), and tag().

TAO_Tagged_Components TAO_Profile::tagged_components_ [protected]

The tagged components.

Definition at line 357 of file Profile.h.

Referenced by add_tagged_component(), TAO_IIOP_Profile::decode_endpoints(), TAO_IIOP_Profile::encode_alternate_endpoints(), policies(), set_tagged_components(), and tagged_components().

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

Our tagged profile.

Definition at line 369 of file Profile.h.

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

bool TAO_Profile::tagged_profile_created_ [private]

Having (tagged_profile_ != 0) doesn't mean yet that tagged_profile_ building is finished.

Definition at line 393 of file Profile.h.

Referenced by create_tagged_profile().

TAO_SYNCH_MUTEX TAO_Profile::tagged_profile_lock_ [private]

A lock that protects creation of the tagged profile.

Definition at line 389 of file Profile.h.

TAO_GIOP_Message_Version TAO_Profile::version_ [protected]

IIOP version number.

Definition at line 354 of file Profile.h.

Referenced by decode(), TAO_IIOP_Profile::hash(), is_equivalent(), parse_string(), supports_non_blocking_oneways(), and version().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:43 2010 for TAO by  doxygen 1.4.7