summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp
diff options
context:
space:
mode:
authorsbw1 <sbw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-03 23:39:45 +0000
committersbw1 <sbw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-03 23:39:45 +0000
commit76c6707336045833fa50bdb66527823ed30b0172 (patch)
tree50a2334679ee1f6279a891a1802883ce6f8b2424 /TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp
parent2bd931e4e40d9fa090181e4e46fcaa8baae16c1d (diff)
downloadATCD-76c6707336045833fa50bdb66527823ed30b0172.tar.gz
Debugged directed queries.
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp62
1 files changed, 44 insertions, 18 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp
index 31e55ee0c9a..b9b74cc3af6 100644
--- a/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp
@@ -90,8 +90,8 @@ query (const char *type,
if (link_if != CosTrading::Link::_nil () && trader_name != 0)
{
CosTrading::PolicySeq policies_to_forward;
- policies.copy_to_forward (policies_to_forward, trader_name);
- this->forward_query (*trader_name,
+ policies.copy_to_forward (policies_to_forward, *trader_name);
+ this->forward_query (ACE_static_cast (const char*, (*trader_name)[0]),
type,
constraint,
preferences,
@@ -197,7 +197,7 @@ query (const char *type,
if (should_follow && links->length () != 0)
{
- // Perform the sequence of fedrated queries.
+ // Perform the sequence of federated queries.
if (request_id == 0)
{
CosTrading::Admin_ptr admin_if =
@@ -716,7 +716,7 @@ order_merged_sequence (TAO_Preference_Interpreter& pref_inter,
template <class TRADER, class TRADER_LOCK_TYPE> void
TAO_Lookup<TRADER,TRADER_LOCK_TYPE>::
-forward_query (const CosTrading::TraderName& trader_name,
+forward_query (const CosTrading::LinkName next_hop,
const char *type,
const char *constr,
const char *pref,
@@ -746,7 +746,7 @@ forward_query (const CosTrading::TraderName& trader_name,
TAO_TRY
{
CosTrading::Link::LinkInfo_var link_info =
- link_interface->describe_link (trader_name[0], TAO_TRY_ENV);
+ link_interface->describe_link (next_hop, TAO_TRY_ENV);
TAO_CHECK_ENV;
CosTrading::Lookup_ptr remote_lookup;
@@ -760,23 +760,49 @@ forward_query (const CosTrading::TraderName& trader_name,
remote_lookup = link_info->target;
#endif /* TAO_HAS_OBJECT_IN_STRUCT_MARSHAL_BUG */
+ CORBA::Object_var us = this->_this (TAO_TRY_ENV);
+ TAO_CHECK_ENV;
- // Perform forwarding query.
- remote_lookup->query (type,
- constr,
- pref,
- policy_seq,
- desired_props,
- how_many,
- offers,
- offer_itr,
- limits_applied,
- _env);
- TAO_CHECK_ENV_RETURN_VOID (_env);
+ CORBA::Boolean self_loop =
+ remote_lookup->_is_equivalent (us, TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (! self_loop)
+ {
+ // Perform forwarding query.
+ remote_lookup->query (type,
+ constr,
+ pref,
+ policy_seq,
+ desired_props,
+ how_many,
+ offers,
+ offer_itr,
+ limits_applied,
+ _env);
+ TAO_CHECK_ENV_RETURN_VOID (_env);
+ }
+ else
+ {
+ this->query (type,
+ constr,
+ pref,
+ policy_seq,
+ desired_props,
+ how_many,
+ offers,
+ offer_itr,
+ limits_applied,
+ _env);
+ TAO_CHECK_ENV_RETURN_VOID (_env);
+ }
}
TAO_CATCHANY
{
- TAO_THROW (CosTrading::Lookup::InvalidPolicyValue ());
+ CosTrading::Policy policy;
+ policy.name = TAO_Policies::POLICY_NAMES[TAO_Policies::STARTING_TRADER];
+ policy.value <<= next_hop;
+ TAO_THROW (CosTrading::Lookup::InvalidPolicyValue (policy));
}
TAO_ENDTRY;
}