diff options
Diffstat (limited to 'TAO/tao/Acceptor_Registry.cpp')
-rw-r--r-- | TAO/tao/Acceptor_Registry.cpp | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/TAO/tao/Acceptor_Registry.cpp b/TAO/tao/Acceptor_Registry.cpp index 04deb6a9bee..b2dce09b497 100644 --- a/TAO/tao/Acceptor_Registry.cpp +++ b/TAO/tao/Acceptor_Registry.cpp @@ -9,7 +9,7 @@ #include "tao/MProfile.h" #include "tao/debug.h" #include "tao/RT_Policy_i.h" -#include "tao/POA.h" +#include "tao/Acceptor_Filter.h" #include "ace/Auto_Ptr.h" @@ -51,7 +51,7 @@ TAO_Acceptor_Registry::endpoint_count (void) int TAO_Acceptor_Registry::make_mprofile (const TAO_ObjectKey &object_key, TAO_MProfile &mprofile, - TAO_POA *poa) + TAO_Acceptor_Filter *filter) { // Allocate space for storing the profiles. There can never be more // profiles than there are endpoints. In some cases, there can be @@ -61,43 +61,14 @@ TAO_Acceptor_Registry::make_mprofile (const TAO_ObjectKey &object_key, return -1; TAO_AcceptorSetIterator end = this->end (); - - // @@ We may want to strategize the code below, i.e., mprofile - // creation: have different strategies for deciding - // which profiles get included. Currently, there are two - // cases: regular - all profiles are included, and rt - - // RTCORBA::ServerProtocolPolicy determines what's included. - -#if (TAO_HAS_RT_CORBA == 1) - - // RTCORBA 1.0, Section 4.15.1: ServerProtocolPolicy determines - // which protocols get included into IOR and in what order. - TAO_ServerProtocolPolicy *policy = - poa->policies ().server_protocol (); - RTCORBA::ProtocolList & protocols = policy->protocols_rep (); - - for (CORBA::ULong j = 0; j < protocols.length (); ++j) + for (TAO_AcceptorSetIterator i = this->begin (); i != end; ++i) { - CORBA::ULong protocol_type = protocols[j].protocol_type; - - for (TAO_AcceptorSetIterator i = this->begin (); i != end; ++i) - if ((*i)->tag () == protocol_type - && (*i)->create_mprofile (object_key, - mprofile) == -1) - return -1; + if (filter == 0 || filter->evaluate (*i)) + { + if ((*i)->create_mprofile (object_key, mprofile) == -1) + return -1; + } } - // @@ May want to optimize later rather than doing the double loop above. - -#else /* TAO_HAS_RT_CORBA == 1 */ - - ACE_UNUSED_ARG (poa); - - for (TAO_AcceptorSetIterator i = this->begin (); i != end; ++i) - if ((*i)->create_mprofile (object_key, - mprofile) == -1) - return -1; - -#endif /* TAO_HAS_RT_CORBA == 1 */ return 0; } |