Default strategy for endpoint selection. More...
#include <Invocation_Endpoint_Selectors.h>
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_ . |
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 87 of file Invocation_Endpoint_Selectors.h.
TAO_Default_Endpoint_Selector::~TAO_Default_Endpoint_Selector | ( | void | ) | [virtual] |
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.
Reimplemented in TAO_Optimized_Connection_Endpoint_Selector.
Definition at line 30 of file Invocation_Endpoint_Selectors.cpp.
{ do { r->profile (r->stub ()->profile_in_use ()); // Check whether we need to do a blocked wait or we have a // non-blocked wait and we support that. If this is not the // case we can't use this profile so try the next. if (r->blocked_connect () || (!r->blocked_connect () && r->profile ()->supports_non_blocking_oneways ())) { if (r->profile ()->endpoint_count () > 1 && r->use_parallel_connect()) { TAO_Endpoint *ep = r->profile ()->endpoint (); TAO_Base_Transport_Property desc (ep); // Check if the connect has completed. if (r->try_parallel_connect (&desc, max_wait_time)) return; // The default implementation of try_parallel_connect returns // a not supported errno. In this case, allow the ordinary // connection mechanism to be tried. OTOH, if the connection // attempt failed for some other reason, then abandon this // profile and try the next one in the list. else if (errno != ENOTSUP) continue; } for (TAO_Endpoint *ep = r->profile ()->first_filtered_endpoint (); ep != 0; ep = r->profile ()->next_filtered_endpoint (ep)) { TAO_Base_Transport_Property desc (ep); // Check if the connect has completed. if (r->try_connect (&desc, max_wait_time)) return; } } } while (r->stub ()->next_profile_retry () != 0); // If we get here, we completely failed to find an endpoint // that we know how to use. We used to throw an exception // but that would prevent any request interception points // being called. They may know how to fix the problem so // we wait to throw the exception in // Synch_Twoway_Invocation::remote_twoway and // Synch_Oneway_Invocation::remote_oneway instead. }