TAO
2.0.8
|
Defines the Profile interface. More...
#include <Profile.h>
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_ |
ACE_Atomic_Op< TAO_SYNCH_MUTEX, unsigned long > | 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_ |
Defines the Profile interface.
An abstract base class for representing object location information. This is based on the CORBA IOR definitions.
TAO_Profile::TAO_Profile | ( | CORBA::ULong | tag, |
TAO_ORB_Core * | orb_core, | ||
const TAO_GIOP_Message_Version & | version | ||
) |
Constructor.
TAO_Profile::~TAO_Profile | ( | void | ) | [protected, virtual] |
If you have a virtual method you need a virtual dtor.
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.
TAO_Profile::TAO_Profile | ( | const TAO_Profile & | ) | [private] |
unsigned long TAO_Profile::_decr_refcnt | ( | void | ) |
Decrement the object's reference count. When this count goes to 0 this object will be deleted.
unsigned long TAO_Profile::_incr_refcnt | ( | void | ) |
Increase the reference count by one on this object.
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.
void TAO_Profile::add_generic_endpoint | ( | TAO_Endpoint * | ep | ) | [virtual] |
Add a protocol-agnostic endpoint.
Reimplemented in TAO_IIOP_Profile.
void TAO_Profile::add_tagged_component | ( | const IOP::TaggedComponent & | component | ) |
Add the given tagged component to the profile.
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.
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.
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.
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
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_Unknown_Profile, and TAO_IIOP_Profile.
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.
int TAO_Profile::decode | ( | TAO_InputCDR & | cdr | ) | [virtual] |
Initialize this object using the given CDR octet string.
Reimplemented in TAO_Unknown_Profile.
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_Unknown_Profile, and TAO_IIOP_Profile.
virtual int TAO_Profile::decode_profile | ( | TAO_InputCDR & | cdr | ) | [protected, pure virtual] |
Decode the protocol specific profile details.
Implemented in TAO_Unknown_Profile, and TAO_IIOP_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_Unknown_Profile, and TAO_IIOP_Profile.
int TAO_Profile::encode | ( | TAO_OutputCDR & | stream | ) | const [virtual] |
Encode this profile in a stream, i.e. marshal it.
Reimplemented in TAO_Unknown_Profile.
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.
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_Unknown_Profile, and TAO_IIOP_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_Unknown_Profile, and TAO_IIOP_Profile.
virtual CORBA::ULong TAO_Profile::endpoint_count | ( | void | ) | const [pure virtual] |
Return how many endpoints this profile contains.
Implemented in TAO_Unknown_Profile, and TAO_IIOP_Profile.
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().
void TAO_Profile::forward_to | ( | TAO_MProfile * | mprofiles | ) |
Keep a pointer to the forwarded profile.
TAO_MProfile * TAO_Profile::forward_to | ( | void | ) |
MProfile accessor.
TAO_MProfile * TAO_Profile::forward_to_i | ( | void | ) | [private] |
This object keeps ownership of this object.
void TAO_Profile::get_policies | ( | CORBA::PolicyList & | policy_list | ) | [virtual] |
Accessor for the client exposed policies of this profile.
virtual CORBA::ULong TAO_Profile::hash | ( | CORBA::ULong | max | ) | [pure virtual] |
Return a hash value for this object.
Implemented in TAO_Unknown_Profile, and TAO_IIOP_Profile.
CORBA::ULong TAO_Profile::hash_service_i | ( | CORBA::ULong | m | ) | [protected] |
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.
true
if this profile is equivalent to other_profile
. 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.
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.
const TAO::ObjectKey & TAO_Profile::object_key | ( | void | ) | const |
virtual char TAO_Profile::object_key_delimiter | ( | void | ) | const [pure virtual] |
The object key delimiter.
Implemented in TAO_Unknown_Profile, and TAO_IIOP_Profile.
void TAO_Profile::operator= | ( | const TAO_Profile & | ) | [private] |
TAO_ORB_Core * TAO_Profile::orb_core | ( | void | ) | const |
Get a pointer to the TAO_ORB_Core.
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.
virtual void TAO_Profile::parse_string_i | ( | const char * | string | ) | [protected, pure virtual] |
Protocol specific implementation of parse_string ()
Implemented in TAO_Unknown_Profile, and TAO_IIOP_Profile.
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.
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.
void TAO_Profile::set_tagged_components | ( | TAO_OutputCDR & | cdr | ) | [protected] |
Helper method that encodes the endpoints for RTCORBA as tagged_components.
int TAO_Profile::supports_multicast | ( | void | ) | const [virtual] |
Returns true if this profile can specify multicast endpoints.
bool TAO_Profile::supports_non_blocking_oneways | ( | void | ) | const [virtual] |
Returns true if this profile supports non blocking oneways.
CORBA::ULong TAO_Profile::tag | ( | void | ) | const |
The tag, each concrete class will have a specific tag value.
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)
TAO_Tagged_Components & TAO_Profile::tagged_components | ( | void | ) |
The tag, each concrete class will have a specific tag value.
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_Unknown_Profile, and TAO_IIOP_Profile.
void TAO_Profile::verify_orb_configuration | ( | void | ) | [private] |
Verify that the current ORB's configuration supports tagged components in IORs.
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.
const TAO_GIOP_Message_Version & TAO_Profile::version | ( | void | ) | const |
Return a pointer to this profile's version. This object maintains ownership.
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.
CORBA::Boolean TAO_Profile::are_policies_parsed_ [protected] |
Flag indicating whether the lazy decoding of the client exposed policies has taken place.
TAO_MProfile* TAO_Profile::forward_to_ [private] |
The TAO_MProfile which contains the profiles for the forwarded object.
TAO_ORB_Core* const TAO_Profile::orb_core_ [private] |
Pointer to the ORB core.
TAO::Refcounted_ObjectKey* TAO_Profile::ref_object_key_ [protected] |
Object_key associated with this profile.
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> TAO_Profile::refcount_ [private] |
Number of outstanding references to this object.
CORBA::ULong const TAO_Profile::tag_ [private] |
IOP protocol tag.
TAO_Tagged_Components TAO_Profile::tagged_components_ [protected] |
The tagged components.
IOP::TaggedProfile* TAO_Profile::tagged_profile_ [protected] |
Our tagged profile.
bool TAO_Profile::tagged_profile_created_ [private] |
Having (tagged_profile_ != 0) doesn't mean yet that tagged_profile_ building is finished.
TAO_SYNCH_MUTEX TAO_Profile::tagged_profile_lock_ [private] |
A lock that protects creation of the tagged profile.
TAO_GIOP_Message_Version TAO_Profile::version_ [protected] |
IIOP version number.