summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelo Corsaro <angelo@icorsaro.net>2000-08-31 17:39:42 +0000
committerAngelo Corsaro <angelo@icorsaro.net>2000-08-31 17:39:42 +0000
commit91a8132a6104f6b043f8642e30e56e630095c269 (patch)
tree6283ad1e890b9141109449c83d6c32022cb8313e
parent5fc83d7297067b4ee37d8b605f5c3a4891b515f9 (diff)
downloadATCD-91a8132a6104f6b043f8642e30e56e630095c269.tar.gz
ChangeLogTag: Thu Aug 31 12:31:34 2000 Angelo Corsaro <corsaro@cs.wustl.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a27
-rw-r--r--TAO/tao/MProfile.h8
-rw-r--r--TAO/tao/MProfile.i30
-rw-r--r--TAO/tao/Profile.cpp88
-rw-r--r--TAO/tao/RT_Policy_i.cpp22
-rw-r--r--TAO/tao/Stub.cpp248
-rw-r--r--TAO/tao/Stub.h16
7 files changed, 226 insertions, 213 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 258c0979026..17bbda91854 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,30 @@
+Thu Aug 31 12:31:34 2000 Angelo Corsaro <corsaro@cs.wustl.edu>
+
+ * MProfile.h:
+ * MProfile.cpp:
+
+ Added double checked looking to the creation and
+ initialization of policy list, to ensure that only
+ one policy list is created.
+
+ * Profile.cpp:
+
+ Renamed some local variable.
+
+ * RT_Policy_i.cpp:
+
+ Extended Protocol Properties Factory to enable
+ the creation of TAO specific Protocol Properties.
+
+ * Stub.h:
+ * Stub.cpp:
+
+ Improved the method to get the policies and the
+ caching strategy. Fixed memory leak caused by the
+ absence of an invokation of the destroy () method
+ on the cached policies.
+
+
Thu Aug 31 09:46:44 2000 Carlos O'Ryan <coryan@uci.edu>
* orbsvcs/orbsvcs/Makefile.CosNotification:
diff --git a/TAO/tao/MProfile.h b/TAO/tao/MProfile.h
index 95d34a23e7a..c91ae6d45b0 100644
--- a/TAO/tao/MProfile.h
+++ b/TAO/tao/MProfile.h
@@ -20,7 +20,7 @@
#ifndef TAO_MPROFILE_H
#define TAO_MPROFILE_H
#include "ace/pre.h"
-
+#include "ace/Synch.h"
#include "tao/corbafwd.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
@@ -176,6 +176,12 @@ protected:
CORBA::PolicyList *policy_list_;
// Stores the policy list for the profile of this MProfile.
+ CORBA::Boolean is_policy_list_initialized_;
+
+ ACE_Recursive_Thread_Mutex mutex_;
+ // Mutex used to make sure that only one policy list
+ // is created.
+
protected:
TAO_Profile **pfiles (void) const;
// return the complete list of profiles, this object retains
diff --git a/TAO/tao/MProfile.i b/TAO/tao/MProfile.i
index 812be48eadb..4eee314cef0 100644
--- a/TAO/tao/MProfile.i
+++ b/TAO/tao/MProfile.i
@@ -4,6 +4,7 @@
ACE_INLINE
TAO_MProfile::TAO_MProfile (CORBA::ULong sz)
: policy_list_ (0),
+ is_policy_list_initialized_ (0),
forward_from_(0),
pfiles_ (0),
current_ (0),
@@ -275,12 +276,31 @@ TAO_MProfile::policy_list (CORBA::PolicyList *policy_list)
ACE_INLINE CORBA::PolicyList*
TAO_MProfile::policy_list (void)
{
- if (this->policy_list_ == 0)
+
+ // Here we use Double-Checked Loking to
+ // avoid to create more then one policy list
+ // if more thread try to get a policy for
+ // the first time, at the same time.
+
+ if (this->is_policy_list_initialized_)
+ return this->policy_list_;
+ else
{
- this->create_policy_list ();
- // Init Policy.
- this->rewind ();
- this->get_next ()->policies ();
+ ACE_Guard<ACE_Recursive_Thread_Mutex> guard (this->mutex_);
+ if (this->policy_list_ == 0)
+ {
+ this->create_policy_list ();
+ // Init Policy.
+ this->get_current_profile ()->policies ();
+ // Right now all the profile share the same
+ // policies, so any profile can be picked up
+ // to parse the policy.
+ // So we pick the current profile, so that no
+ // state is changed in the MProfile.
+
+ this->is_policy_list_initialized_ = 1;
+ }
}
return this->policy_list_;
+
}
diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp
index 480ddfc6911..c284570e36b 100644
--- a/TAO/tao/Profile.cpp
+++ b/TAO/tao/Profile.cpp
@@ -6,6 +6,7 @@
#include "tao/MessagingC.h"
#include "tao/Policy_Factory.h"
#include "tao/Stub.h"
+#include "tao/debug.h"
#if !defined (__ACE_INLINE__)
#include "tao/Profile.i"
@@ -24,12 +25,13 @@ TAO_Profile::policies (CORBA::PolicyList *policy_list)
{
#if (TAO_HAS_CORBA_MESSAGING == 1)
- // @@ Angelo: using assert will crash the program, that is *NOT* the
- // behavior we want, not in a production system. We should log the
- // error (if we had systematic logging in TAO, otherwise an
- // ACE_DEBUG will have to do), and continue executing!
-
- ACE_ASSERT (policy_list != 0);
+ if (policy_list == 0)
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_Profile::policies: Null Policy List!\n")));
+ return;
+ }
Messaging::PolicyValue pv;
Messaging::PolicyValueSeq policy_value_seq;
@@ -72,25 +74,23 @@ TAO_Profile::policies (CORBA::PolicyList *policy_list)
//out_CDR.reset ();
}
- // @@ Angelo: may want to give this variable another name, to avoid
- // confusion.
- TAO_OutputCDR out_CDR;
+ TAO_OutputCDR out_cdr;
// Now we have to embedd the Messaging::PolicyValueSeq into
// a TaggedComponent.
IOP::TaggedComponent tagged_component;
tagged_component.tag = Messaging::TAG_POLICIES;
- out_CDR << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
- out_CDR << policy_value_seq;
+ out_cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+ out_cdr << policy_value_seq;
- length = out_CDR.total_length ();
+ length = out_cdr.total_length ();
tagged_component.component_data.length (length);
buf = tagged_component.component_data.get_buffer ();
int i_length;
- for (const ACE_Message_Block *iterator = out_CDR.begin ();
+ for (const ACE_Message_Block *iterator = out_cdr.begin ();
iterator != 0;
iterator = iterator->cont ())
{
@@ -106,8 +106,7 @@ TAO_Profile::policies (CORBA::PolicyList *policy_list)
// Eventually we add the TaggedComponent to the TAO_TaggedComponents
// member variable.
tagged_components_.set_component (tagged_component);
- // @@ Angelo: never forget your this->
- are_policies_parsed_ = 1;
+ this->are_policies_parsed_ = 1;
#else /* TAO_HAS_CORBA_MESSAGING == 1 */
@@ -124,15 +123,7 @@ TAO_Profile::policies (void)
CORBA::PolicyList *policies = this->stub_->base_profiles ().policy_list ();
- // @@ Angelo: the following code does not seem to be thread safe.
- // Two threads could call this routine simulatenously and you
- // would leak memory like a hog.
- // If there are good reasons why that cannot happen please
- // document them, if not then please make the code thread safe, a
- // regular guard will do.
-
- if (!are_policies_parsed_
- && (policies->length () == 0))
+ if (!this->are_policies_parsed_)
// None has already parsed the policies.
{
IOP::TaggedComponent tagged_component;
@@ -145,19 +136,19 @@ TAO_Profile::policies (void)
const CORBA::Octet *buf =
tagged_component.component_data.get_buffer ();
- TAO_InputCDR in_CDR (ACE_reinterpret_cast (const char*, buf),
+ TAO_InputCDR in_cdr (ACE_reinterpret_cast (const char*, buf),
tagged_component.component_data.length ());
// Extract the Byte Order
CORBA::Boolean byte_order;
- if ((in_CDR >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
return *(stub_->base_profiles ().policy_list ());
- in_CDR.reset_byte_order (ACE_static_cast(int, byte_order));
+ in_cdr.reset_byte_order (ACE_static_cast(int, byte_order));
// Now we take out the Messaging::PolicyValueSeq out from the
// CDR.
Messaging::PolicyValueSeq policy_value_seq;
- in_CDR >> policy_value_seq;
+ in_cdr >> policy_value_seq;
// Here we extract the Messaging::PolicyValue out of the sequence
// and we convert those into the proper CORBA::Policy
@@ -178,13 +169,13 @@ TAO_Profile::policies (void)
{
buf = policy_value_seq[i].pvalue.get_buffer ();
- TAO_InputCDR in_CDR (ACE_reinterpret_cast (const char*, buf),
+ TAO_InputCDR in_cdr (ACE_reinterpret_cast (const char*, buf),
policy_value_seq[i].pvalue.length ());
- in_CDR >> ACE_InputCDR::to_boolean (byte_order);
- in_CDR.reset_byte_order (ACE_static_cast(int, byte_order));
+ in_cdr >> ACE_InputCDR::to_boolean (byte_order);
+ in_cdr.reset_byte_order (ACE_static_cast(int, byte_order));
- policy->_tao_decode (in_CDR);
+ policy->_tao_decode (in_cdr);
(*policies)[i] = policy;
}
else
@@ -193,34 +184,14 @@ TAO_Profile::policies (void)
// policies that TAO doesn't support, so as specified
// by the RT-CORBA spec. ptc/99-05-03 we just ignore
// this un-understood policies.
- // @@ Angelo: in this case we may still want to log
- // the problem (just use ACE_DEBUG right now if
- // TAO_debug_level is high enough).
+
+ if (TAO_debug_level >= 5)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("The IOR contains Unsupported Policies.\n")));
+
}
}
}
- else
- {
- // @@ Marina, what should happen here?
- // @@ Angelo: I find it easier to read code like this:
- //
- // if (!condition)
- // return; // Nothing bad happenned
- // foo;
- // bar;
- //
- // than code like this:
- //
- // if (condition)
- // {
- // foo;
- // bar;
- // }
- // specially when the numbers of <foos> and <bars> is really
- // high.
- // In this case I think the code would be a *lot* more
- // readable if you did that.
- }
}
@@ -232,9 +203,6 @@ TAO_Profile::policies (void)
void
TAO_Profile::the_stub (TAO_Stub *stub)
{
- // @@ Angelo: Can the stub for a profile change? When? What about
- // race conditions? If it cannot change: shouldn't it be set in the
- // constructor or something?
this->stub_ = stub;
}
diff --git a/TAO/tao/RT_Policy_i.cpp b/TAO/tao/RT_Policy_i.cpp
index 8a33d01efd0..eaedff1bdb0 100644
--- a/TAO/tao/RT_Policy_i.cpp
+++ b/TAO/tao/RT_Policy_i.cpp
@@ -755,7 +755,16 @@ TAO_Protocol_Properties_Factory::create_transport_protocol_property (IOP::Profil
ACE_NEW_RETURN (property,
TAO_TCP_Properties,
0);
+
+ else if(id == TAO_TAG_SHMEM_PROFILE)
+ ACE_NEW_RETURN (property,
+ TAO_SMEM_Properties,
+ 0);
+ else if (id == TAO_TAG_UIOP_PROFILE)
+ ACE_NEW_RETURN (property,
+ TAO_Unix_Domain_Properties,
+ 0);
return property;
}
@@ -769,8 +778,17 @@ TAO_Protocol_Properties_Factory::create_orb_protocol_property (IOP::ProfileId id
TAO_GIOP_Properties,
0);
-
- return property;
+ // Right now the only supported ORB protocol is GIOP
+ // so we couple this with every protocol property.
+ // The else statement is not necessary, but it
+ // is here just to make clear that as soon as
+ // new ORB protocol are supported other case
+ // should be considered.
+ else
+ ACE_NEW_RETURN (property,
+ TAO_GIOP_Properties,
+ 0);
+ return property;
}
#endif /* TAO_HAS_RT_CORBA == 1 */
diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp
index 72f2851fad4..6cc15e3577e 100644
--- a/TAO/tao/Stub.cpp
+++ b/TAO/tao/Stub.cpp
@@ -37,39 +37,37 @@
ACE_RCSID(tao, TAO_Stub, "$Id$")
-TAO_Stub::TAO_Stub (char *repository_id,
- const TAO_MProfile &profiles,
- TAO_ORB_Core* orb_core)
- : type_id (repository_id),
+ TAO_Stub::TAO_Stub (char *repository_id,
+ const TAO_MProfile &profiles,
+ TAO_ORB_Core* orb_core)
+ : type_id (repository_id),
#if (TAO_HAS_RT_CORBA == 1)
- priority_model_policy_ (0),
- is_priority_model_policy_parsed_ (0),
- priority_banded_connection_policy_ (0),
- is_priority_banded_policy_parsed_ (0),
- client_protocol_policy_ (0),
- is_client_protocol_policy_parsed_ (0),
-
+ priority_model_policy_ (0),
+ priority_banded_connection_policy_ (0),
+ client_protocol_policy_ (0),
+ are_policies_parsed_ (0),
+
#endif /* TAO_HAS_RT_CORBA == 1 */
- base_profiles_ ((CORBA::ULong) 0),
- forward_profiles_ (0),
- profile_in_use_ (0),
- profile_lock_ptr_ (0),
- profile_success_ (0),
- refcount_lock_ (),
- refcount_ (1),
- use_locate_request_ (0),
- first_locate_request_ (0),
- orb_core_ (orb_core),
- orb_ (),
- servant_orb_ (),
+ base_profiles_ ((CORBA::ULong) 0),
+ forward_profiles_ (0),
+ profile_in_use_ (0),
+ profile_lock_ptr_ (0),
+ profile_success_ (0),
+ refcount_lock_ (),
+ refcount_ (1),
+ use_locate_request_ (0),
+ first_locate_request_ (0),
+ orb_core_ (orb_core),
+ orb_ (),
+ servant_orb_ (),
#if (TAO_HAS_CORBA_MESSAGING == 1)
- policies_ (0),
+ policies_ (0),
#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
- addressing_mode_ (0)
+ addressing_mode_ (0)
{
if (this->orb_core_ == 0)
@@ -139,7 +137,13 @@ TAO_Stub::~TAO_Stub (void)
this->orb_core_->_decr_refcnt ();
- // @@ Angelo: you must destroy your parsed policies (if any too!)
+#if (TAO_HAS_RTCORBA == 1)
+
+ this->priority_model_policy_->destroy ();
+ this->priority_banded_connection_policy_->destroy ();
+ this->client_protocol_policy_->destroy ();
+
+#endif /* TAO_HAS_RT_CORBA */
}
void
@@ -192,11 +196,11 @@ TAO_Stub::hash (CORBA::ULong max,
ACE_TEXT ("(%P|%t) hash called on a null profile\n")));
ACE_THROW_RETURN (CORBA::INTERNAL (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- 0),
- CORBA::COMPLETED_NO),
- 0);
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ 0),
+ CORBA::COMPLETED_NO),
+ 0);
}
// Expensive comparison of objref data, to see if two objrefs
@@ -277,17 +281,17 @@ TAO_Stub::_decr_refcnt (void)
// unwind.
class TAO_Synchronous_Cancellation_Required
- // = TITLE
- // Stick one of these at the beginning of a block that can't
- // support asynchronous cancellation, and which must be
- // cancel-safe.
- //
- // = EXAMPLE
- // somefunc()
- // {
- // TAO_Synchronous_Cancellation_Required NOT_USED;
- // ...
- // }
+// = TITLE
+// Stick one of these at the beginning of a block that can't
+// support asynchronous cancellation, and which must be
+// cancel-safe.
+//
+// = EXAMPLE
+// somefunc()
+// {
+// TAO_Synchronous_Cancellation_Required NOT_USED;
+// ...
+// }
{
public:
// These should probably be in a separate inline file, but they're
@@ -295,19 +299,19 @@ public:
// inlined, so here they sit.
TAO_Synchronous_Cancellation_Required (void)
: old_type_ (0)
- {
+ {
#if !defined (VXWORKS)
- ACE_OS::thr_setcanceltype (THR_CANCEL_DEFERRED, &old_type_);
+ ACE_OS::thr_setcanceltype (THR_CANCEL_DEFERRED, &old_type_);
#endif /* ! VXWORKS */
- }
+ }
~TAO_Synchronous_Cancellation_Required (void)
- {
+ {
#if !defined (VXWORKS)
- int dont_care;
- ACE_OS::thr_setcanceltype(old_type_, &dont_care);
+ int dont_care;
+ ACE_OS::thr_setcanceltype(old_type_, &dont_care);
#endif /* ! VXWORKS */
- }
+ }
private:
int old_type_;
};
@@ -558,154 +562,120 @@ TAO_Stub::put_params (TAO_GIOP_Invocation &call,
// ****************************************************************
#if (TAO_HAS_CORBA_MESSAGING == 1)
- #if (TAO_HAS_RT_CORBA == 1)
-
-// @@ Angelo, would it make sense to parse the whole list once for all
-// policy types we are interested in, rather than keep parsing for
-// each type? Then we can also keep just one flag, i.e.,
-// are_policies_parse_, rather than one for each policy ...
+#if (TAO_HAS_RT_CORBA == 1)
-CORBA::Policy *
-TAO_Stub::parse_policy (CORBA::PolicyType ptype)
+void
+TAO_Stub::parse_policies (void)
{
- CORBA::Policy *policy = 0;
-
CORBA::PolicyList *policy_list
= this->base_profiles_.policy_list ();
CORBA::ULong length = policy_list->length ();
CORBA::ULong index = 0;
- while (index < length
- &&
- ((*policy_list)[index]->policy_type () != ptype ))
+
+ for (unsigned int i = 0; i < length; ++i)
{
- ++index;
- }
- if (index < length)
- {
- policy = (*policy_list)[index].in ();
+ if (((*policy_list)[i]->policy_type () == RTCORBA::PRIORITY_MODEL_POLICY_TYPE))
+ this->exposed_priority_model ((*policy_list)[i].in ());
+
+ 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_list)[i]->policy_type () == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE))
+ this->exposed_client_protocol ((*policy_list)[i].in ());
}
- return policy;
+
+ this->are_policies_parsed_ = 1;
}
TAO_PriorityModelPolicy *
TAO_Stub::exposed_priority_model (void)
{
- if (this->is_priority_model_policy_parsed_)
- {
- if (!CORBA::is_nil (this->priority_model_policy_))
- this-> priority_model_policy_->_add_ref ();
-
- return this->priority_model_policy_;
- }
-
- // The policy list has not been parsed
- // yet.
-
- this->is_priority_model_policy_parsed_ = 1;
+ if (!this->are_policies_parsed_)
+ this->parse_policies ();
+
+ if (!CORBA::is_nil (this->priority_model_policy_))
+ this->priority_model_policy_->_add_ref ();
- // @@ Angelo: I think you want to use a Policy_var here! And
- // avoid using <Policy*>, use Policy_ptr if you must, people read
- // this code sometimes and we want them to learn good CORBA habits.
- CORBA::Policy *policy =
- this->parse_policy (RTCORBA::PRIORITY_MODEL_POLICY_TYPE);
+ return this->priority_model_policy_;
+}
+void TAO_Stub::exposed_priority_model (CORBA::Policy_ptr policy)
+{
if (!CORBA::is_nil (policy))
{
RTCORBA::PriorityModelPolicy *pm_policy = 0;
- // @@ Angelo, I think there is a memory leak here. <narrow>
- // method creates/adds ref to object... Same applies to other methods...
- // @@ Angelo: I agree, who destroys the <policy> object? And
- // where do you destroy the cached policies?
pm_policy =
RTCORBA::PriorityModelPolicy::_narrow (policy);
-
+
if (!CORBA::is_nil (pm_policy))
{
this->priority_model_policy_ =
ACE_static_cast (TAO_PriorityModelPolicy *,
pm_policy);
-
- this->priority_model_policy_->_add_ref ();
+
}
}
-
- return this->priority_model_policy_;
}
TAO_PriorityBandedConnectionPolicy *
TAO_Stub::exposed_priority_banded_connection (void)
{
- if (this->is_priority_banded_policy_parsed_)
- {
- if (!CORBA::is_nil (this->priority_banded_connection_policy_))
- this->priority_banded_connection_policy_->_add_ref ();
-
- return this->priority_banded_connection_policy_;
- }
-
- this->is_priority_banded_policy_parsed_ = 1;
-
- CORBA::Policy *policy =
- this->parse_policy (RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE);
+ if (!this->are_policies_parsed_)
+ this->parse_policies ();
+
+ if (!CORBA::is_nil (this->priority_banded_connection_policy_))
+ this->priority_banded_connection_policy_->_add_ref ();
+
+ return this->priority_banded_connection_policy_;
+}
+void
+TAO_Stub::exposed_priority_banded_connection (CORBA::Policy_ptr policy)
+{
if (!CORBA::is_nil (policy))
{
- RTCORBA::PriorityBandedConnectionPolicy *pbc_policy = 0;
-
- pbc_policy =
+ RTCORBA::PriorityBandedConnectionPolicy_ptr pbc_policy =
RTCORBA::PriorityBandedConnectionPolicy::_narrow (policy);
-
+
if (!CORBA::is_nil (pbc_policy))
{
- this->priority_banded_connection_policy_ =
+ this->priority_banded_connection_policy_ =
ACE_static_cast (TAO_PriorityBandedConnectionPolicy *,
pbc_policy);
-
- this->priority_banded_connection_policy_->_add_ref ();
}
}
-
- return this->priority_banded_connection_policy_;
}
-
TAO_ClientProtocolPolicy *
TAO_Stub::exposed_client_protocol (void)
{
- if (this->is_client_protocol_policy_parsed_)
- {
- if (!CORBA::is_nil (this->client_protocol_policy_))
- this->client_protocol_policy_->_add_ref ();
-
- return this->client_protocol_policy_;
- }
-
- this->is_client_protocol_policy_parsed_ = 1;
-
- CORBA::Policy *policy =
- this->parse_policy (RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE);
+ if (!this->are_policies_parsed_)
+ this->parse_policies ();
+
+ if (!CORBA::is_nil (this->client_protocol_policy_))
+ this->client_protocol_policy_->_add_ref ();
+
+ return this->client_protocol_policy_;
+}
+void
+TAO_Stub::exposed_client_protocol (CORBA::Policy_ptr policy)
+{
if (!CORBA::is_nil (policy))
{
- RTCORBA::ClientProtocolPolicy *cp_policy = 0;
-
- cp_policy =
+ RTCORBA::ClientProtocolPolicy_ptr cp_policy =
RTCORBA::ClientProtocolPolicy::_narrow (policy);
-
+
if (!CORBA::is_nil (cp_policy))
{
this->client_protocol_policy_ =
ACE_static_cast (TAO_ClientProtocolPolicy *,
cp_policy);
-
- this->client_protocol_policy_->_add_ref ();
}
}
-
- return this->client_protocol_policy_;
}
- #endif /* TAO_HAS_RT_CORBA == 1 */
+#endif /* TAO_HAS_RT_CORBA == 1 */
CORBA::Policy_ptr
TAO_Stub::get_policy (CORBA::PolicyType type,
@@ -864,7 +834,7 @@ TAO_Stub::set_policy_overrides (const CORBA::PolicyList & policies,
CORBA::SET_OVERRIDE,
ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
- }
+ }
else
{
policy_manager->copy_from (this->policies_,
@@ -897,7 +867,7 @@ TAO_Stub::get_policy_overrides (const CORBA::PolicyTypeSeq &types,
return 0;
return this->policies_->get_policy_overrides (types,
- ACE_TRY_ENV);
+ ACE_TRY_ENV);
}
CORBA::Boolean
diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h
index d546a34f68d..d203eac116d 100644
--- a/TAO/tao/Stub.h
+++ b/TAO/tao/Stub.h
@@ -423,9 +423,14 @@ private:
private:
- CORBA::Policy *parse_policy (CORBA::PolicyType ptype);
- // Helper method used to retrieve a given policy type
- // from the policy list.
+ void parse_policies (void);
+ // Helper method used to parse the policies.
+
+ void exposed_priority_model (CORBA::Policy_ptr policy);
+
+ void exposed_priority_banded_connection (CORBA::Policy_ptr policy);
+
+ void exposed_client_protocol (CORBA::Policy_ptr policy);
private:
@@ -435,13 +440,12 @@ private:
// are asked about a given policy.
TAO_PriorityModelPolicy *priority_model_policy_;
- CORBA::Boolean is_priority_model_policy_parsed_;
TAO_PriorityBandedConnectionPolicy *priority_banded_connection_policy_;
- CORBA::Boolean is_priority_banded_policy_parsed_;
TAO_ClientProtocolPolicy *client_protocol_policy_;
- CORBA::Boolean is_client_protocol_policy_parsed_;
+
+ CORBA::Boolean are_policies_parsed_;
#endif /* TAO_HAS_RT_CORBA == 1 */
private: