TAO_Default_Endpoint_Selector Class Reference

Default strategy for endpoint selection. More...

#include <Invocation_Endpoint_Selectors.h>

Inheritance diagram for TAO_Default_Endpoint_Selector:

Inheritance graph
[legend]
Collaboration diagram for TAO_Default_Endpoint_Selector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~TAO_Default_Endpoint_Selector (void)
 Destructor.

virtual void select_endpoint (TAO::Profile_Transport_Resolver *r, ACE_Time_Value *val)
 Select the endpoint and set r's profile_.


Detailed Description

Default strategy for endpoint selection.

This strategy is used when there are no policies set or when the only policy set is RTCORBA::PriorityModelPolicy and its value is RTCORBA::SERVER_DECLARED. The strategy is to try the first endpoint from the first profile in the IOR. If that doesn't work, try the next profile, and so on.

Definition at line 91 of file Invocation_Endpoint_Selectors.h.


Constructor & Destructor Documentation

TAO_Default_Endpoint_Selector::~TAO_Default_Endpoint_Selector void   )  [virtual]
 

Destructor.

Definition at line 25 of file Invocation_Endpoint_Selectors.cpp.

00026 {
00027 }


Member Function Documentation

void TAO_Default_Endpoint_Selector::select_endpoint TAO::Profile_Transport_Resolver r,
ACE_Time_Value val
[virtual]
 

Select the endpoint and set r's profile_.

Implements TAO_Invocation_Endpoint_Selector.

Definition at line 30 of file Invocation_Endpoint_Selectors.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_THROW, TAO::Profile_Transport_Resolver::blocked_connect(), ENOTSUP, TAO_Stub::next_profile_retry(), TAO::Profile_Transport_Resolver::profile(), TAO_Stub::profile_in_use(), TAO::Profile_Transport_Resolver::stub(), TAO::Profile_Transport_Resolver::try_connect(), TAO::Profile_Transport_Resolver::try_parallel_connect(), and TAO::Profile_Transport_Resolver::use_parallel_connect().

00033 {
00034   do
00035     {
00036       r->profile (r->stub ()->profile_in_use ());
00037 
00038       // Check whether we need to do a blocked wait or we have a
00039       // non-blocked wait and we support that.  If this is not the
00040       // case we can't use this profile so try the next.
00041       if (r->blocked_connect () ||
00042           (!r->blocked_connect () &&
00043            r->profile ()->supports_non_blocking_oneways ()))
00044         {
00045           if (r->profile ()->endpoint_count () > 1 &&
00046               r->use_parallel_connect())
00047             {
00048 
00049               TAO_Endpoint *ep =
00050                 r->profile ()->endpoint ();
00051 
00052               TAO_Base_Transport_Property desc (ep);
00053               bool success =
00054                 r->try_parallel_connect (&desc,
00055                                          max_wait_time
00056                                          ACE_ENV_ARG_PARAMETER);
00057               ACE_CHECK;
00058 
00059               // Check if the connect has completed.
00060               if (success)
00061                 return;
00062               // The default implementation of try_parallel_connect returns
00063               // a not supported errno. In this case, allow the ordinary
00064               // connection mechanism to be tried. OTOH, if the connection
00065               // attempt failed for some other reason, then abandon this
00066               // profile and try the next one in the list.
00067               else if (errno != ENOTSUP)
00068                 continue;
00069             }
00070 
00071           for (TAO_Endpoint *ep = r->profile ()->first_filtered_endpoint ();
00072                ep != 0;
00073                ep = r->profile ()->next_filtered_endpoint (ep))
00074             {
00075               TAO_Base_Transport_Property desc (ep);
00076               bool retval =
00077                 r->try_connect (&desc,
00078                                 max_wait_time
00079                                 ACE_ENV_ARG_PARAMETER);
00080               ACE_CHECK;
00081 
00082               // Check if the connect has completed.
00083               if (retval)
00084                 return;
00085             }
00086 
00087         }
00088     }
00089   while (r->stub ()->next_profile_retry () != 0);
00090 
00091 
00092   // If we get here, we completely failed to find an endpoint selector
00093   // that we know how to use, so throw an exception.
00094   ACE_THROW (CORBA::TRANSIENT (CORBA::OMGVMCID | 2,
00095                                CORBA::COMPLETED_NO));
00096 }


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