#include <Profile.h>
Inheritance diagram for TAO_Profile:


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_Version & | version (void) const |
| TAO_ORB_Core * | orb_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_MProfile * | forward_to (void) |
| MProfile accessor. | |
| const TAO_Tagged_Components & | tagged_components (void) const |
| TAO_Tagged_Components & | tagged_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_Endpoint * | endpoint (void)=0 |
| virtual TAO_Endpoint * | base_endpoint (void) |
| virtual CORBA::ULong | endpoint_count (void) const=0 |
| Return how many endpoints this profile contains. | |
| TAO_Endpoint * | first_filtered_endpoint (void) |
| TAO_Endpoint * | next_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_MProfile * | forward_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_MProfile * | forward_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_ |
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.
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 } |
|
|
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(), tagged_profile_, and TAO::ObjectKey_Table::unbind().
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 }
|
|
||||||||||||||||||||
|
To be used by inherited classes.
Definition at line 32 of file Profile.cpp. References TAO::ObjectKey_Table::bind(), 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_ (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 } |
|
|
|
|
|
Decrement the object's reference count. When this count goes to 0 this object will be deleted. Definition at line 90 of file Profile.cpp. References TAO_Configurable_Refcount::decrement(). 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::Profile_Transport_Resolver::~Profile_Transport_Resolver(), and TAO_Stub::~TAO_Stub().
|
|
|
Increase the reference count by one on this object.
Definition at line 84 of file Profile.cpp. References TAO_Configurable_Refcount::increment(). Referenced by TAO::Profile_Transport_Resolver::profile(), TAO_MProfile::set(), and TAO_Stub::set_profile_in_use_i().
|
|
|
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 127 of file Profile.cpp. References ACE_NEW_RETURN, and ref_object_key_. Referenced by CORBA::Object::_key().
00128 {
00129 TAO::ObjectKey *key = 0;
00130
00131 if (this->ref_object_key_)
00132 {
00133 ACE_NEW_RETURN (key,
00134 TAO::ObjectKey (this->ref_object_key_->object_key ()),
00135 0);
00136 }
00137 return key;
00138 }
|
|
|
Add a protocol-agnostic endpoint.
Reimplemented in TAO_IIOP_Profile. Definition at line 756 of file Profile.cpp. Referenced by TAO_MProfile::give_shared_profile().
00757 {
00758 // noop for the base type
00759 }
|
|
|
Add the given tagged component to the profile.
Definition at line 103 of file Profile.cpp. References TAO_Tagged_Components::set_component(), tagged_components_, verify_orb_configuration(), and verify_profile_version().
00104 {
00105 // Sanity checks.
00106 this->verify_orb_configuration ();
00107
00108 this->verify_profile_version ();
00109
00110 // ----------------------------------------------------------------
00111
00112 // Add the given tagged component to this profile.
00113 //
00114 // Note that multiple tagged profiles with the same tag value may be
00115 // added, unless the tagged component is known to be unique by TAO.
00116 this->tagged_components_.set_component (component);
00117 }
|
|
|
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 637 of file Profile.cpp.
00638 {
00639 // ** See race condition note about addressing mode in Profile.h **
00640 switch (addr)
00641 {
00642 case TAO_Target_Specification::Key_Addr:
00643 case TAO_Target_Specification::Profile_Addr:
00644 case TAO_Target_Specification::Reference_Addr:
00645 this->addressing_mode_ = addr;
00646 break;
00647
00648 default:
00649 throw ::CORBA::BAD_PARAM (
00650 CORBA::SystemException::_tao_minor_code (
00651 0,
00652 EINVAL),
00653 CORBA::COMPLETED_NO);
00654 }
00655 }
|
|
|
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. Referenced by TAO::Remote_Invocation::init_target_spec().
00057 {
00058 return this->addressing_mode_;
00059 }
|
|
|
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 121 of file Profile.cpp. References endpoint().
00122 {
00123 return this->endpoint();
00124 }
|
|
|
Compare the object key for this profile with that of another. This is weaker than is_equivalent Definition at line 731 of file Profile.cpp. References TAO::Refcounted_ObjectKey::object_key(), and ref_object_key_. Referenced by TAO_MProfile::give_shared_profile().
00732 {
00733 return (this->ref_object_key_ == other->ref_object_key_) ||
00734 ((this->ref_object_key_ != 0 &&
00735 other->ref_object_key_ != 0 &&
00736 this->ref_object_key_->object_key() ==
00737 other->ref_object_key_->object_key()));
00738 }
|
|
|
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(). |
|
|
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 269 of file Profile.cpp. References ACE_DEFAULT_CDR_BUFSIZE, ACE_GUARD_RETURN, ACE_NEW_RETURN, ACE_OutputCDR::begin(), TAO_ORB_Parameters::cdr_memcpy_tradeoff(), create_profile_body(), ACE_OutputCDR::end(), ACE_Message_Block::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(), IOP::TaggedProfile::tag, tagged_profile_, tagged_profile_created_, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, TAO_SYNCH_MUTEX, and ACE_OutputCDR::total_length(). Referenced by TAO_Stub::get_profile_ior_info(), and TAO::Remote_Invocation::init_target_spec().
00270 {
00271 if (this->tagged_profile_created_)
00272 return this->tagged_profile_;
00273
00274 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
00275 guard,
00276 this->tagged_profile_lock_,
00277 this->tagged_profile_);
00278
00279 // .. DCL
00280 if (!this->tagged_profile_created_)
00281 {
00282 ACE_NEW_RETURN (this->tagged_profile_,
00283 IOP::TaggedProfile,
00284 0);
00285
00286 // As we have not created we will now create the TaggedProfile
00287 this->tagged_profile_->tag = this->tag_;
00288
00289 // Create the encapsulation....
00290 TAO_OutputCDR encap (ACE_DEFAULT_CDR_BUFSIZE,
00291 TAO_ENCAP_BYTE_ORDER,
00292 this->orb_core ()->output_cdr_buffer_allocator (),
00293 this->orb_core ()->output_cdr_dblock_allocator (),
00294 this->orb_core ()->output_cdr_msgblock_allocator (),
00295 this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (),
00296 TAO_DEF_GIOP_MAJOR,
00297 TAO_DEF_GIOP_MINOR);
00298
00299 // Create the profile body
00300 this->create_profile_body (encap);
00301
00302 CORBA::ULong const length =
00303 static_cast <CORBA::ULong> (encap.total_length ());
00304
00305 #if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
00306 // Place the message block in to the Sequence of Octets that we
00307 // have
00308 this->tagged_profile_->profile_data.replace (length, encap.begin ());
00309 #else
00310 this->tagged_profile_->profile_data.length (length);
00311 CORBA::Octet *buffer =
00312 this->tagged_profile_->profile_data.get_buffer ();
00313
00314 for (const ACE_Message_Block *i = encap.begin ();
00315 i != encap.end ();
00316 i = i->next ())
00317 {
00318 ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ());
00319 buffer += i->length ();
00320 }
00321 #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
00322
00323 this->tagged_profile_created_ = true;
00324 }
00325
00326 return this->tagged_profile_;
00327 }
|
|
|
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 #if !defined (ACE_NLOGGING)
00178 size_t const encap_len = cdr.length ();
00179 #endif
00180
00181 // Read and verify major, minor versions, ignoring profiles
00182 // whose versions we don't understand.
00183 if (!(cdr.read_octet (this->version_.major)
00184 && this->version_.major == TAO_DEF_GIOP_MAJOR
00185 && cdr.read_octet (this->version_.minor)
00186 && this->version_.minor <= TAO_DEF_GIOP_MINOR))
00187 {
00188 if (TAO_debug_level > 0)
00189 {
00190 ACE_DEBUG ((LM_DEBUG,
00191 ACE_TEXT ("TAO (%P|%t) - Profile::decode - v%d.%d\n"),
00192 this->version_.major,
00193 this->version_.minor));
00194 }
00195
00196 return -1;
00197 }
00198
00199 // Transport specific details
00200 if (this->decode_profile (cdr) < 0)
00201 {
00202 return -1;
00203 }
00204
00205 // @@NOTE: This place *may* need strategizing. Here are the
00206 // issues. Placing the ObjectKey in the table adds an allocation and
00207 // a lock while decoding. This is bad for some cases especially if
00208 // the application is marshalling object references across to the
00209 // server end. But the server could use "lazy" evaluation and avoid
00210 // this during marshalling.
00211 //
00212 // The only place this will get important is when a thead tries to
00213 // use the object reference to create a CORBA object to make an
00214 // invocation. Since creation of a CORBA object itself is expensive,
00215 // it looks like we may not need to worry much.
00216 //
00217 // Remember strategizing needs reconciliation of forces imposed
00218 // by runtime memory growth. Doing a random strategization would
00219 // destroy the wins in runtime memory growth got by using this
00220 // table scheme.
00221 TAO::ObjectKey ok;
00222
00223 // ... and object key.
00224 if (TAO::ObjectKey::demarshal_key (ok,
00225 cdr) == 0)
00226 {
00227 return -1;
00228 }
00229
00230 TAO::ObjectKey_Table &okt = this->orb_core ()->object_key_table ();
00231
00232 if (okt.bind (ok, this->ref_object_key_) == -1)
00233 {
00234 return -1;
00235 }
00236
00237 // Tagged Components *only* exist after version 1.0!
00238 // For GIOP 1.2, IIOP and GIOP have same version numbers!
00239 if (this->version_.major > 1
00240 || this->version_.minor > 0)
00241 {
00242 if (this->tagged_components_.decode (cdr) == 0)
00243 {
00244 return -1;
00245 }
00246 }
00247
00248 if (cdr.length () != 0 && TAO_debug_level)
00249 {
00250 // If there is extra data in the profile we are supposed to
00251 // ignore it, but print a warning just in case...
00252 ACE_DEBUG ((LM_DEBUG,
00253 ACE_TEXT ("%d bytes out of %d left after profile data\n"),
00254 cdr.length (),
00255 encap_len));
00256 }
00257
00258 // Decode any additional endpoints per profile. This is used by RTCORBA
00259 // and by IIOP when TAG_ALTERNATE_IIOP_ADDRESS components are present.
00260 if (this->decode_endpoints () == -1)
00261 {
00262 return -1;
00263 }
00264
00265 return 1;
00266 }
|
|
|
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(). |
|
|
Decode the protocol specific profile details.
Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile. Referenced by decode(). |
|
|
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(). |
|
|
Encode this profile in a stream, i.e. marshal it.
Reimplemented in TAO_Unknown_Profile. Definition at line 142 of file Profile.cpp. References ACE_OutputCDR::begin(), TAO_ORB_Parameters::cdr_memcpy_tradeoff(), create_profile_body(), ACE_OutputCDR::current(), ACE_OS::memset(), orb_core(), TAO_ORB_Core::orb_params(), TAO_ORB_Core::output_cdr_dblock_allocator(), TAO_ORB_Core::output_cdr_msgblock_allocator(), ACE_Message_Block::space(), TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, ACE_OutputCDR::total_length(), CORBA::ULong, ACE_Message_Block::wr_ptr(), ACE_OutputCDR::write_octet_array_mb(), and ACE_OutputCDR::write_ulong(). Referenced by TAO_Stub::marshal().
00143 {
00144 // UNSIGNED LONG, protocol tag
00145 stream.write_ulong (this->tag_);
00146
00147 // Create the encapsulation....
00148 TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE,
00149 TAO_ENCAP_BYTE_ORDER,
00150 this->orb_core ()->output_cdr_buffer_allocator (),
00151 this->orb_core ()->output_cdr_dblock_allocator (),
00152 this->orb_core ()->output_cdr_msgblock_allocator (),
00153 this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (),
00154 TAO_DEF_GIOP_MAJOR,
00155 TAO_DEF_GIOP_MINOR);
00156
00157 #if defined (TAO_ZERO_TAO_OUTPUTCDR_ALLOCATED_BUFFERS)
00158 // Support limited oref ACE_OS::strcmp
00159 (void) ACE_OS::memset (encap.current()->wr_ptr (),
00160 0,
00161 encap.current()->space ());
00162 #endif /* TAO_ZERO_TAO_OUTPUTCDR_ALLOCATED_BUFFERS */
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 }
|
|
|
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 782 of file Profile.cpp.
00783 {
00784 // this should be a pure virtual, but there are many
00785 // existing specializations that would need to be
00786 // modified. This maintains the existing behavior, since
00787 // the previous version of the POA did not gather alternate
00788 // endpoints.
00789
00790 return 0;
00791 }
|
|
|
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. |
|
|
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(). |
|
|
Return how many endpoints this profile contains.
Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile. Referenced by is_equivalent(). |
|
|
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 741 of file Profile.cpp. References endpoint(), and TAO_Endpoint::next_filtered(). Referenced by next_filtered_endpoint().
00742 {
00743 TAO_Endpoint *ep = this->endpoint();
00744 return ep == 0 ? 0 : ep->next_filtered(this->orb_core_,0);
00745 }
|
|
|
MProfile accessor.
Definition at line 32 of file Profile.inl. References forward_to_.
00033 {
00034 return this->forward_to_;
00035 }
|
|
|
Keep a pointer to the forwarded profile.
Definition at line 26 of file Profile.inl. References forward_to_. Referenced by TAO_Stub::add_forward_profiles(), and TAO_Stub::forward_back_one().
00027 {
00028 this->forward_to_ = mprofiles;
00029 }
|
|
|
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 }
|
|
|
Accessor for the client exposed policies of this profile.
Definition at line 450 of file Profile.cpp. References CORBA::ORB::_create_policy(), TAO_Objref_Var_T< T >::_retn(), ACE_DEBUG, ACE_TEXT, are_policies_parsed_, IOP::TaggedComponent::component_data, TAO_Tagged_Components::get_component(), TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), LM_DEBUG, TAO_ORB_Core::orb(), CORBA::Policy_var, CORBA::PolicyList, Messaging::PolicyValueSeq, ACE_InputCDR::reset_byte_order(), IOP::TaggedComponent::tag, tagged_components_, and TAO_debug_level. Referenced by TAO_MProfile::init_policy_list().
00451 {
00452 #if (TAO_HAS_CORBA_MESSAGING == 1) && !defined (CORBA_E_MICRO)
00453
00454 if (!this->are_policies_parsed_)
00455 // None has already parsed the policies.
00456 {
00457 IOP::TaggedComponent tagged_component;
00458 tagged_component.tag = Messaging::TAG_POLICIES;
00459
00460 // This gets a component with the proper "tag" field
00461 // if it exists.
00462 if (this->tagged_components_.get_component (tagged_component))
00463 {
00464 const CORBA::Octet *buf =
00465 tagged_component.component_data.get_buffer ();
00466
00467 TAO_InputCDR in_cdr (reinterpret_cast <const char *> (buf),
00468 tagged_component.component_data.length ());
00469
00470 // Extract the Byte Order
00471 CORBA::Boolean byte_order;
00472
00473 if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
00474 {
00475 return ;
00476 }
00477
00478 in_cdr.reset_byte_order (static_cast <int> (byte_order));
00479
00480 // Now we take out the Messaging::PolicyValueSeq out from the
00481 // CDR.
00482 Messaging::PolicyValueSeq policy_value_seq;
00483
00484 if (!(in_cdr >> policy_value_seq))
00485 {
00486 throw ::CORBA::INV_OBJREF ();
00487 }
00488
00489 // Here we extract the Messaging::PolicyValue out of the sequence
00490 // and we convert those into the proper CORBA::Policy
00491
00492 CORBA::Policy_var policy;
00493 CORBA::ULong const length = policy_value_seq.length ();
00494
00495 // Set the policy list length.
00496 pl.length (length);
00497
00498 for (CORBA::ULong i = 0; i < length; ++i)
00499 {
00500 try
00501 {
00502 policy =
00503 this->orb_core_->orb ()->_create_policy (
00504 policy_value_seq[i].ptype);
00505
00506 if (!CORBA::is_nil (policy.in ()))
00507 {
00508 buf = policy_value_seq[i].pvalue.get_buffer ();
00509
00510 TAO_InputCDR in_cdr (
00511 reinterpret_cast <const char*> (buf),
00512 policy_value_seq[i].pvalue.length ());
00513
00514 if (!(in_cdr >> ACE_InputCDR::to_boolean (byte_order)))
00515 throw ::CORBA::INV_OBJREF ();
00516
00517 in_cdr.reset_byte_order (static_cast <int> (byte_order));
00518
00519 policy->_tao_decode (in_cdr);
00520 pl[i] = policy._retn ();
00521 }
00522 else
00523 {
00524 // This case should occure when in the IOR are
00525 // embedded policies that TAO doesn't support,
00526 // so as specified by the RT-CORBA
00527 // spec. ptc/99-05-03 we just ignore these
00528 // un-understood policies.
00529
00530 if (TAO_debug_level >= 5)
00531 ACE_DEBUG ((LM_DEBUG,
00532 ACE_TEXT ("The IOR contains unsupported ")
00533 ACE_TEXT ("policies.\n")));
00534 }
00535 }
00536 catch (const ::CORBA::Exception& ex)
00537 {
00538 // This case should occur when in the IOR are
00539 // embedded policies that TAO doesn't support, so as
00540 // specified by the RT-CORBA spec. ptc/99-05-03 we
00541 // just ignore these un-understood policies.
00542
00543 if (TAO_debug_level >= 5)
00544 ex._tao_print_exception (
00545 ACE_TEXT ("IOR contains ")
00546 ACE_TEXT ("unsupported policies."));
00547 }
00548 }
00549 }
00550 }
00551
00552 #else
00553 ACE_UNUSED_ARG (pl);
00554 #endif /* (TAO_HAS_CORBA_MESSAGING == 1) */
00555
00556 }
|
|
|
Return a hash value for this object.
Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile. Referenced by TAO_MProfile::hash(). |
|
|
Definition at line 769 of file Profile.cpp. References TAO_ORB_Core::hash_service(). Referenced by TAO_IIOP_Profile::hash().
00770 {
00771 return this->orb_core_->hash_service (this, m);
00772 }
|
|
|
Verify profile equivalance. Two profiles are equivalent if their tag, object_key, version and all endpoints are the same.
Definition at line 705 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().
00706 {
00707 CORBA::Boolean result = false;
00708 if (other)
00709 {
00710 TAO_Service_Callbacks::Profile_Equivalence callback
00711 = this->is_equivalent_hook (other);
00712 switch (callback)
00713 {
00714 case TAO_Service_Callbacks::DONT_KNOW:
00715 return this->tag () == other->tag ()
00716 && this->version_ == other->version ()
00717 && this->endpoint_count () == other->endpoint_count ()
00718 && this->object_key () == other->object_key ()
00719 && this->do_is_equivalent (other);
00720 case TAO_Service_Callbacks::EQUIVALENT:
00721 result = true;
00722 break;
00723 case TAO_Service_Callbacks::NOT_EQUIVALENT:
00724 break;
00725 }
00726 }
00727 return result;
00728 }
|
|
|
Allow services to apply their own definition of "equivalence.".
This method differs from the Reimplemented in TAO_Unknown_Profile. Definition at line 762 of file Profile.cpp. References TAO_ORB_Core::is_profile_equivalent(). Referenced by is_equivalent().
00763 {
00764 // Allow services to apply their own definition of "equivalence."
00765 return this->orb_core_->is_profile_equivalent (this, other);
00766 }
|
|
|
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 748 of file Profile.cpp. References first_filtered_endpoint(), and TAO_Endpoint::next_filtered().
00749 {
00750 if (source == 0)
00751 return this->first_filtered_endpoint();
00752 return source->next_filtered(this->orb_core_,this->endpoint());
00753 }
|
|
|
Definition at line 62 of file Profile.inl. 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 }
|
|
|
The object key delimiter.
Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile. |
|
|
|
|
|
Get a pointer to the TAO_ORB_Core.
Definition at line 20 of file Profile.inl. 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 }
|
|
|
Initialize this object using the given input string. Supports URL style of object references Reimplemented in TAO_Unknown_Profile. Definition at line 658 of file Profile.cpp. References ACE_OS::ace_isdigit(), 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().
00659 {
00660 if (!ior || !*ior)
00661 {
00662 throw ::CORBA::INV_OBJREF (
00663 CORBA::SystemException::_tao_minor_code (
00664 0,
00665 EINVAL),
00666 CORBA::COMPLETED_NO);
00667 }
00668
00669 // Remove the "N.n@" version prefix, if it exists, and verify the
00670 // version is one that we accept.
00671
00672 // Check for version
00673 if (ACE_OS::ace_isdigit (ior [0]) &&
00674 ior[1] == '.' &&
00675 ACE_OS::ace_isdigit (ior [2]) &&
00676 ior[3] == '@')
00677 {
00678 // @@ This may fail for non-ascii character sets [but take that
00679 // with a grain of salt]
00680 this->version_.set_version ((char) (ior[0] - '0'),
00681 (char) (ior[2] - '0'));
00682 ior += 4;
00683 // Skip over the "N.n@"
00684 }
00685 else
00686 {
00687 // CORBA spec requires 1.0 if a version isn't specified.
00688 this->version_.set_version (1, 0);
00689 }
00690
00691 if (this->version_.major != TAO_DEF_GIOP_MAJOR ||
00692 this->version_.minor > TAO_DEF_GIOP_MINOR)
00693 {
00694 throw ::CORBA::INV_OBJREF (
00695 CORBA::SystemException::_tao_minor_code (
00696 0,
00697 EINVAL),
00698 CORBA::COMPLETED_NO);
00699 }
00700
00701 this->parse_string_i (ior);
00702 }
|
|
|
Protocol specific implementation of parse_string ().
Implemented in TAO_IIOP_Profile, and TAO_Unknown_Profile. Referenced by parse_string(). |
|
|
This method sets the client exposed policies, i.e., the ones propagated in the IOR, for this profile. Definition at line 357 of file Profile.cpp. References ACE_DEBUG, ACE_TEXT, are_policies_parsed_, ACE_OutputCDR::begin(), IOP::TaggedComponent::component_data, ACE_Message_Block::cont(), ACE_Message_Block::length(), LM_DEBUG, ACE_OS::memcpy(), CORBA::PolicyList, Messaging::PolicyValueSeq, 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().
00358 {
00359 #if (TAO_HAS_CORBA_MESSAGING == 1)
00360
00361 if (policy_list == 0)
00362 {
00363 if (TAO_debug_level)
00364 {
00365 ACE_DEBUG ((LM_DEBUG,
00366 ACE_TEXT ("TAO_Profile::policies: ")
00367 ACE_TEXT ("Null Policy List!\n")));
00368 }
00369
00370 return;
00371 }
00372
00373 Messaging::PolicyValue pv;
00374 Messaging::PolicyValueSeq policy_value_seq;
00375
00376 size_t length;
00377 CORBA::Octet *buf = 0;
00378
00379 policy_value_seq.length (policy_list->length ());
00380
00381 // This loop iterates through CORBA::PolicyList to convert
00382 // each CORBA::Policy into a CORBA::PolicyValue
00383 const size_t plen = policy_list->length ();
00384
00385 for (CORBA::ULong i = 0; i < plen; ++i)
00386 {
00387 TAO_OutputCDR out_CDR;
00388 policy_value_seq[i].ptype =
00389 (*policy_list)[i]->policy_type ();
00390
00391 out_CDR << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
00392 (*policy_list)[i]->_tao_encode (out_CDR);
00393
00394 length = out_CDR.total_length ();
00395 policy_value_seq[i].pvalue.length (static_cast <CORBA::ULong>(length));
00396
00397 buf = policy_value_seq[i].pvalue.get_buffer ();
00398
00399 // Copy the CDR buffer data into the octet sequence buffer.
00400
00401 for (const ACE_Message_Block *iterator = out_CDR.begin ();
00402 iterator != 0;
00403 iterator = iterator->cont ())
00404 {
00405 ACE_OS::memcpy (buf, iterator->rd_ptr (), iterator->length ());
00406 buf += iterator->length ();
00407 }
00408 }
00409
00410 TAO_OutputCDR out_cdr;
00411 // Now we have to embed the Messaging::PolicyValueSeq into
00412 // a TaggedComponent.
00413
00414 IOP::TaggedComponent tagged_component;
00415 tagged_component.tag = Messaging::TAG_POLICIES;
00416
00417 out_cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
00418 out_cdr << policy_value_seq;
00419
00420 length = out_cdr.total_length ();
00421
00422 tagged_component.component_data.length (static_cast <CORBA::ULong>(length));
00423 buf = tagged_component.component_data.get_buffer ();
00424
00425 for (const ACE_Message_Block *iterator = out_cdr.begin ();
00426 iterator != 0;
00427 iterator = iterator->cont ())
00428 {
00429 size_t const i_length = iterator->length ();
00430 ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
00431
00432 buf += i_length;
00433 }
00434
00435 // Eventually we add the TaggedComponent to the TAO_TaggedComponents
00436 // member variable.
00437 tagged_components_.set_component (tagged_component);
00438 this->are_policies_parsed_ = true;
00439
00440 #else /* TAO_HAS_CORBA_MESSAGING == 1 */
00441
00442 ACE_UNUSED_ARG (policy_list);
00443
00444 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00445 }
|
|
|
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 794 of file Profile.cpp.
00795 {
00796 // default for virtual methods, thus a no-op
00797 }
|
|
|
Helper method that encodes the endpoints for RTCORBA as tagged_components. Definition at line 330 of file Profile.cpp. References ACE_OutputCDR::begin(), IOP::TaggedComponent::component_data, ACE_Message_Block::cont(), ACE_Message_Block::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().
00331 {
00332 CORBA::ULong const length = static_cast <CORBA::ULong> (out_cdr.total_length ());
00333
00334 IOP::TaggedComponent tagged_component;
00335 tagged_component.tag = TAO_TAG_ENDPOINTS;
00336 tagged_component.component_data.length (length);
00337 CORBA::Octet *buf =
00338 tagged_component.component_data.get_buffer ();
00339
00340 for (const ACE_Message_Block *iterator = out_cdr.begin ();
00341 iterator != 0;
00342 iterator = iterator->cont ())
00343 {
00344 size_t const i_length = iterator->length ();
00345 ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
00346
00347 buf += i_length;
00348 }
00349
00350 // Add component with encoded endpoint data to this profile's
00351 // TaggedComponents.
00352 tagged_components_.set_component (tagged_component);
00353 }
|
|
|
Returns true if this profile can specify multicast endpoints.
Definition at line 624 of file Profile.cpp.
00625 {
00626 // Most profiles do not support multicast endpoints.
00627 return 0;
00628 }
|
|
|
Returns true if this profile supports non blocking oneways.
Definition at line 631 of file Profile.cpp. References TAO_GIOP_Message_Version::major, and TAO_GIOP_Message_Version::minor.
|
|
|
The tag, each concrete class will have a specific tag value.
Definition at line 8 of file Profile.inl. 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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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(). |
|
|
Verify that the current ORB's configuration supports tagged components in IORs. Definition at line 560 of file Profile.cpp. References CORBA::ORB::_use_omg_ior_format(), ACE_ERROR, ACE_TEXT, 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().
00561 {
00562 // If the ORB isn't configured to support tagged components, then
00563 // throw an exception.
00564 if (this->orb_core_->orb_params ()->std_profile_components () == 0
00565 || !this->orb_core_->orb ()->_use_omg_ior_format ())
00566 {
00567 if (TAO_debug_level > 0)
00568 {
00569 ACE_ERROR ((LM_ERROR,
00570 ACE_TEXT ("(%P|%t) Cannot add ")
00571 ACE_TEXT ("IOP::TaggedComponent to profile.\n")
00572 ACE_TEXT ("(%P|%t) Standard profile components ")
00573 ACE_TEXT ("have been disabled or URL style IORs\n")
00574 ACE_TEXT ("(%P|%t) are in use. Try ")
00575 ACE_TEXT ("\"-ORBStdProfileComponents 1\" and/or\n")
00576 ACE_TEXT ("(%P|%t) \"-ORBObjRefStyle IOR\".\n")));
00577 }
00578
00579 // According to the Portable Interceptor specification, we're
00580 // supposed to throw a CORBA::BAD_PARAM exception if it isn't
00581 // possible to add components to the profile.
00582 // @todo: We need the proper minor code as soon as the spec is
00583 // updated.
00584 throw ::CORBA::BAD_PARAM (
00585 CORBA::SystemException::_tao_minor_code (
00586 0,
00587 EINVAL),
00588 CORBA::COMPLETED_NO);
00589 }
00590 }
|
|
|
Verify that the given profile supports tagged components, i.e. is not a GIOP 1.0 profile. Definition at line 593 of file Profile.cpp. References ACE_ERROR, ACE_TEXT, LM_ERROR, TAO_GIOP_Message_Version::major, TAO_GIOP_Message_Version::minor, and TAO_debug_level. Referenced by add_tagged_component().
00594 {
00595 // GIOP 1.0 does not support tagged components. Throw an exception
00596 // if the profile is a GIOP 1.0 profile.
00597
00598 if (this->version_.major == 1 && this->version_.minor == 0)
00599 {
00600 if (TAO_debug_level > 0)
00601 {
00602 ACE_ERROR ((LM_ERROR,
00603 ACE_TEXT ("(%P|%t) Cannot add ")
00604 ACE_TEXT ("IOP::TaggedComponent to GIOP 1.0")
00605 ACE_TEXT ("IOR profile.\n")
00606 ACE_TEXT ("(%P|%t) Try using a GIOP 1.1 or ")
00607 ACE_TEXT ("greater endpoint.\n")));
00608 }
00609
00610 // According to the Portable Interceptor specification, we're
00611 // supposed to throw a CORBA::BAD_PARAM exception if it isn't
00612 // possible to add components to the profile.
00613 // @todo: We need the proper minor code as soon as the spec is
00614 // updated.
00615 throw ::CORBA::BAD_PARAM (
00616 CORBA::SystemException::_tao_minor_code (
00617 0,
00618 EINVAL),
00619 CORBA::COMPLETED_NO);
00620 }
00621 }
|
|
|
Return a pointer to this profile's version. This object maintains ownership. Definition at line 14 of file Profile.inl. Referenced by is_equivalent(), TAO_IIOP_Profile::parse_string_i(), and TAO::Profile_Transport_Resolver::resolve().
00015 {
00016 return this->version_;
00017 }
|
|
|
The current addressing mode. This may be changed if a remote server sends back an address mode exception. |
|
|
Flag indicating whether the lazy decoding of the client exposed policies has taken place. Definition at line 361 of file Profile.h. Referenced by get_policies(), and policies(). |
|
|
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(). |
|
|
Pointer to the ORB core.
|
|
|
object_key associated with this profile.
Definition at line 372 of file Profile.h. Referenced by _key(), compare_key(), and object_key(). |
|
|
Number of outstanding references to this object.
|
|
|
IOP protocol tag.
|
|
|
The tagged components.
Definition at line 357 of file Profile.h. Referenced by add_tagged_component(), decode(), get_policies(), policies(), set_tagged_components(), and tagged_components(). |
|
|
Our tagged profile.
Definition at line 369 of file Profile.h. Referenced by create_tagged_profile(), and ~TAO_Profile(). |
|
|
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(). |
|
|
A lock that protects creation of the tagged profile.
|
|
|
IIOP version number.
|
1.3.6