00001 // @(#) $Id: Default_Acceptor_Filter.cpp 71473 2006-03-10 07:19:20Z jtc $ 00002 00003 #include "tao/PortableServer/Default_Acceptor_Filter.h" 00004 #include "tao/Transport_Acceptor.h" 00005 #include "tao/MProfile.h" 00006 #include "tao/Profile.h" 00007 00008 ACE_RCSID(PortableServer, 00009 Default_Acceptor_Filter, 00010 "$Id: Default_Acceptor_Filter.cpp 71473 2006-03-10 07:19:20Z jtc $") 00011 00012 00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00014 00015 TAO_Default_Acceptor_Filter::TAO_Default_Acceptor_Filter (void) 00016 { 00017 } 00018 00019 int 00020 TAO_Default_Acceptor_Filter::fill_profile (const TAO::ObjectKey &object_key, 00021 TAO_MProfile &mprofile, 00022 TAO_Acceptor **acceptors_begin, 00023 TAO_Acceptor **acceptors_end, 00024 CORBA::Short priority) 00025 { 00026 // Go through all the acceptors. 00027 for (TAO_Acceptor** acceptor = acceptors_begin; 00028 acceptor != acceptors_end; 00029 ++acceptor) 00030 { 00031 // Ask each acceptor to make a profile. 00032 if ((*acceptor)->create_profile (object_key, 00033 mprofile, 00034 priority) == -1) 00035 return -1; 00036 } 00037 00038 return 0; 00039 } 00040 00041 int 00042 TAO_Default_Acceptor_Filter::encode_endpoints (TAO_MProfile &mprofile) 00043 { 00044 // if -ORBUseSharedProfile is set, there may be multiple endpoints 00045 // per profile, even without priority. 00046 for (CORBA::ULong i = 0; 00047 i < mprofile.profile_count (); 00048 ++i) 00049 { 00050 TAO_Profile *profile = mprofile.get_profile (i); 00051 if (profile->encode_alternate_endpoints () == -1) 00052 return -1; 00053 } 00054 00055 return 0; 00056 } 00057 00058 TAO_END_VERSIONED_NAMESPACE_DECL