summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorAngelo Corsaro <angelo@icorsaro.net>2001-02-09 00:30:17 +0000
committerAngelo Corsaro <angelo@icorsaro.net>2001-02-09 00:30:17 +0000
commitea50b73f101cdfe0ae5ad004eabefd79ce211191 (patch)
tree707610cdba462732222b8e9bfa392033a83da527 /TAO/tao
parentfb5db69cd2e7ffc8db9be24e605366a6827e636c (diff)
downloadATCD-ea50b73f101cdfe0ae5ad004eabefd79ce211191.tar.gz
Thu Feb 08 18:15:59 2001 Angelo Corsaro <corsaro@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/Invocation_Endpoint_Selectors.cpp4
-rw-r--r--TAO/tao/MProfile.cpp22
-rw-r--r--TAO/tao/MProfile.h6
-rw-r--r--TAO/tao/MProfile.i18
-rw-r--r--TAO/tao/ORB_Core.cpp3
-rw-r--r--TAO/tao/PortableServer/POA.cpp6
-rw-r--r--TAO/tao/Profile.cpp13
-rw-r--r--TAO/tao/Profile.h5
-rw-r--r--TAO/tao/Stub.cpp96
-rw-r--r--TAO/tao/Stub.h16
10 files changed, 87 insertions, 102 deletions
diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp
index c5132e72b8a..ac1c662f638 100644
--- a/TAO/tao/Invocation_Endpoint_Selectors.cpp
+++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp
@@ -39,7 +39,9 @@ TAO_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation
invocation->endpoint_selection_state_;
state.priority_model_policy_ =
- invocation->stub_->exposed_priority_model ();
+ invocation->stub_->exposed_priority_model (ACE_TRY_ENV);
+ ACE_CHECK;
+
state.private_connection_ =
invocation->stub_->private_connection ();
diff --git a/TAO/tao/MProfile.cpp b/TAO/tao/MProfile.cpp
index e5aad8bf0a9..ded3d8c4e99 100644
--- a/TAO/tao/MProfile.cpp
+++ b/TAO/tao/MProfile.cpp
@@ -220,18 +220,18 @@ TAO_MProfile::hash (CORBA::ULong max, CORBA::Environment &ACE_TRY_ENV)
}
void
-TAO_MProfile::init_policy_list (void)
+TAO_MProfile::init_policy_list (CORBA::Environment &ACE_TRY_ENV)
{
// The first time this method is called
// it causes the initialization of the policies
// for the current profile.
- this->get_current_profile ()->policies ();
+ this->get_current_profile ()->policies (ACE_TRY_ENV);
this->is_policy_list_initialized_ = 1;
}
CORBA::PolicyList*
-TAO_MProfile::policy_list (void)
+TAO_MProfile::policy_list (CORBA::Environment &ACE_TRY_ENV)
{
if (!this->is_policy_list_initialized_)
{
@@ -242,10 +242,18 @@ TAO_MProfile::policy_list (void)
if (this->policy_list_ == 0)
{
- this->create_policy_list ();
- this->init_policy_list ();
+ this->create_policy_list (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ this->init_policy_list (ACE_TRY_ENV);
+ ACE_CHECK;
}
}
-
- return this->policy_list_;
+ CORBA::PolicyList *ret_val = 0;
+ ACE_NEW_THROW_EX ( ret_val,
+ CORBA::PolicyList (*this->policy_list_),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO)
+ );
+ return ret_val;
}
diff --git a/TAO/tao/MProfile.h b/TAO/tao/MProfile.h
index d2cfce4a8f1..252ec5e2b8a 100644
--- a/TAO/tao/MProfile.h
+++ b/TAO/tao/MProfile.h
@@ -165,7 +165,7 @@ protected:
/// This method handle the dynamic allocation of the data member
/// <policy_list_>.
- void create_policy_list (void);
+ void create_policy_list (CORBA::Environment &ACE_TRY_ENV);
public:
@@ -175,12 +175,12 @@ public:
/// Gets the policies list associated with the profiles
/// owned by the TAO_MProfile.
- CORBA::PolicyList * policy_list (void);
+ CORBA::PolicyList *policy_list (CORBA::Environment &ACE_TRY_ENV);
protected:
/// Initialize the policy list, demarsharling the policy.
- void init_policy_list (void);
+ void init_policy_list (CORBA::Environment &ACE_TRY_ENV);
protected:
/// Stores the policy list for the profile of this MProfile.
diff --git a/TAO/tao/MProfile.i b/TAO/tao/MProfile.i
index d13887e406b..1623cd10b18 100644
--- a/TAO/tao/MProfile.i
+++ b/TAO/tao/MProfile.i
@@ -253,19 +253,13 @@ TAO_MProfile::add_profile (TAO_Profile *pfile)
}
ACE_INLINE void
-TAO_MProfile::create_policy_list (void)
+TAO_MProfile::create_policy_list (CORBA::Environment &ACE_TRY_ENV)
{
- // Precondition: Make sure that the policy list
- // has not already allocated.
- ACE_ASSERT (this->policy_list_ == 0);
-
- ACE_NEW (this->policy_list_, CORBA::PolicyList ());
-
- // Post-Condition: Make sure that the memory get allcated
- // for real.
- ACE_ASSERT (this->policy_list_ != 0);
-
- // @@ Marina & Irfan I would raise an exception in this case.
+ ACE_NEW_THROW_EX (this->policy_list_,
+ CORBA::PolicyList,
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO)
+ );
}
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 21b06de9766..17817e94d9c 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -1672,7 +1672,8 @@ TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key,
{
// Get the ith profile
profile = mp.get_profile (i);
- profile->policies (policy_list);
+ profile->policies (policy_list, ACE_TRY_ENV);
+ ACE_CHECK;
}
}
diff --git a/TAO/tao/PortableServer/POA.cpp b/TAO/tao/PortableServer/POA.cpp
index 9f634a93cc5..ec0fd402792 100644
--- a/TAO/tao/PortableServer/POA.cpp
+++ b/TAO/tao/PortableServer/POA.cpp
@@ -4162,8 +4162,8 @@ TAO_POA::key_to_stub_i (const TAO_ObjectKey &key,
#if (TAO_HAS_RT_CORBA == 1)
- if (this->policies ().priority_bands () == 0)
- {
+// if (this->policies ().priority_bands () != 0)
+ // {
TAO_Priority_Acceptor_Filter
filter (this->policies ().server_protocol ()->protocols_rep (),
priority);
@@ -4173,7 +4173,7 @@ TAO_POA::key_to_stub_i (const TAO_ObjectKey &key,
client_exposed_policies._retn (),
&filter,
ACE_TRY_ENV);
- }
+ // }
#endif /* TAO_HAS_RT_CORBA == 1 */
ACE_CHECK_RETURN (0);
diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp
index 727c208639b..0496881dfd5 100644
--- a/TAO/tao/Profile.cpp
+++ b/TAO/tao/Profile.cpp
@@ -37,7 +37,7 @@ TAO_Profile::add_tagged_component (const IOP::TaggedComponent &component,
}
void
-TAO_Profile::policies (CORBA::PolicyList *policy_list)
+TAO_Profile::policies (CORBA::PolicyList *policy_list, CORBA::Environment &ACE_TRY_ENV)
{
#if (TAO_HAS_CORBA_MESSAGING == 1)
@@ -82,12 +82,7 @@ TAO_Profile::policies (CORBA::PolicyList *policy_list)
buf += iterator->length ();
}
- //policy_value_seq[i] = pv;
-
- // Reset the CDR buffer index so that the buffer can
- // be reused for the next conversion.
-
- //out_CDR.reset ();
+
}
TAO_OutputCDR out_cdr;
@@ -129,7 +124,7 @@ TAO_Profile::policies (CORBA::PolicyList *policy_list)
CORBA::PolicyList&
-TAO_Profile::policies (void)
+TAO_Profile::policies (CORBA::Environment &ACE_TRY_ENV)
{
#if (TAO_HAS_CORBA_MESSAGING == 1)
@@ -154,7 +149,7 @@ TAO_Profile::policies (void)
// Extract the Byte Order
CORBA::Boolean byte_order;
if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
- return *(stub_->base_profiles ().policy_list ());
+ return *(stub_->base_profiles ().policy_list_);
in_cdr.reset_byte_order (ACE_static_cast(int, byte_order));
// Now we take out the Messaging::PolicyValueSeq out from the
diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h
index 73beeadf18d..85e8cdab4a9 100644
--- a/TAO/tao/Profile.h
+++ b/TAO/tao/Profile.h
@@ -147,10 +147,11 @@ public:
/// This method sets the client exposed policies, i.e., the ones
/// propagated in the IOR, for this profile.
- virtual void policies (CORBA::PolicyList *policy_list);
+ virtual void policies (CORBA::PolicyList *policy_list,
+ CORBA::Environment &ACE_TRY_ENV);
/// Accessor for the client exposed policies of this profile.
- virtual CORBA::PolicyList& policies (void);
+ virtual CORBA::PolicyList& policies (CORBA::Environment &ACE_TRY_ENV);
/// Sets the TAO_Stub to which this profile is associated.
virtual void the_stub (TAO_Stub *stub);
diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp
index b228843498e..a10329a1077 100644
--- a/TAO/tao/Stub.cpp
+++ b/TAO/tao/Stub.cpp
@@ -325,28 +325,32 @@ private:
#if (TAO_HAS_RT_CORBA == 1)
void
-TAO_Stub::parse_policies (void)
+TAO_Stub::parse_policies (CORBA::Environment &ACE_TRY_ENV)
{
- CORBA::PolicyList *policy_list // @@ Angelo -> should this be a var...
- = this->base_profiles_.policy_list ();
+ CORBA::PolicyList_var policy_list
+ = this->base_profiles_.policy_list (ACE_TRY_ENV);
+ ACE_CHECK;
CORBA::ULong length = policy_list->length ();
- // CORBA::ULong index = 0;
-
CORBA::ULong policy_type = 0;
- this->orb_core ()->get_protocols_hooks ()->call_policy_type_hook (policy_list,
- policy_type);
+ // @@ Priyanka The code implemented in this methods doesn't do what
+ // it is supposed to. I reverted your change for the time being.
+ // this->orb_core ()->get_protocols_hooks ()->call_policy_type_hook (policy_list,
+ // policy_type);
for (unsigned int i = 0; i < length; ++i)
{
- if (policy_type == 0)
+ if (((*policy_list)[i]->policy_type () ==
+ RTCORBA::PRIORITY_MODEL_POLICY_TYPE))
this->exposed_priority_model ((*policy_list)[i].in ());
- else if (policy_type == 1)
+ else if (((*policy_list)[i]->policy_type () ==
+ RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE))
this->exposed_priority_banded_connection ((*policy_list)[i].in ());
- else if (policy_type == 2)
+ else if (((*policy_list)[i]->policy_type () ==
+ RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE))
this->exposed_client_protocol ((*policy_list)[i].in ());
}
@@ -354,69 +358,49 @@ TAO_Stub::parse_policies (void)
}
CORBA::Policy *
-TAO_Stub::exposed_priority_model (void)
+TAO_Stub::exposed_priority_model (CORBA::Environment &ACE_TRY_ENV)
{
if (!this->are_policies_parsed_)
- this->parse_policies ();
-
- if (!CORBA::is_nil (this->priority_model_policy_))
- this->priority_model_policy_->_add_ref ();
+ this->parse_policies (ACE_TRY_ENV);
- return this->priority_model_policy_;
+ return CORBA::Policy::_duplicate (this->priority_model_policy_);
}
void
TAO_Stub::exposed_priority_model (CORBA::Policy_ptr policy)
{
- if (!CORBA::is_nil (policy))
- {
- this->priority_model_policy_ = policy;
- this->priority_model_policy_->_add_ref ();
- }
+ this->priority_model_policy_ = CORBA::Policy::_duplicate (policy);
}
CORBA::Policy *
-TAO_Stub::exposed_priority_banded_connection (void)
+TAO_Stub::exposed_priority_banded_connection (CORBA::Environment &ACE_TRY_ENV)
{
if (!this->are_policies_parsed_)
- this->parse_policies ();
-
- if (!CORBA::is_nil (this->priority_banded_connection_policy_))
- this->priority_banded_connection_policy_->_add_ref ();
+ this->parse_policies (ACE_TRY_ENV);
- return this->priority_banded_connection_policy_;
+ return CORBA::Policy::_duplicate (this->priority_banded_connection_policy_);
}
void
TAO_Stub::exposed_priority_banded_connection (CORBA::Policy_ptr policy)
{
- if (!CORBA::is_nil (policy))
- {
- this->priority_banded_connection_policy_ = policy;
- this->priority_banded_connection_policy_->_add_ref ();
- }
+ this->priority_banded_connection_policy_ =
+ CORBA::Policy::_duplicate (policy);
}
CORBA::Policy *
-TAO_Stub::exposed_client_protocol (void)
+TAO_Stub::exposed_client_protocol (CORBA::Environment &ACE_TRY_ENV)
{
if (!this->are_policies_parsed_)
- this->parse_policies ();
+ this->parse_policies (ACE_TRY_ENV);
- if (!CORBA::is_nil (this->client_protocol_policy_))
- this->client_protocol_policy_->_add_ref ();
-
- return this->client_protocol_policy_;
+ return CORBA::Policy::_duplicate (this->client_protocol_policy_);
}
void
TAO_Stub::exposed_client_protocol (CORBA::Policy_ptr policy)
{
- if (!CORBA::is_nil (policy))
- {
- this->client_protocol_policy_ = policy;
- this->client_protocol_policy_->_add_ref ();
- }
+ this->client_protocol_policy_ = CORBA::Policy::_duplicate (policy);
}
#endif /* TAO_HAS_RT_CORBA == 1 */
@@ -441,8 +425,8 @@ TAO_Stub::get_policy (CORBA::PolicyType type,
// If we are dealing with a client exposed policy, check if any
// value came in the IOR/reconcile IOR value and overrides.
- if (type_value == 1)
- return this->exposed_priority_model ();
+ if (type_value == 1)
+ return this->exposed_priority_model (ACE_TRY_ENV);
if (type_value == 2)
return this->effective_priority_banded_connection (ACE_TRY_ENV);
@@ -578,10 +562,10 @@ TAO_Stub::set_policy_overrides (const CORBA::PolicyList & policies,
type_value,
ACE_TRY_ENV);
//ACE_CHECK;
-
+
if (type_value == 1 || type_value == 4)
ACE_THROW_RETURN (CORBA::NO_PERMISSION (), 0);
-
+
}
// We are not required to check for consistency of <policies> with
@@ -964,19 +948,19 @@ CORBA::Policy *
TAO_Stub::effective_priority_banded_connection (CORBA::Environment &ACE_TRY_ENV)
{
// Get effective override.
- CORBA::Policy_var override =
+ CORBA::Policy_var override =
this->priority_banded_connection ();
// Get the value from the ior.
- CORBA::Policy_var exposed =
- this->exposed_priority_banded_connection ();
+ CORBA::Policy_var exposed =
+ this->exposed_priority_banded_connection (ACE_TRY_ENV);
// Reconcile client-exposed and locally set values.
- if (CORBA::is_nil (exposed.in ()))
- return override._retn ();
+ if (CORBA::is_nil (exposed.in ()))
+ return override._retn ();
- if (CORBA::is_nil (override.in ()))
- return exposed._retn ();
+ if (CORBA::is_nil (override.in ()))
+ return exposed._retn ();
CORBA::Policy_var policy =
this->orb_core_->get_protocols_hooks ()->
@@ -997,11 +981,11 @@ TAO_Stub::effective_client_protocol (CORBA::Environment &ACE_TRY_ENV)
// Get the value from the ior.
CORBA::Policy_var exposed =
- this->exposed_client_protocol ();
+ this->exposed_client_protocol (ACE_TRY_ENV);
// Reconcile client-exposed and locally set values.
if (CORBA::is_nil (exposed.in ()))
- return override._retn ();
+ return override._retn ();
if (CORBA::is_nil (override.in ()))
return exposed._retn ();
diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h
index 69ff268f467..6694cbe36a2 100644
--- a/TAO/tao/Stub.h
+++ b/TAO/tao/Stub.h
@@ -142,21 +142,21 @@ public:
#if (TAO_HAS_RT_CORBA == 1)
- /// Returns the CORBA::Policy (which will be narrowed to be
+ /// Returns the CORBA::Policy (which will be narrowed to be
/// used as RTCORBA::PriorityModelPolicy) exported
/// in object's IOR.
- CORBA::Policy *exposed_priority_model (void);
-
+ CORBA::Policy_ptr exposed_priority_model (CORBA::Environment &ACE_TRY_ENV);
+
/// Returns the CORBA::Policy (which will be narrowed and used
/// as RTCORBA::PriorityBandedConnectionPolicy) exported
/// in object's IOR.
- CORBA::Policy *exposed_priority_banded_connection (void);
-
+ CORBA::Policy_ptr exposed_priority_banded_connection (CORBA::Environment &ACE_TRY_ENV);
+
/// Returns the CORBA::Policy (which will be narrowed and used
/// as RTCORBA::ClientProtocolPolicy) exported
/// in object's IOR.
- CORBA::Policy *exposed_client_protocol (void);
-
+ CORBA::Policy_ptr exposed_client_protocol (CORBA::Environment &ACE_TRY_ENV);
+
# endif /*TAO_HAS_RT_CORBA == 1*/
// = Methods for obtaining effective overrides.
@@ -367,7 +367,7 @@ private:
private:
/// Helper method used to parse the policies.
- void parse_policies (void);
+ void parse_policies (CORBA::Environment &ACE_TRY_ENV);
void exposed_priority_model (CORBA::Policy_ptr policy);