#include <Profile_Transport_Resolver.h>
Public Member Functions | |
Profile_Transport_Resolver (CORBA::Object *p, TAO_Stub *stub, bool block=true) | |
Constructor. | |
~Profile_Transport_Resolver (void) | |
void | resolve (ACE_Time_Value *val) |
Method where the bunch of the action takes place. | |
void | transport_released (void) const |
bool | try_connect (TAO_Transport_Descriptor_Interface *desc, ACE_Time_Value *val) |
bool | try_parallel_connect (TAO_Transport_Descriptor_Interface *desc, ACE_Time_Value *val) |
bool | use_parallel_connect (void) const |
void | init_inconsistent_policies (void) |
CORBA::PolicyList * | inconsistent_policies (void) const |
CORBA::PolicyList * | steal_inconsistent_policies (void) |
Accessors and mutators for this class. The following methods | |
are used by the clients of this class to access strategies and other internal workings. | |
void | profile (TAO_Profile *pfile) |
Mutator for profile. | |
TAO_Profile * | profile (void) const |
Accessor for profile. | |
TAO_Stub * | stub (void) const |
Accessor for TAO_Stub. | |
CORBA::Object * | object (void) const |
Accessor for the target in use. | |
TAO_Transport * | transport (void) const |
Accessor for the transport reserved for this invocation. | |
int | find_transport (TAO_Transport_Descriptor_Interface *) |
bool | blocked_connect (void) const |
Private Member Functions | |
bool | get_connection_timeout (ACE_Time_Value &max_wait_time) |
void | operator= (const Profile_Transport_Resolver &) |
Profile_Transport_Resolver (const Profile_Transport_Resolver &) | |
bool | try_connect_i (TAO_Transport_Descriptor_Interface *desc, ACE_Time_Value *val, bool parallel) |
Private Attributes | |
CORBA::Object * | obj_ |
Target object. | |
TAO_Stub * | stub_ |
Stub object for the target object. | |
TAO::Transport_Selection_Guard | transport_ |
The transport selected for this invocation. | |
TAO_Profile * | profile_ |
The profile that has been selected for this invocation. | |
CORBA::PolicyList * | inconsistent_policies_ |
List of inconsistent policies. | |
bool | is_released_ |
Has the transport been idle? | |
bool const | blocked_ |
Should we block while trying to make a connection. |
A target object is represented by multiple profiles, which theoretically provides multiple paths to the same target object. This class helps in choosing the right profile, and pick a transport from cache (or create a new transport if needed) that represents the profile.
TAO::Profile_Transport_Resolver::Profile_Transport_Resolver | ( | CORBA::Object * | p, | |
TAO_Stub * | stub, | |||
bool | block = true | |||
) |
Constructor.
With block we tell whether this resolved should always deliver a connection by blocking or unblock before the connection is completely established. Please note that this has *nothing* to do with the synchronous or asynch connect strategy used for making connections. This is a local flag used by the clients of this to dictate some local behavior.
TAO::Profile_Transport_Resolver::~Profile_Transport_Resolver | ( | void | ) |
TAO::Profile_Transport_Resolver::Profile_Transport_Resolver | ( | const Profile_Transport_Resolver & | ) | [private] |
bool TAO::Profile_Transport_Resolver::blocked_connect | ( | void | ) | const |
Accessor to indicate whether we should block while establishing a connection.
int TAO::Profile_Transport_Resolver::find_transport | ( | TAO_Transport_Descriptor_Interface * | desc | ) |
See if the transport cache has an available transport and use that one rather than trying to connect via the connector. Separating this functionality enables the look up of many endpoints before trying the more time-consuming trip through the actual connector.
bool TAO::Profile_Transport_Resolver::get_connection_timeout | ( | ACE_Time_Value & | max_wait_time | ) | [private] |
Helper method to access get the connection timeout from the ORB.
CORBA::PolicyList * TAO::Profile_Transport_Resolver::inconsistent_policies | ( | void | ) | const |
void TAO::Profile_Transport_Resolver::init_inconsistent_policies | ( | void | ) |
Initialize the inconsistent policy list that this object has cached.
CORBA::Object_ptr TAO::Profile_Transport_Resolver::object | ( | void | ) | const |
Accessor for the target in use.
void TAO::Profile_Transport_Resolver::operator= | ( | const Profile_Transport_Resolver & | ) | [private] |
TAO_Profile * TAO::Profile_Transport_Resolver::profile | ( | void | ) | const |
Accessor for profile.
void TAO::Profile_Transport_Resolver::profile | ( | TAO_Profile * | pfile | ) |
Mutator for profile.
void TAO::Profile_Transport_Resolver::resolve | ( | ACE_Time_Value * | val | ) |
Method where the bunch of the action takes place.
This is the entry point from the TAO::Invocation_Adapter class. This method accesses the endpoint selector factory from the ORB_Core to decide on the strategy to be used for selecting the profile.
CORBA::PolicyList * TAO::Profile_Transport_Resolver::steal_inconsistent_policies | ( | void | ) |
TAO_Transport * TAO::Profile_Transport_Resolver::transport | ( | void | ) | const |
Accessor for the transport reserved for this invocation.
void TAO::Profile_Transport_Resolver::transport_released | ( | void | ) | const |
Signal to let the resolver know that the transport has been released back to the cache.
bool TAO::Profile_Transport_Resolver::try_connect | ( | TAO_Transport_Descriptor_Interface * | desc, | |
ACE_Time_Value * | val | |||
) |
This is a callback method used by the endpoint selectors to delegate the responsibility of reserving a transport from the connection cache for this invocation. When the descriptor contains more than one endpoint (as part of a linked list) and the parallel flag is true then the connector will look for a connection on any of the endpoints if it supports that behavior, otherwise an ENOTSUP errno will be set and the method will return false.
bool TAO::Profile_Transport_Resolver::try_connect_i | ( | TAO_Transport_Descriptor_Interface * | desc, | |
ACE_Time_Value * | val, | |||
bool | parallel | |||
) | [private] |
bool TAO::Profile_Transport_Resolver::try_parallel_connect | ( | TAO_Transport_Descriptor_Interface * | desc, | |
ACE_Time_Value * | val | |||
) |
bool TAO::Profile_Transport_Resolver::use_parallel_connect | ( | void | ) | const |
This method wraps a call to the orb core to see if parallel connection attempts are even desired. This is controlled by the -ORBUseParallelConnects 1|0 commandline option.
bool const TAO::Profile_Transport_Resolver::blocked_ [private] |
Should we block while trying to make a connection.
CORBA::PolicyList* TAO::Profile_Transport_Resolver::inconsistent_policies_ [private] |
List of inconsistent policies.
If current effective policies cause the invocation to raise CORBA::INV_POLICY exception, the conflicting/problematic policies are stored in this list. This is used by
Object::_validate_connection | method to inform clients about causes of invocation failure. |
init_inconsistent_policies | method has been called prior to the beginning of invocation. This saves extra work of conflicting policies 'logging' when it's not needed. |
bool TAO::Profile_Transport_Resolver::is_released_ [mutable, private] |
Has the transport been idle?
CORBA::Object* TAO::Profile_Transport_Resolver::obj_ [mutable, private] |
Target object.
TAO_Profile* TAO::Profile_Transport_Resolver::profile_ [private] |
The profile that has been selected for this invocation.
TAO_Stub* TAO::Profile_Transport_Resolver::stub_ [private] |
Stub object for the target object.
TAO::Transport_Selection_Guard TAO::Profile_Transport_Resolver::transport_ [private] |
The transport selected for this invocation.
Using the wrapper guard ensures it is available for use with the Transport Current interfaces.