diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-02-08 18:05:11 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-02-08 18:05:11 +0000 |
commit | 269fccc59419c74e54cf142d32dbf76ea351054c (patch) | |
tree | 02598624ba26fd138c6836ab2d11d95689241ae8 | |
parent | 6f2aab5cf5b2ef376cd5910d079bb2765ae9efce (diff) | |
download | ATCD-269fccc59419c74e54cf142d32dbf76ea351054c.tar.gz |
*** empty log message ***
144 files changed, 2641 insertions, 1500 deletions
diff --git a/TAO/tao/Active_Object_Map.cpp b/TAO/tao/Active_Object_Map.cpp index 713ac39eccf..11ffc32b64f 100644 --- a/TAO/tao/Active_Object_Map.cpp +++ b/TAO/tao/Active_Object_Map.cpp @@ -8,7 +8,7 @@ #include "ace/Auto_Ptr.h" -ACE_RCSID(tao, POA, "$Id$") +ACE_RCSID(tao, Active_Object_Map, "$Id$") TAO_Active_Object_Map::Map_Entry::Map_Entry (void) : user_id_ (), @@ -32,10 +32,12 @@ TAO_Active_Object_Map::set_system_id_size { switch (creation_parameters.object_lookup_strategy_for_system_id_policy_) { +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) case TAO_LINEAR: TAO_Active_Object_Map::system_id_size_ = sizeof (CORBA::ULong); break; +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_DYNAMIC_HASH: default: @@ -54,6 +56,7 @@ TAO_Active_Object_Map::set_system_id_size { switch (creation_parameters.object_lookup_strategy_for_system_id_policy_) { +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) case TAO_LINEAR: TAO_Active_Object_Map::system_id_size_ = sizeof (CORBA::ULong); @@ -63,6 +66,7 @@ TAO_Active_Object_Map::set_system_id_size TAO_Active_Object_Map::system_id_size_ = sizeof (CORBA::ULong); break; +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_ACTIVE_DEMUX: default: @@ -182,11 +186,19 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (int user_id_policy, switch (creation_parameters.reverse_object_lookup_strategy_for_unique_id_policy_) { case TAO_LINEAR: +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) ACE_NEW_THROW_EX (sm, servant_linear_map (creation_parameters.active_object_map_size_), CORBA::NO_MEMORY ()); ACE_CHECK; break; +#else + ACE_ERROR ((LM_ERROR, + "linear option for -ORBUniqueidPolicyReverseDemuxStrategy " + "not supported with minimum POA maps. " + "Ingoring option to use default... \n")); + /* FALL THROUGH */ +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_DYNAMIC_HASH: default: @@ -208,11 +220,19 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (int user_id_policy, switch (creation_parameters.object_lookup_strategy_for_user_id_policy_) { case TAO_LINEAR: +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) ACE_NEW_THROW_EX (uim, user_id_linear_map (creation_parameters.active_object_map_size_), CORBA::NO_MEMORY ()); ACE_CHECK; break; +#else + ACE_ERROR ((LM_ERROR, + "linear option for -ORBUseridPolicyDemuxStrategy " + "not supported with minimum POA maps. " + "Ingoring option to use default... \n")); + /* FALL THROUGH */ +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_DYNAMIC_HASH: default: @@ -227,6 +247,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (int user_id_policy, { switch (creation_parameters.object_lookup_strategy_for_system_id_policy_) { +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) case TAO_LINEAR: ACE_NEW_THROW_EX (uim, user_id_linear_map (creation_parameters.active_object_map_size_), @@ -240,6 +261,15 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (int user_id_policy, CORBA::NO_MEMORY ()); ACE_CHECK; break; +#else + case TAO_LINEAR: + case TAO_DYNAMIC_HASH: + ACE_ERROR ((LM_ERROR, + "linear and dynamic options for -ORBSystemidPolicyDemuxStrategy " + "are not supported with minimum POA maps. " + "Ingoring option to use default... \n")); + /* FALL THROUGH */ +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_ACTIVE_DEMUX: default: @@ -971,6 +1001,7 @@ template class ACE_Hash_Map_Entry<servant, value>; template class ACE_Equal_To<id>; template class ACE_Equal_To<servant>; +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) // Map Manager related. template class ACE_Map_Manager_Iterator_Adapter<id_value_type, id, value>; template class ACE_Map_Manager_Iterator_Adapter<servant_value_type, servant, value>; @@ -988,6 +1019,7 @@ template class ACE_Map_Reverse_Iterator<id, value, ACE_Null_Mutex>; template class ACE_Map_Reverse_Iterator<servant, value, ACE_Null_Mutex>; template class ACE_Map_Entry<id, value>; template class ACE_Map_Entry<servant, value>; +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) @@ -1072,6 +1104,7 @@ typedef ACE_Noop_Key_Generator<servant> noop_servant_key_generator; #pragma instantiate ACE_Equal_To<id> #pragma instantiate ACE_Equal_To<servant> +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) // Map Manager related. #pragma instantiate ACE_Map_Manager_Iterator_Adapter<id_value_type, id, value> #pragma instantiate ACE_Map_Manager_Iterator_Adapter<servant_value_type, servant, value> @@ -1089,5 +1122,6 @@ typedef ACE_Noop_Key_Generator<servant> noop_servant_key_generator; #pragma instantiate ACE_Map_Reverse_Iterator<servant, value, ACE_Null_Mutex> #pragma instantiate ACE_Map_Entry<id, value> #pragma instantiate ACE_Map_Entry<servant, value> +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/Active_Object_Map.h b/TAO/tao/Active_Object_Map.h index 7545c612356..2da5d2240ab 100644 --- a/TAO/tao/Active_Object_Map.h +++ b/TAO/tao/Active_Object_Map.h @@ -184,11 +184,13 @@ public: TAO_Incremental_Key_Generator> user_id_hash_map; // Id hash map. +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) typedef ACE_Map_Manager_Adapter< PortableServer::ObjectId, Map_Entry *, TAO_Incremental_Key_Generator> user_id_linear_map; // Id linear map. +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ typedef ACE_Active_Map_Manager_Adapter< PortableServer::ObjectId, @@ -209,11 +211,13 @@ public: ACE_Noop_Key_Generator<PortableServer::Servant> > servant_hash_map; // Servant hash map. +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) typedef ACE_Map_Manager_Adapter< PortableServer::Servant, Map_Entry *, ACE_Noop_Key_Generator<PortableServer::Servant> > servant_linear_map; // Servant linear map. +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ user_id_map *user_id_map_; // Id map. diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp index 6f083e3240b..f9a75265904 100644 --- a/TAO/tao/Any.cpp +++ b/TAO/tao/Any.cpp @@ -482,7 +482,7 @@ CORBA_Any::operator<<= (CORBA::Short s) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Short insertion\n")); + ASYS_TEXT ("Exception in CORBA::Short insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -506,7 +506,7 @@ CORBA_Any::operator<<= (CORBA::UShort s) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::UShort insertion\n")); + ASYS_TEXT ("Exception in CORBA::UShort insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -530,7 +530,7 @@ CORBA_Any::operator<<= (CORBA::Long l) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Long insertion\n")); + ASYS_TEXT ("Exception in CORBA::Long insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -554,7 +554,7 @@ CORBA_Any::operator<<= (CORBA::ULong l) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::ULong insertion\n")); + ASYS_TEXT ("Exception in CORBA::ULong insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -578,7 +578,7 @@ CORBA_Any::operator<<= (CORBA::LongLong l) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::LongLong insertion\n")); + ASYS_TEXT ("Exception in CORBA::LongLong insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -602,7 +602,7 @@ CORBA_Any::operator<<= (CORBA::ULongLong l) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::ULongLong insertion\n")); + ASYS_TEXT ("Exception in CORBA::ULongLong insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -626,7 +626,7 @@ CORBA_Any::operator<<= (CORBA::Float f) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Float insertion\n")); + ASYS_TEXT ("Exception in CORBA::Float insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -650,7 +650,7 @@ CORBA_Any::operator<<= (CORBA::Double d) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Double insertion\n")); + ASYS_TEXT ("Exception in CORBA::Double insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -675,7 +675,7 @@ CORBA_Any::operator<<= (const CORBA_Any& a) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Any copying insertion\n")); + ASYS_TEXT ("Exception in CORBA::Any copying insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -697,7 +697,7 @@ CORBA::Any::operator<<= (CORBA::Any_ptr anyptr) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Any non-copying insertion\n")); + ASYS_TEXT ("Exception in CORBA::Any non-copying insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -723,7 +723,7 @@ CORBA_Any::operator<<= (from_boolean b) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Boolean insertion\n")); + ASYS_TEXT ("Exception in CORBA::Boolean insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -747,7 +747,7 @@ CORBA_Any::operator<<= (from_octet o) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Octet insertion\n")); + ASYS_TEXT ("Exception in CORBA::Octet insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -771,7 +771,7 @@ CORBA_Any::operator<<= (from_char c) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Char insertion\n")); + ASYS_TEXT ("Exception in CORBA::Char insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -795,7 +795,7 @@ CORBA_Any::operator<<= (from_wchar wc) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::WChar insertion\n")); + ASYS_TEXT ("Exception in CORBA::WChar insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -823,7 +823,7 @@ CORBA_Any::operator<<= (CORBA::TypeCode_ptr tc) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::TypeCode_ptr insertion\n")); + ASYS_TEXT ("Exception in CORBA::TypeCode_ptr insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -850,7 +850,7 @@ CORBA_Any::operator<<= (const CORBA_Exception &exception) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Exception insertion\n")); + ASYS_TEXT ("Exception in CORBA::Exception insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -891,7 +891,7 @@ CORBA::Any::operator<<= (CORBA::Object_ptr *objptr) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Object_ptr insertion\n")); + ASYS_TEXT ("Exception in CORBA::Object_ptr insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -955,7 +955,7 @@ CORBA_Any::operator<<= (from_string s) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in bounded string insertion\n")); + ASYS_TEXT ("Exception in bounded string insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -1017,7 +1017,7 @@ CORBA_Any::operator<<= (from_wstring ws) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in bounded wstring insertion\n")); + ASYS_TEXT ("Exception in bounded wstring insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -1060,7 +1060,7 @@ CORBA_Any::operator>>= (CORBA::Short &s) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Short extraction\n")); + ASYS_TEXT ("Exception in CORBA::Short extraction\n"))); } ACE_ENDTRY; @@ -1100,7 +1100,7 @@ CORBA_Any::operator>>= (CORBA::UShort &s) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::UShort extraction\n")); + ASYS_TEXT ("Exception in CORBA::UShort extraction\n"))); } ACE_ENDTRY; @@ -1140,7 +1140,7 @@ CORBA_Any::operator>>= (CORBA::Long &l) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Long extraction\n")); + ASYS_TEXT ("Exception in CORBA::Long extraction\n"))); } ACE_ENDTRY; @@ -1180,7 +1180,7 @@ CORBA_Any::operator>>= (CORBA::ULong &l) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::ULong extraction\n")); + ASYS_TEXT ("Exception in CORBA::ULong extraction\n"))); } ACE_ENDTRY; @@ -1220,7 +1220,7 @@ CORBA_Any::operator>>= (CORBA::LongLong &l) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::LongLong extraction\n")); + ASYS_TEXT ("Exception in CORBA::LongLong extraction\n"))); } ACE_ENDTRY; @@ -1260,7 +1260,7 @@ CORBA_Any::operator>>= (CORBA::ULongLong &l) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::ULongLong extraction\n")); + ASYS_TEXT ("Exception in CORBA::ULongLong extraction\n"))); } ACE_ENDTRY; @@ -1300,7 +1300,7 @@ CORBA_Any::operator>>= (CORBA::Float &f) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Float extraction\n")); + ASYS_TEXT ("Exception in CORBA::Float extraction\n"))); } ACE_ENDTRY; @@ -1340,7 +1340,7 @@ CORBA_Any::operator>>= (CORBA::Double &d) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Double extraction\n")); + ASYS_TEXT ("Exception in CORBA::Double extraction\n"))); } ACE_ENDTRY; @@ -1375,6 +1375,8 @@ CORBA_Any::operator>>= (CORBA::Any &a) const &a, 0, ACE_TRY_ENV); + ACE_TRY_CHECK; + return (CORBA::Boolean) ((retval == CORBA::TypeCode::TRAVERSE_CONTINUE) ? 1 : 0); @@ -1388,7 +1390,7 @@ CORBA_Any::operator>>= (CORBA::Any &a) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Any extraction\n")); + ASYS_TEXT ("Exception in CORBA::Any extraction\n"))); } ACE_ENDTRY; @@ -1396,6 +1398,68 @@ CORBA_Any::operator>>= (CORBA::Any &a) const } CORBA::Boolean +CORBA_Any::operator>>= (const CORBA::Any *&a) const +{ + ACE_DECLARE_NEW_CORBA_ENV; + + ACE_TRY + { + CORBA::Boolean result = + this->type_->equivalent (CORBA::_tc_any, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (result) + { + if (this->any_owns_data_ && this->value_) + { + a = (CORBA::Any *) this->value_; + return 1; + } + else + { + ACE_NEW_RETURN (a, + CORBA::Any, + 0); + TAO_InputCDR stream (this->cdr_); + // decode the CDR + CORBA::TypeCode::traverse_status retval = + stream.decode (CORBA::_tc_any, + a, + 0, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE) + { + return 1; + } + else + { + delete ACE_const_cast (CORBA::Any *&, a); + a = 0; + return 0; + } + } + } + else + { + a = 0; + return 0; + } + } + ACE_CATCHANY + { + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("Exception in CORBA::Any extraction\n"))); + } + ACE_ENDTRY; + + a = 0; + return 0; +} + +CORBA::Boolean CORBA_Any::operator>>= (char *&s) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1435,21 +1499,91 @@ CORBA_Any::operator>>= (char *&s) const return 1; } - return 0; + else + { + s = 0; + return 0; + } + } + } + else + { + s = 0; + return 0; + } + } + ACE_CATCHANY + { + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("Exception in unbounded string extraction\n"))); + } + ACE_ENDTRY; + + s = 0; + return 0; +} + +CORBA::Boolean +CORBA_Any::operator>>= (const char *&s) const +{ + ACE_DECLARE_NEW_CORBA_ENV; + + ACE_TRY + { + CORBA::Boolean result = + this->type_->equivalent (CORBA::_tc_string, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (result) + { + if (this->any_owns_data_ && this->value_) + { + s = *(char **) this->value_; + return 1; + } + else + { + TAO_InputCDR stream (this->cdr_); + if (stream.read_string ((char *&)s)) + { + ACE_const_cast (CORBA_Any *, + this)->any_owns_data_ = 1; + + char **tmp; + + ACE_NEW_RETURN (tmp, + char *, + 0); + + *tmp = (char *)s; + + ACE_const_cast (CORBA_Any *, + this)->value_ = tmp; + + return 1; + } + else + { + s = 0; + return 0; + } } } else { + s = 0; return 0; } } ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in unbounded string extraction\n")); + ASYS_TEXT ("Exception in unbounded string extraction\n"))); } ACE_ENDTRY; + s = 0; return 0; } @@ -1493,21 +1627,91 @@ CORBA_Any::operator>>= (CORBA::WChar *&ws) const return 1; } - return 0; + else + { + ws = 0; + return 0; + } + } + } + else + { + ws = 0; + return 0; + } + } + ACE_CATCHANY + { + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("Exception in unbounded wstring extraction\n"))); + } + ACE_ENDTRY; + + ws = 0; + return 0; +} + +CORBA::Boolean +CORBA_Any::operator>>= (const CORBA::WChar *&ws) const +{ + ACE_DECLARE_NEW_CORBA_ENV; + + ACE_TRY + { + CORBA::Boolean result = + this->type_->equivalent (CORBA::_tc_wstring, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (result) + { + if (this->any_owns_data_ && this->value_) + { + ws = *(CORBA::WChar **) this->value_; + return 1; + } + else + { + TAO_InputCDR stream (this->cdr_); + if (stream.read_wstring ((CORBA::WChar *&)ws)) + { + ACE_const_cast (CORBA_Any *, + this)->any_owns_data_ = 1; + + CORBA::WChar **tmp; + + ACE_NEW_RETURN (tmp, + CORBA::WChar *, + 0); + + *tmp = (CORBA::WChar *)ws; + + ACE_const_cast (CORBA_Any *, + this)->value_ = tmp; + + return 1; + } + else + { + ws = 0; + return 0; + } } } else { + ws = 0; return 0; } } ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in unbounded wstring extraction\n")); + ASYS_TEXT ("Exception in unbounded wstring extraction\n"))); } ACE_ENDTRY; + ws = 0; return 0; } @@ -1552,7 +1756,7 @@ CORBA_Any::operator>>= (CORBA::TypeCode_ptr &tc) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::TypeCode_ptr extraction\n")); + ASYS_TEXT ("Exception in CORBA::TypeCode_ptr extraction\n"))); } ACE_ENDTRY; @@ -1594,7 +1798,7 @@ CORBA_Any::operator>>= (to_boolean b) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Boolean extraction\n")); + ASYS_TEXT ("Exception in CORBA::Boolean extraction\n"))); } ACE_ENDTRY; @@ -1634,7 +1838,7 @@ CORBA_Any::operator>>= (to_octet o) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Octet extraction\n")); + ASYS_TEXT ("Exception in CORBA::Octet extraction\n"))); } ACE_ENDTRY; @@ -1674,7 +1878,7 @@ CORBA_Any::operator>>= (to_char c) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Char extraction\n")); + ASYS_TEXT ("Exception in CORBA::Char extraction\n"))); } ACE_ENDTRY; @@ -1714,7 +1918,7 @@ CORBA_Any::operator>>= (to_wchar wc) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::WChar extraction\n")); + ASYS_TEXT ("Exception in CORBA::WChar extraction\n"))); } ACE_ENDTRY; @@ -1772,7 +1976,7 @@ CORBA_Any::operator>>= (to_string s) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in bounded string extraction\n")); + ASYS_TEXT ("Exception in bounded string extraction\n"))); } ACE_ENDTRY; @@ -1830,7 +2034,7 @@ CORBA_Any::operator>>= (to_wstring ws) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in bounded wstring extraction\n")); + ASYS_TEXT ("Exception in bounded wstring extraction\n"))); } ACE_ENDTRY; @@ -1890,7 +2094,7 @@ CORBA_Any::operator>>= (to_object obj) const ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in CORBA::Object_ptr extraction\n")); + ASYS_TEXT ("Exception in CORBA::Object_ptr extraction\n"))); } ACE_ENDTRY; @@ -1921,7 +2125,7 @@ CORBA_Any::operator<<= (const char* s) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in unbounded string insertion\n")); + ASYS_TEXT ("Exception in unbounded string insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -1949,7 +2153,7 @@ CORBA_Any::operator<<= (const CORBA::WChar* s) ACE_CATCHANY { ACE_DEBUG ((LM_DEBUG, - "Exception in unbounded wstring insertion\n")); + ASYS_TEXT ("Exception in unbounded wstring insertion\n"))); } ACE_ENDTRY; ACE_CHECK; @@ -2005,18 +2209,18 @@ CORBA_Any::dump (const CORBA::Any &any_value) { case CORBA::tk_null: ACE_DEBUG ((LM_DEBUG, - "Null\n")); + ASYS_TEXT ("Null\n"))); break; case CORBA::tk_void: ACE_DEBUG ((LM_DEBUG, - "Void\n")); + ASYS_TEXT ("Void\n"))); break; case CORBA::tk_short: { CORBA::Short s; any_value >>= s; ACE_DEBUG ((LM_DEBUG, - "Short %d\n", + ASYS_TEXT ("Short %d\n"), s)); break; } @@ -2025,7 +2229,7 @@ CORBA_Any::dump (const CORBA::Any &any_value) CORBA::Long l; any_value >>= l; ACE_DEBUG ((LM_DEBUG, - "Long %d\n", + ASYS_TEXT ("Long %d\n"), l)); break; } @@ -2034,7 +2238,7 @@ CORBA_Any::dump (const CORBA::Any &any_value) CORBA::UShort s; any_value >>= s; ACE_DEBUG ((LM_DEBUG, - "UShort %d\n", + ASYS_TEXT ("UShort %d\n"), s)); break; } @@ -2043,7 +2247,7 @@ CORBA_Any::dump (const CORBA::Any &any_value) CORBA::ULong l; any_value >>= l; ACE_DEBUG ((LM_DEBUG, - "ULong %d\n", + ASYS_TEXT ("ULong %d\n"), l)); break; } @@ -2052,7 +2256,7 @@ CORBA_Any::dump (const CORBA::Any &any_value) CORBA::Float f; any_value >>= f; ACE_DEBUG ((LM_DEBUG, - "Float %f\n", + ASYS_TEXT ("Float %f\n"), f)); break; } @@ -2061,7 +2265,7 @@ CORBA_Any::dump (const CORBA::Any &any_value) CORBA::Double d; any_value >>= d; ACE_DEBUG ((LM_DEBUG, - "Double %f\n", + ASYS_TEXT ("Double %f\n"), d)); break; } @@ -2073,12 +2277,12 @@ CORBA_Any::dump (const CORBA::Any &any_value) if (b == 1) { ACE_DEBUG ((LM_DEBUG, - "Boolean TRUE\n")); + ASYS_TEXT ("Boolean TRUE\n"))); } else { ACE_DEBUG ((LM_DEBUG, - "Boolean FALSE\n")); + ASYS_TEXT ("Boolean FALSE\n"))); } break; } @@ -2088,7 +2292,7 @@ CORBA_Any::dump (const CORBA::Any &any_value) to_char tch (ch); any_value >>= tch; ACE_DEBUG ((LM_DEBUG, - "Char %c\n", + ASYS_TEXT ("Char %c\n"), ch)); break; } @@ -2097,13 +2301,13 @@ CORBA_Any::dump (const CORBA::Any &any_value) char* str; any_value >>= str; ACE_DEBUG ((LM_DEBUG, - "String %s\n", + ASYS_TEXT ("String %s\n"), str)); break; } default: ACE_DEBUG ((LM_DEBUG, - "TCKind %d\n", + ASYS_TEXT ("TCKind %d\n"), kind)); break; } diff --git a/TAO/tao/Asynch_Invocation.cpp b/TAO/tao/Asynch_Invocation.cpp index d252b5d137e..8e182fff3e6 100644 --- a/TAO/tao/Asynch_Invocation.cpp +++ b/TAO/tao/Asynch_Invocation.cpp @@ -103,8 +103,10 @@ TAO_GIOP_Twoway_Asynch_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) if (retval != TAO_INVOKE_OK) return retval; - // We do not wait for the reply. Let us return. + // Everything executed ok; lets remember the transport for later. + this->rd_->transport (this->transport_); + // We do not wait for the reply. Let us return. return TAO_INVOKE_OK; } @@ -168,8 +170,10 @@ TAO_GIOP_DII_Deferred_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) if (retval != TAO_INVOKE_OK) return retval; - // We do not wait for the reply. Let us return. + // Everything executed ok; lets remember the transport for later. + this->rd_->transport (this->transport_); + // We do not wait for the reply. Let us return. return TAO_INVOKE_OK; } diff --git a/TAO/tao/Asynch_Invocation.h b/TAO/tao/Asynch_Invocation.h index 51754a07423..f4562d39a99 100644 --- a/TAO/tao/Asynch_Invocation.h +++ b/TAO/tao/Asynch_Invocation.h @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/Buffering_Constraint_Policy.h b/TAO/tao/Buffering_Constraint_Policy.h index b2e6267b677..6bd41a43d4f 100644 --- a/TAO/tao/Buffering_Constraint_Policy.h +++ b/TAO/tao/Buffering_Constraint_Policy.h @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // $Id$ + // // ============================================================================ // diff --git a/TAO/tao/Buffering_Constraint_Policy.i b/TAO/tao/Buffering_Constraint_Policy.i index 6a7f3a8df4e..92b7a9af7ba 100644 --- a/TAO/tao/Buffering_Constraint_Policy.i +++ b/TAO/tao/Buffering_Constraint_Policy.i @@ -11,3 +11,4 @@ TAO_Buffering_Constraint_Policy::buffering_constraint (void) { return this->buffering_constraint_; } + diff --git a/TAO/tao/CDR.h b/TAO/tao/CDR.h index 689e7022454..12b47fcd189 100644 --- a/TAO/tao/CDR.h +++ b/TAO/tao/CDR.h @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/CDR_Interpreter.cpp b/TAO/tao/CDR_Interpreter.cpp index 9ab96f9a2ad..2927990f6fa 100644 --- a/TAO/tao/CDR_Interpreter.cpp +++ b/TAO/tao/CDR_Interpreter.cpp @@ -298,7 +298,7 @@ TAO_CDR_Interpreter::calc_nested_size_and_alignment_i (CORBA::TypeCode_ptr tc, if (TAO_CDR_Interpreter::table_[kind].calc_ != 0) { - assert (TAO_CDR_Interpreter::table_[kind].size_ == 0); + ACE_ASSERT (TAO_CDR_Interpreter::table_[kind].size_ == 0); // Pull encapsulation length out of the stream. if (stream->read_ulong (temp) == 0) @@ -319,7 +319,7 @@ TAO_CDR_Interpreter::calc_nested_size_and_alignment_i (CORBA::TypeCode_ptr tc, // any to ensure correctness. Then use the calculator routine // to calculate size and alignment. - assert (temp <= UINT_MAX); + ACE_ASSERT (temp <= UINT_MAX); TAO_InputCDR nested (*stream, temp); @@ -344,7 +344,7 @@ TAO_CDR_Interpreter::calc_nested_size_and_alignment_i (CORBA::TypeCode_ptr tc, } return size; } - assert (TAO_CDR_Interpreter::table_[kind].size_ != 0); + ACE_ASSERT (TAO_CDR_Interpreter::table_[kind].size_ != 0); // Reinitialize the TypeCode if requested; this consumes any // TypeCode parameters in the stream. They only exist for TCKind @@ -360,7 +360,7 @@ TAO_CDR_Interpreter::calc_nested_size_and_alignment_i (CORBA::TypeCode_ptr tc, switch (kind) { default: - assert (TAO_CDR_Interpreter::table_[kind].skipper_ == 0); + ACE_ASSERT (TAO_CDR_Interpreter::table_[kind].skipper_ == 0); break; case CORBA::tk_string: @@ -381,7 +381,7 @@ TAO_CDR_Interpreter::calc_nested_size_and_alignment_i (CORBA::TypeCode_ptr tc, } tc->length_ = len; - assert (len < UINT_MAX); + ACE_ASSERT (len < UINT_MAX); tc->buffer_ = stream->rd_ptr (); stream->skip_bytes (len); break; @@ -1107,7 +1107,7 @@ TAO_CDR_Interpreter::calc_union_attr_is_var_sized_member if (stream->read_ulong (encap) == 0) return -1; - assert (encap <= UINT_MAX); + ACE_ASSERT (encap <= UINT_MAX); TAO_InputCDR nested (*stream, temp); @@ -1133,7 +1133,7 @@ TAO_CDR_Interpreter::calc_union_attr_is_var_sized_member if (stream->read_ulong (encap) == 0) return -1; - assert (encap <= UINT_MAX); + ACE_ASSERT (encap <= UINT_MAX); TAO_InputCDR nested (*stream, temp); diff --git a/TAO/tao/CONV_FRAMEC.h b/TAO/tao/CONV_FRAMEC.h index a3e92f1f56b..eb76729fc8e 100644 --- a/TAO/tao/CONV_FRAMEC.h +++ b/TAO/tao/CONV_FRAMEC.h @@ -1,5 +1,6 @@ // $Id$ + // // ================================================================ // diff --git a/TAO/tao/Client_Priority_Policy.cpp b/TAO/tao/Client_Priority_Policy.cpp index 200c45bd21e..a0ce82e96fc 100644 --- a/TAO/tao/Client_Priority_Policy.cpp +++ b/TAO/tao/Client_Priority_Policy.cpp @@ -6,7 +6,7 @@ #include "tao/Client_Priority_Policy.i" #endif /* __ACE_INLINE__ */ -#if defined (TAO_HAS_CORBA_MESSAGING) +#if (TAO_HAS_CORBA_MESSAGING == 1) ACE_RCSID(TAO, Client_Priority_Policy, "$Id$") @@ -117,4 +117,4 @@ TAO_Client_Priority_Policy::_default_POA (CORBA_Environment &) #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* TAO_HAS_CORBA_MESSAGING */ +#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/Client_Priority_Policy.h b/TAO/tao/Client_Priority_Policy.h index dfbbacf6268..972120df484 100644 --- a/TAO/tao/Client_Priority_Policy.h +++ b/TAO/tao/Client_Priority_Policy.h @@ -28,7 +28,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if defined (TAO_HAS_CORBA_MESSAGING) +#if (TAO_HAS_CORBA_MESSAGING == 1) #include "tao/TAOS.h" @@ -97,7 +97,7 @@ private: #pragma warning(pop) #endif /* _MSC_VER */ -#endif /* TAO_HAS_CORBA_MESSAGING */ +#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ #if defined (__ACE_INLINE__) #include "tao/Client_Priority_Policy.i" diff --git a/TAO/tao/Client_Priority_Policy.i b/TAO/tao/Client_Priority_Policy.i index 6976e97a216..bbbd94029d1 100644 --- a/TAO/tao/Client_Priority_Policy.i +++ b/TAO/tao/Client_Priority_Policy.i @@ -1,5 +1,5 @@ // $Id$ -#if defined (TAO_HAS_CORBA_MESSAGING) +#if (TAO_HAS_CORBA_MESSAGING == 1) -#endif /* TAO_HAS_CORBA_MESSAGING */ +#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 086f034a200..e7d990be362 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -14,6 +14,7 @@ ACE_RCSID(tao, Connector_Registry, "$Id$") + TAO_Connector_Registry::TAO_Connector_Registry (void) : connectors_ (0), size_ (0) diff --git a/TAO/tao/Connector_Registry.h b/TAO/tao/Connector_Registry.h index 5d474926348..03f1eaca430 100644 --- a/TAO/tao/Connector_Registry.h +++ b/TAO/tao/Connector_Registry.h @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/Direct_Priority_Mapping.cpp b/TAO/tao/Direct_Priority_Mapping.cpp index 11e90ce7f4f..15f654ead3d 100644 --- a/TAO/tao/Direct_Priority_Mapping.cpp +++ b/TAO/tao/Direct_Priority_Mapping.cpp @@ -2,7 +2,7 @@ #include "tao/orbconf.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/Direct_Priority_Mapping.h" #include "tao/debug.h" @@ -126,4 +126,4 @@ TAO_Direct_Priority_Mapping::to_CORBA (RTCORBA::NativePriority native_priority, #endif /* ACE_WIN32 */ } -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/Direct_Priority_Mapping.h b/TAO/tao/Direct_Priority_Mapping.h index f23809988cb..118edce2224 100644 --- a/TAO/tao/Direct_Priority_Mapping.h +++ b/TAO/tao/Direct_Priority_Mapping.h @@ -22,7 +22,7 @@ #include "tao/orbconf.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/Priority_Mapping.h" @@ -69,6 +69,6 @@ private: # include "tao/Direct_Priority_Mapping.i" #endif /* __ACE_INLINE__ */ -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ #endif /* TAO_DIRECT_PRIORITY_MAPPING_H */ diff --git a/TAO/tao/DomainC.cpp b/TAO/tao/DomainC.cpp index d2a21ece8c9..90e44490f94 100644 --- a/TAO/tao/DomainC.cpp +++ b/TAO/tao/DomainC.cpp @@ -116,7 +116,7 @@ CORBA::Policy_ptr CORBA_DomainManager::get_domain_policy ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -251,7 +251,7 @@ void CORBA::ConstructionPolicy::make_domain_manager ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); diff --git a/TAO/tao/DomainC.h b/TAO/tao/DomainC.h index 41f5d45b087..38c306d1666 100644 --- a/TAO/tao/DomainC.h +++ b/TAO/tao/DomainC.h @@ -2,6 +2,7 @@ // $Id$ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/DomainS.cpp b/TAO/tao/DomainS.cpp index b46e8be807a..b1ab2782837 100644 --- a/TAO/tao/DomainS.cpp +++ b/TAO/tao/DomainS.cpp @@ -207,7 +207,7 @@ void POA_CORBA::DomainManager::_dispatch (CORBA::ServerRequest &req, void *conte // find the skeleton corresponding to this opname if (this->_find (opname, skel, req.operation_length ()) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -470,7 +470,7 @@ void POA_CORBA::ConstructionPolicy::_dispatch (CORBA::ServerRequest &req, void * // find the skeleton corresponding to this opname if (this->_find (opname, skel, req.operation_length ()) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else diff --git a/TAO/tao/DynStruct_i.cpp b/TAO/tao/DynStruct_i.cpp index 5d12ccc2b88..7814fe30020 100644 --- a/TAO/tao/DynStruct_i.cpp +++ b/TAO/tao/DynStruct_i.cpp @@ -302,6 +302,17 @@ TAO_DynStruct_i::from_any (const CORBA_Any& any, ACE_Message_Block* mb = any._tao_get_cdr (); TAO_InputCDR cdr (mb); + // If we have an exception type, unmarshal the repository ID. + CORBA::TCKind kind = TAO_DynAny_i::unalias (this->type_.in (), + ACE_TRY_ENV); + ACE_CHECK; + + if (kind == CORBA::tk_except) + { + CORBA::String_var str; + cdr >> str.out(); + } + for (CORBA::ULong i = 0; i < this->da_members_.size (); i++) @@ -342,6 +353,16 @@ TAO_DynStruct_i::to_any (CORBA::Environment& ACE_TRY_ENV) { TAO_OutputCDR out_cdr; + // If we have an exception type, marshal the repository ID. + CORBA::TCKind kind = TAO_DynAny_i::unalias (this->type_.in (), + ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + if (kind == CORBA::tk_except) + { + out_cdr << this->type_->id (); + } + for (CORBA::ULong i = 0; i < this->da_members_.size (); i++) diff --git a/TAO/tao/Environment.cpp b/TAO/tao/Environment.cpp index bdd144703c3..cbc6fb8facf 100644 --- a/TAO/tao/Environment.cpp +++ b/TAO/tao/Environment.cpp @@ -218,7 +218,7 @@ CORBA::Environment::print_exception (const char *info, const char *id = this->exception_->_id (); ACE_DEBUG ((LM_ERROR, - "TAO: (%P|%t) EXCEPTION, %s\n", + ASYS_TEXT ("TAO: (%P|%t) EXCEPTION, %s\n"), info)); CORBA::SystemException *x2 = @@ -231,12 +231,12 @@ CORBA::Environment::print_exception (const char *info, // held within it ... ACE_DEBUG ((LM_ERROR, - "TAO: (%P|%t) user exception, ID '%s'\n", + ASYS_TEXT ("TAO: (%P|%t) user exception, ID '%s'\n"), id)); } else ACE_DEBUG ((LM_ERROR, - "TAO: (%P|%t) no exception, %s\n", info)); + ASYS_TEXT ("TAO: (%P|%t) no exception, %s\n"), info)); } CORBA_Environment_var & diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp index 4b73df08ad6..6971e535edc 100644 --- a/TAO/tao/Exception.cpp +++ b/TAO/tao/Exception.cpp @@ -101,8 +101,8 @@ CORBA_Exception::_tao_print_exception (const char *user_provided_info, FILE *) const { ACE_DEBUG ((LM_ERROR, - "(%P|%t) EXCEPTION, %s\n" - "%s\n", + ASYS_TEXT ("(%P|%t) EXCEPTION, %s\n") + ASYS_TEXT ("%s\n"), user_provided_info, this->_info ().c_str ())); } @@ -349,7 +349,7 @@ void CORBA_SystemException::_tao_print_system_exception (FILE *) const { ACE_DEBUG ((LM_ERROR, - "(%P|%t) system exception, ID '%s'\n", + ASYS_TEXT ("(%P|%t) system exception, ID '%s'\n"), this->_info ().c_str ())); } diff --git a/TAO/tao/Exception.h b/TAO/tao/Exception.h index 6b181b16677..3f9759adf12 100644 --- a/TAO/tao/Exception.h +++ b/TAO/tao/Exception.h @@ -2,6 +2,7 @@ // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/GIOP_Message_Base.i b/TAO/tao/GIOP_Message_Base.i index 935383709ec..5707d87adcc 100644 --- a/TAO/tao/GIOP_Message_Base.i +++ b/TAO/tao/GIOP_Message_Base.i @@ -33,12 +33,6 @@ TAO_GIOP_Message_Base::flags_offset (void) return TAO_GIOP_MESSAGE_FLAGS_OFFSET; } -/*ACE_INLINE const size_t -TAO_GIOP_Message_Base::message_size_offset (void) -{ - return TAO_GIOP_MESSAGE_SIZE_OFFSET; -} -*/ ACE_INLINE const size_t TAO_GIOP_Message_Base::message_type_offset (void) { diff --git a/TAO/tao/GIOP_Message_Connectors.cpp b/TAO/tao/GIOP_Message_Connectors.cpp index b37f2eea9e8..f0700550e44 100644 --- a/TAO/tao/GIOP_Message_Connectors.cpp +++ b/TAO/tao/GIOP_Message_Connectors.cpp @@ -28,7 +28,7 @@ TAO_GIOP_Message_Connectors:: // @@ (JP) Temporary hack until all of GIOP 1.2 is implemented. if (response_flags == 131) - out_stream << CORBA::Any::from_octet (1); + msg << CORBA::Any::from_octet (1); // Second the response flags // Sync scope - ignored by server if request is not oneway. diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp index d0efce4f92d..a40f5251cce 100644 --- a/TAO/tao/IIOP_Connect.cpp +++ b/TAO/tao/IIOP_Connect.cpp @@ -9,6 +9,7 @@ #include "tao/CDR.h" #include "tao/Messaging_Policy_i.h" + #if !defined (__ACE_INLINE__) # include "tao/IIOP_Connect.i" #endif /* ! __ACE_INLINE__ */ diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 2c2bed63e18..ed67ddf3f65 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + #include "tao/IIOP_Connector.h" #include "tao/IIOP_Profile.h" #include "tao/debug.h" @@ -12,6 +13,7 @@ ACE_RCSID(tao, IIOP_Connector, "$Id$") + #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) int TAO_IIOP_Connector::purge_connections (void) diff --git a/TAO/tao/IIOP_Factory.h b/TAO/tao/IIOP_Factory.h index 3cbe2908de8..c63f4e4a7c1 100644 --- a/TAO/tao/IIOP_Factory.h +++ b/TAO/tao/IIOP_Factory.h @@ -1,12 +1,13 @@ // -*- C++ -*- // $Id$ + // ============================================================================ // // = LIBRARY // TAO // // = FILENAME -// Protocol_Factory.h +// IIOP_Factory.h // // = AUTHOR // Fred Kuhns <fredk@cs.wustl.edu> diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 3e1604b9a5c..0f14c993bc9 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -4,6 +4,7 @@ + #include "tao/IIOP_Profile.h" #include "tao/IIOP_Connect.h" #include "tao/CDR.h" @@ -150,20 +151,27 @@ TAO_IIOP_Profile::decode (TAO_InputCDR& cdr) // Read and verify major, minor versions, ignoring IIOP // profiles whose versions we don't understand. // - if (!(cdr.read_octet (this->version_.major) - && this->version_.major == TAO_DEF_GIOP_MAJOR - && cdr.read_octet (this->version_.minor) - && this->version_.minor <= TAO_DEF_GIOP_MINOR)) + CORBA::Octet major, minor; + + if (!(cdr.read_octet (major) + && (major == TAO_DEF_GIOP_MAJOR) + && cdr.read_octet (minor))) { if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("TAO (%P|%t) IIOP_Profile::decode - v%d.%d\n"), - this->version_.major, - this->version_.minor)); + major, + minor)); } + return -1; } + this->version_.major = major; + + if (minor <= TAO_DEF_GIOP_MINOR) + this->version_.minor = minor; + // Get host and port if (cdr.read_string (this->host_.out ()) == 0 || cdr.read_ushort (this->port_) == 0) diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h index 513090cb1f3..af819a9a4d7 100644 --- a/TAO/tao/IIOP_Profile.h +++ b/TAO/tao/IIOP_Profile.h @@ -2,6 +2,7 @@ // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index d10b61ac733..2b25dfa60d6 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + #include "tao/IIOP_Transport.h" #include "tao/IIOP_Connect.h" #include "tao/IIOP_Profile.h" @@ -80,7 +81,7 @@ TAO_IIOP_Transport::handler (void) int TAO_IIOP_Transport::idle (void) { - return this->handler_->idle(); + return this->handler_->idle (); } void @@ -179,19 +180,6 @@ TAO_IIOP_Client_Transport::start_locate (TAO_ORB_Core */*orb_core*/, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - /* const TAO_IIOP_Profile* profile = - ACE_dynamic_cast(const TAO_IIOP_Profile*, pfile); */ - - // Obtain object key. - //const TAO_ObjectKey& key = profile->object_key (); - - // @@ This should be implemented in the transport object, which - // would query the profile to obtain the version... - /*if (TAO_GIOP::start_message (profile->version (), - TAO_GIOP::LocateRequest, - output, - orb_core) == 0)*/ - // See this is GIOP way of doing this..But anyway IIOP will be tied // up with GIOP. if (this->client_mesg_factory_->write_protocol_header diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index d644903f0bc..39f56f6d9ef 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -1,8 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/IOPC.h b/TAO/tao/IOPC.h index 80101595c52..9d547ecf8bf 100644 --- a/TAO/tao/IOPC.h +++ b/TAO/tao/IOPC.h @@ -2,6 +2,7 @@ // // $Id$ + // // ================================================================ // diff --git a/TAO/tao/IORC.h b/TAO/tao/IORC.h index 8867ae07ca4..23555b82629 100644 --- a/TAO/tao/IORC.h +++ b/TAO/tao/IORC.h @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // $Id$ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/IOR_LookupTable.cpp b/TAO/tao/IOR_LookupTable.cpp index 7cc6cc2bad4..2a0ed2c406f 100644 --- a/TAO/tao/IOR_LookupTable.cpp +++ b/TAO/tao/IOR_LookupTable.cpp @@ -1,5 +1,6 @@ // $Id$ + #include "tao/IOR_LookupTable.h" #include "tao/ObjectIDList.h" #include "tao/Exception.h" @@ -8,6 +9,7 @@ ACE_RCSID(tao, IOR_TableLookup, "$Id$") + int TAO_IOR_LookupTable_Callback::find_ior (const ACE_CString &, ACE_CString &) diff --git a/TAO/tao/IOR_LookupTable.h b/TAO/tao/IOR_LookupTable.h index 73f72837138..c9a67f615a9 100644 --- a/TAO/tao/IOR_LookupTable.h +++ b/TAO/tao/IOR_LookupTable.h @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/ImplRepoC.cpp b/TAO/tao/ImplRepoC.cpp index 3d122d0ff96..7e15c2ed3c0 100644 --- a/TAO/tao/ImplRepoC.cpp +++ b/TAO/tao/ImplRepoC.cpp @@ -110,7 +110,7 @@ void ImplementationRepository::ServerObject::ping ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -218,7 +218,7 @@ void ImplementationRepository::ServerObject::shutdown ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -1203,7 +1203,7 @@ void ImplementationRepository::Administration::activate_server ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -1324,7 +1324,7 @@ void ImplementationRepository::Administration::register_server ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -1440,7 +1440,7 @@ void ImplementationRepository::Administration::reregister_server ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -1561,7 +1561,7 @@ void ImplementationRepository::Administration::remove_server ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -1681,7 +1681,7 @@ void ImplementationRepository::Administration::shutdown_server ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -1803,7 +1803,7 @@ char * ImplementationRepository::Administration::server_is_running ( ) ); TAO_INTERCEPTOR_CHECK_RETURN (0); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK_RETURN (0); @@ -1932,7 +1932,7 @@ void ImplementationRepository::Administration::server_is_shutting_down ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -2054,7 +2054,7 @@ void ImplementationRepository::Administration::find ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -2175,7 +2175,7 @@ void ImplementationRepository::Administration::list ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; @@ -2622,7 +2622,7 @@ CORBA::Boolean ImplementationRepository::ServerInformationIterator::next_n ( ) ); TAO_INTERCEPTOR_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK_RETURN (_tao_retval); @@ -2743,7 +2743,7 @@ void ImplementationRepository::ServerInformationIterator::destroy ( ) ); TAO_INTERCEPTOR_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); TAO_INTERCEPTOR_CHECK; diff --git a/TAO/tao/InterceptorC.h b/TAO/tao/InterceptorC.h index 3bdf806c9fe..46aa32037ad 100644 --- a/TAO/tao/InterceptorC.h +++ b/TAO/tao/InterceptorC.h @@ -1,5 +1,6 @@ /* -*- C++ -*- $Id$ */ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/InterfaceC.cpp b/TAO/tao/InterfaceC.cpp index 42034569dc3..d415f783852 100644 --- a/TAO/tao/InterfaceC.cpp +++ b/TAO/tao/InterfaceC.cpp @@ -163,7 +163,7 @@ CORBA::DefinitionKind CORBA_IRObject::def_kind ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -221,7 +221,7 @@ void CORBA_IRObject::destroy ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -360,7 +360,7 @@ char * CORBA_Contained::id ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -419,7 +419,7 @@ void CORBA_Contained::id ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -478,7 +478,7 @@ char * CORBA_Contained::name ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -537,7 +537,7 @@ void CORBA_Contained::name ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -596,7 +596,7 @@ char * CORBA_Contained::version ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -655,7 +655,7 @@ void CORBA_Contained::version ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -714,7 +714,7 @@ CORBA_Container_ptr CORBA_Contained::defined_in ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -772,7 +772,7 @@ char * CORBA_Contained::absolute_name ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -830,7 +830,7 @@ CORBA_Repository_ptr CORBA_Contained::containing_repository ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -933,7 +933,7 @@ CORBA_Contained::Description * CORBA_Contained::describe ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -994,7 +994,7 @@ void CORBA_Contained::move ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2174,7 +2174,7 @@ CORBA_Contained_ptr CORBA_Container::lookup ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2241,7 +2241,7 @@ CORBA_ContainedSeq * CORBA_Container::contents ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2311,7 +2311,7 @@ CORBA_ContainedSeq * CORBA_Container::lookup_name ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2588,7 +2588,7 @@ CORBA_Container::DescriptionSeq * CORBA_Container::describe_contents ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2657,7 +2657,7 @@ CORBA_ModuleDef_ptr CORBA_Container::create_module ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2728,7 +2728,7 @@ CORBA_ConstantDef_ptr CORBA_Container::create_constant ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2800,7 +2800,7 @@ CORBA_StructDef_ptr CORBA_Container::create_struct ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2872,7 +2872,7 @@ CORBA_UnionDef_ptr CORBA_Container::create_union ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -2944,7 +2944,7 @@ CORBA_EnumDef_ptr CORBA_Container::create_enum ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3015,7 +3015,7 @@ CORBA_AliasDef_ptr CORBA_Container::create_alias ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3086,7 +3086,7 @@ CORBA_InterfaceDef_ptr CORBA_Container::create_interface ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3163,7 +3163,7 @@ CORBA_ValueDef_ptr CORBA_Container::create_value ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3240,7 +3240,7 @@ CORBA_ValueBoxDef_ptr CORBA_Container::create_value_box ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3311,7 +3311,7 @@ CORBA_ExceptionDef_ptr CORBA_Container::create_exception ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3452,7 +3452,7 @@ CORBA::TypeCode_ptr CORBA_IDLType::type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3618,7 +3618,7 @@ CORBA_Contained_ptr CORBA_Repository::lookup_id ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3683,7 +3683,7 @@ CORBA_PrimitiveDef_ptr CORBA_Repository::get_primitive ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3748,7 +3748,7 @@ CORBA_StringDef_ptr CORBA_Repository::create_string ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3813,7 +3813,7 @@ CORBA_WstringDef_ptr CORBA_Repository::create_wstring ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3879,7 +3879,7 @@ CORBA_SequenceDef_ptr CORBA_Repository::create_sequence ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -3946,7 +3946,7 @@ CORBA_ArrayDef_ptr CORBA_Repository::create_array ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4013,7 +4013,7 @@ CORBA_FixedDef_ptr CORBA_Repository::create_fixed ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4277,7 +4277,7 @@ CORBA::TypeCode_ptr CORBA_ConstantDef::type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4335,7 +4335,7 @@ CORBA_IDLType_ptr CORBA_ConstantDef::type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4394,7 +4394,7 @@ void CORBA_ConstantDef::type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4454,7 +4454,7 @@ CORBA_Any * CORBA_ConstantDef::value ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4513,7 +4513,7 @@ void CORBA_ConstantDef::value ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4829,7 +4829,7 @@ CORBA_StructMemberSeq * CORBA_StructDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -4888,7 +4888,7 @@ void CORBA_StructDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5025,7 +5025,7 @@ CORBA::TypeCode_ptr CORBA_UnionDef::discriminator_type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5083,7 +5083,7 @@ CORBA_IDLType_ptr CORBA_UnionDef::discriminator_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5142,7 +5142,7 @@ void CORBA_UnionDef::discriminator_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5202,7 +5202,7 @@ CORBA_UnionMemberSeq * CORBA_UnionDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5261,7 +5261,7 @@ void CORBA_UnionDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5399,7 +5399,7 @@ CORBA_EnumMemberSeq * CORBA_EnumDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5458,7 +5458,7 @@ void CORBA_EnumDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5594,7 +5594,7 @@ CORBA_IDLType_ptr CORBA_AliasDef::original_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5653,7 +5653,7 @@ void CORBA_AliasDef::original_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5789,7 +5789,7 @@ CORBA::PrimitiveKind CORBA_PrimitiveDef::kind ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5922,7 +5922,7 @@ CORBA::ULong CORBA_StringDef::bound ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -5981,7 +5981,7 @@ void CORBA_StringDef::bound ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6115,7 +6115,7 @@ CORBA::ULong CORBA_WstringDef::bound ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6174,7 +6174,7 @@ void CORBA_WstringDef::bound ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6308,7 +6308,7 @@ CORBA::UShort CORBA_FixedDef::digits ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6367,7 +6367,7 @@ void CORBA_FixedDef::digits ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6426,7 +6426,7 @@ CORBA::Short CORBA_FixedDef::scale ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6485,7 +6485,7 @@ void CORBA_FixedDef::scale ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6619,7 +6619,7 @@ CORBA::ULong CORBA_SequenceDef::bound ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6678,7 +6678,7 @@ void CORBA_SequenceDef::bound ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6737,7 +6737,7 @@ CORBA::TypeCode_ptr CORBA_SequenceDef::element_type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6795,7 +6795,7 @@ CORBA_IDLType_ptr CORBA_SequenceDef::element_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6854,7 +6854,7 @@ void CORBA_SequenceDef::element_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -6988,7 +6988,7 @@ CORBA::ULong CORBA_ArrayDef::length ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7047,7 +7047,7 @@ void CORBA_ArrayDef::length ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7106,7 +7106,7 @@ CORBA::TypeCode_ptr CORBA_ArrayDef::element_type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7163,7 +7163,7 @@ CORBA_IDLType_ptr CORBA_ArrayDef::element_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7222,7 +7222,7 @@ void CORBA_ArrayDef::element_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7356,7 +7356,7 @@ CORBA::TypeCode_ptr CORBA_ExceptionDef::type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7415,7 +7415,7 @@ CORBA_StructMemberSeq * CORBA_ExceptionDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7474,7 +7474,7 @@ void CORBA_ExceptionDef::members ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7674,7 +7674,7 @@ CORBA::TypeCode_ptr CORBA_AttributeDef::type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7732,7 +7732,7 @@ CORBA_IDLType_ptr CORBA_AttributeDef::type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7791,7 +7791,7 @@ void CORBA_AttributeDef::type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7850,7 +7850,7 @@ CORBA::AttributeMode CORBA_AttributeDef::mode ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -7909,7 +7909,7 @@ void CORBA_AttributeDef::mode ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -8711,7 +8711,7 @@ CORBA::TypeCode_ptr CORBA_OperationDef::result ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -8769,7 +8769,7 @@ CORBA_IDLType_ptr CORBA_OperationDef::result_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -8828,7 +8828,7 @@ void CORBA_OperationDef::result_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -8888,7 +8888,7 @@ CORBA_ParDescriptionSeq * CORBA_OperationDef::params ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -8947,7 +8947,7 @@ void CORBA_OperationDef::params ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -9006,7 +9006,7 @@ CORBA::OperationMode CORBA_OperationDef::mode ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -9065,7 +9065,7 @@ void CORBA_OperationDef::mode ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -9125,7 +9125,7 @@ CORBA_ContextIdSeq * CORBA_OperationDef::contexts ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -9184,7 +9184,7 @@ void CORBA_OperationDef::contexts ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -9244,7 +9244,7 @@ CORBA_ExceptionDefSeq * CORBA_OperationDef::exceptions ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -9303,7 +9303,7 @@ void CORBA_OperationDef::exceptions ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -10158,7 +10158,7 @@ CORBA_InterfaceDefSeq * CORBA_InterfaceDef::base_interfaces ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -10217,7 +10217,7 @@ void CORBA_InterfaceDef::base_interfaces ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -10277,7 +10277,7 @@ CORBA::Boolean CORBA_InterfaceDef::is_a ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -10682,7 +10682,7 @@ CORBA_InterfaceDef::FullInterfaceDescription * CORBA_InterfaceDef::describe_inte _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -10745,7 +10745,7 @@ CORBA_AttributeDef_ptr CORBA_InterfaceDef::create_attribute ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -10821,7 +10821,7 @@ CORBA_OperationDef_ptr CORBA_InterfaceDef::create_operation ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11297,7 +11297,7 @@ CORBA::TypeCode_ptr CORBA_ValueMemberDef::type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11355,7 +11355,7 @@ CORBA_IDLType_ptr CORBA_ValueMemberDef::type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11414,7 +11414,7 @@ void CORBA_ValueMemberDef::type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11473,7 +11473,7 @@ CORBA::Visibility CORBA_ValueMemberDef::access ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11532,7 +11532,7 @@ void CORBA_ValueMemberDef::access ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11666,7 +11666,7 @@ CORBA_InterfaceDef_ptr CORBA_ValueDef::supported_interface ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11725,7 +11725,7 @@ void CORBA_ValueDef::supported_interface ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11785,7 +11785,7 @@ CORBA_InitializerSeq * CORBA_ValueDef::initializers ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11844,7 +11844,7 @@ void CORBA_ValueDef::initializers ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11903,7 +11903,7 @@ CORBA_ValueDef_ptr CORBA_ValueDef::base_value ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -11962,7 +11962,7 @@ void CORBA_ValueDef::base_value ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12022,7 +12022,7 @@ CORBA_ValueDefSeq * CORBA_ValueDef::abstract_base_values ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12081,7 +12081,7 @@ void CORBA_ValueDef::abstract_base_values ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12140,7 +12140,7 @@ CORBA::Boolean CORBA_ValueDef::is_abstract ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12199,7 +12199,7 @@ void CORBA_ValueDef::is_abstract ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12258,7 +12258,7 @@ CORBA::Boolean CORBA_ValueDef::is_custom ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12317,7 +12317,7 @@ void CORBA_ValueDef::is_custom ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12376,7 +12376,7 @@ CORBA::Boolean CORBA_ValueDef::is_truncatable ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12435,7 +12435,7 @@ void CORBA_ValueDef::is_truncatable ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -12495,7 +12495,7 @@ CORBA::Boolean CORBA_ValueDef::is_a ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -13066,7 +13066,7 @@ CORBA_ValueDef::FullValueDescription * CORBA_ValueDef::describe_value ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -13129,7 +13129,7 @@ CORBA_ValueMemberDef_ptr CORBA_ValueDef::create_value_member ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -13202,7 +13202,7 @@ CORBA_AttributeDef_ptr CORBA_ValueDef::create_attribute ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -13278,7 +13278,7 @@ CORBA_OperationDef_ptr CORBA_ValueDef::create_operation ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -13521,7 +13521,7 @@ CORBA_IDLType_ptr CORBA_ValueBoxDef::original_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -13580,7 +13580,7 @@ void CORBA_ValueBoxDef::original_type_def ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); diff --git a/TAO/tao/InterfaceC.h b/TAO/tao/InterfaceC.h index d27576fa570..df603e81089 100644 --- a/TAO/tao/InterfaceC.h +++ b/TAO/tao/InterfaceC.h @@ -2,6 +2,7 @@ //$Id$ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index 0ca74a07cda..2a50a763c95 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -1,5 +1,6 @@ // $Id$ + #include "tao/Invocation.h" #include "tao/Stub.h" #include "tao/Principal.h" @@ -296,7 +297,7 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV) } // Obtain unique request id from the RMS. - this->request_id_ = this->transport_->tms()->request_id (); + this->request_id_ = this->transport_->tms ()->request_id (); countdown.update (); } @@ -530,7 +531,7 @@ TAO_GIOP_Invocation::location_forward (TAO_InputCDR &inp_stream, TAO_GIOP_Twoway_Invocation::~TAO_GIOP_Twoway_Invocation (void) { if (this->transport_ != 0) - this->transport_->idle (); + this->transport_->idle_after_reply (); } void @@ -925,7 +926,7 @@ TAO_GIOP_Oneway_Invocation (TAO_Stub *stub, TAO_GIOP_Oneway_Invocation::~TAO_GIOP_Oneway_Invocation (void) { if (this->transport_ != 0) - this->transport_->idle (); + this->transport_->idle_after_reply (); } void @@ -948,18 +949,20 @@ int TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - if (this->sync_scope_ == TAO::SYNC_WITH_TRANSPORT - || this->sync_scope_ == TAO::SYNC_NONE) + if (this->sync_scope_ == TAO::SYNC_WITH_TRANSPORT || + this->sync_scope_ == TAO::SYNC_NONE || + this->sync_scope_ == TAO::SYNC_EAGER_BUFFERING || + this->sync_scope_ == TAO::SYNC_DELAYED_BUFFERING) { return TAO_GIOP_Invocation::invoke (0, ACE_TRY_ENV); } - // Create this only if a reply is required. TAO_Synch_Reply_Dispatcher rd (this->orb_core_, this->service_info_); + // The rest of this function is very similar to // TWO_GIOP_Twoway_Invocation::invoke_i, because we must // wait for a reply. See comments in that code. @@ -1128,7 +1131,7 @@ TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV) TAO_GIOP_Locate_Request_Invocation::~TAO_GIOP_Locate_Request_Invocation (void) { if (this->transport_ != 0) - this->transport_->idle (); + this->transport_->idle_after_reply (); } // Send request, block until any reply comes back. diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h index 19ab178d042..8d7a1e1c846 100644 --- a/TAO/tao/Invocation.h +++ b/TAO/tao/Invocation.h @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/Leader_Follower.cpp b/TAO/tao/Leader_Follower.cpp index a16dd4b3979..c49a2d2495c 100644 --- a/TAO/tao/Leader_Follower.cpp +++ b/TAO/tao/Leader_Follower.cpp @@ -44,6 +44,52 @@ TAO_Leader_Follower::get_next_follower (void) return cond; } +int +TAO_Leader_Follower::wait_for_client_leader_to_complete (ACE_Time_Value *max_wait_time) +{ + int result = 0; + ACE_Countdown_Time countdown (max_wait_time); + + // Note that we are waiting. + ++this->event_loop_threads_waiting_; + + while (this->client_thread_is_leader_ && + result != -1) + { + if (max_wait_time == 0) + { + if (this->event_loop_threads_condition_.wait () == -1) + { + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("TAO (%P|%t): TAO_Leader_Follower::wait_for_client_leader_to_complete - ") + ASYS_TEXT ("Condition variable wait failed\n"))); + + result = -1; + } + } + else + { + countdown.update (); + ACE_Time_Value tv = ACE_OS::gettimeofday (); + tv += *max_wait_time; + if (this->event_loop_threads_condition_.wait (&tv) == -1) + { + if (errno != ETIME) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("TAO (%P|%t): TAO_Leader_Follower::wait_for_client_leader_to_complete - ") + ASYS_TEXT ("Condition variable wait failed\n"))); + + result = -1; + } + } + } + + // Reset waiting state. + --this->event_loop_threads_waiting_; + + return result; +} + ACE_Reactor * TAO_Leader_Follower::reactor (void) { diff --git a/TAO/tao/Leader_Follower.h b/TAO/tao/Leader_Follower.h index a04949a7788..5f496b7b2bf 100644 --- a/TAO/tao/Leader_Follower.h +++ b/TAO/tao/Leader_Follower.h @@ -33,11 +33,11 @@ public: ~TAO_Leader_Follower (void); // Destructor - void set_server_thread (void); + int set_event_loop_thread (ACE_Time_Value *max_wait_time); // The current thread has become a server thread (i.e. called // ORB::run), update any flags and counters. - void reset_server_thread (void); + void reset_event_loop_thread (void); // The current thread is not a server thread anymore, reset any // flags and counters. @@ -50,19 +50,19 @@ public: void reset_client_thread (void); // A server thread has finished is making a request. - void set_leader_thread (void) ; + void set_client_leader_thread (void) ; // The current thread has become the leader thread in the // client side leader-follower set. - void reset_leader_thread (void) ; + void reset_client_leader_thread (void) ; // The current thread is no longer the leader thread in the client // side leader-follower set. - void set_leader_thread (ACE_thread_t thread_ID); + void set_client_leader_thread (ACE_thread_t thread_ID); // sets the thread ID of the leader thread in the leader-follower // model - int is_leader_thread (void) const; + int is_client_leader_thread (void) const; // checks if we are a leader thread int elect_new_leader (void); @@ -102,6 +102,9 @@ private: TAO_ORB_Core_TSS_Resources *get_tss_resources (void) const; // Shortcut to obtain the TSS resources of the orb core. + int wait_for_client_leader_to_complete (ACE_Time_Value *max_wait_time); + // Wait for the client leader to complete. + private: TAO_ORB_Core *orb_core_; // The orb core @@ -127,6 +130,65 @@ private: ACE_Reactor *reactor_; // The reactor + + int client_thread_is_leader_; + // Is a client thread the current leader? + + int event_loop_threads_waiting_; + // Are server threads waiting for the client leader to complete? + + ACE_SYNCH_CONDITION event_loop_threads_condition_; + // Condition variable for server threads waiting for the client + // leader to complete. +}; + +class TAO_Export TAO_LF_Client_Thread_Helper +{ +public: + TAO_LF_Client_Thread_Helper (TAO_Leader_Follower &leader_follower); + // Constructor + + ~TAO_LF_Client_Thread_Helper (void); + // Destructor + +private: + TAO_Leader_Follower &leader_follower_; + // Reference to leader/followers object. +}; + +class TAO_Export TAO_LF_Client_Leader_Thread_Helper +{ +public: + TAO_LF_Client_Leader_Thread_Helper (TAO_Leader_Follower &leader_follower); + // Constructor + + ~TAO_LF_Client_Leader_Thread_Helper (void); + // Destructor + +private: + TAO_Leader_Follower &leader_follower_; + // Reference to leader/followers object. +}; + +class TAO_Export TAO_LF_Event_Loop_Thread_Helper +{ +public: + TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower); + // Constructor + + ~TAO_LF_Event_Loop_Thread_Helper (void); + // Destructor + + int set_event_loop_thread (ACE_Time_Value *max_wait_time); + // Calls <set_event_loop_thread> on the leader/followers object. + +private: + TAO_Leader_Follower &leader_follower_; + // Reference to leader/followers object. + + int call_reset_; + // Remembers whether we have to call the reset method in the + // destructor. }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Leader_Follower.i b/TAO/tao/Leader_Follower.i index e7e5e91a19e..529ee24e4c0 100644 --- a/TAO/tao/Leader_Follower.i +++ b/TAO/tao/Leader_Follower.i @@ -9,7 +9,10 @@ TAO_Leader_Follower::TAO_Leader_Follower (TAO_ORB_Core* orb_core) reverse_lock_ (lock_), leaders_ (0), clients_ (0), - reactor_ (0) + reactor_ (0), + client_thread_is_leader_ (0), + event_loop_threads_waiting_ (0), + event_loop_threads_condition_ (lock_) { } @@ -19,24 +22,54 @@ TAO_Leader_Follower::get_tss_resources (void) const return this->orb_core_->get_tss_resources (); } -ACE_INLINE void -TAO_Leader_Follower::set_server_thread (void) +ACE_INLINE int +TAO_Leader_Follower::set_event_loop_thread (ACE_Time_Value *max_wait_time) { - // Set the TSS flag to remember that we are a leader thread... TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - tss->is_server_thread_ = 1; - ++this->leaders_; + // Make sure that there is no other client thread run the show. If + // we are the client thread running the show, then it is ok. + if (this->client_thread_is_leader_ && + tss->client_leader_thread_ == 0) + { + int result = + this->wait_for_client_leader_to_complete (max_wait_time); + + if (result != 0) + return result; + } + + // If <event_loop_thread_> == 0 and <client_leader_thread_> == 0, we + // are running the event loop for the first time. Therefore, + // increment the leaders. Otherwise, simply increment + // <event_loop_thread_> since either (a) if <event_loop_thread_> != + // 0 this is a nested call to the event loop, or (b) + // <client_leader_thread_> != 0 this is a call to the event loop + // while we are a client leader. + if (tss->event_loop_thread_ == 0 && + tss->client_leader_thread_ == 0) + ++this->leaders_; + + ++tss->event_loop_thread_; + + return 0; } ACE_INLINE void -TAO_Leader_Follower::reset_server_thread (void) +TAO_Leader_Follower::reset_event_loop_thread (void) { - // Set the TSS flag to remember that we are a leader thread... + // Always decrement <event_loop_thread_>. If <event_loop_thread_> + // reaches 0 and we are not a client leader, we are done with our + // duties of running the event loop. Therefore, decrement the + // leaders. Otherwise, we just got done with a nested call to the + // event loop or a call to the event loop when we were the client + // leader. TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - tss->is_server_thread_ = 0; + --tss->event_loop_thread_; - --this->leaders_; + if (tss->event_loop_thread_ == 0 && + tss->client_leader_thread_ == 0) + --this->leaders_; } ACE_INLINE int @@ -48,15 +81,17 @@ TAO_Leader_Follower::leader_available (void) const ACE_INLINE void TAO_Leader_Follower::set_client_thread (void) { - // Set the TSS flag to remember that we are a leader thread... + // If we were a leader thread or an event loop thread, give up + // leadership. TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - if (tss->is_server_thread_) + if (tss->event_loop_thread_ || + tss->client_leader_thread_) { --this->leaders_; } - if (this->clients_ == 0 - && this->orb_core_->has_shutdown ()) + if (this->clients_ == 0 && + this->orb_core_->has_shutdown ()) { // The ORB has shutdown and we are the first client after // that. This means that the reactor is disabled, we must @@ -69,12 +104,15 @@ TAO_Leader_Follower::set_client_thread (void) ACE_INLINE void TAO_Leader_Follower::reset_client_thread (void) { - // Set the TSS flag to remember that we are a leader thread... + // If we were a leader thread or an event loop thread, take back + // leadership. TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - if (tss->is_server_thread_) + if (tss->event_loop_thread_ || + tss->client_leader_thread_) { ++this->leaders_; } + this->clients_--; if (this->clients_ == 0 && this->orb_core_->has_shutdown ()) { @@ -86,32 +124,28 @@ TAO_Leader_Follower::reset_client_thread (void) } ACE_INLINE void -TAO_Leader_Follower::set_leader_thread (void) +TAO_Leader_Follower::set_client_leader_thread (void) { TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - if (tss->is_leader_thread_ == 0) - { - ++this->leaders_; - } - ++tss->is_leader_thread_; + ++this->leaders_; + this->client_thread_is_leader_ = 1; + ++tss->client_leader_thread_; } ACE_INLINE void -TAO_Leader_Follower::reset_leader_thread (void) +TAO_Leader_Follower::reset_client_leader_thread (void) { TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - --tss->is_leader_thread_; - if (tss->is_leader_thread_ == 0) - { - --this->leaders_; - } + --tss->client_leader_thread_; + --this->leaders_; + this->client_thread_is_leader_ = 0; } ACE_INLINE int -TAO_Leader_Follower::is_leader_thread (void) const +TAO_Leader_Follower::is_client_leader_thread (void) const { TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - return tss->is_leader_thread_ != 0; + return tss->client_leader_thread_ != 0; } ACE_INLINE int @@ -123,11 +157,18 @@ TAO_Leader_Follower::follower_available (void) const ACE_INLINE int TAO_Leader_Follower::elect_new_leader (void) { - if (this->leaders_ == 0 && this->follower_available ()) + if (this->leaders_ == 0) { - ACE_SYNCH_CONDITION* condition_ptr = this->get_next_follower (); - if (condition_ptr == 0 || condition_ptr->signal () == -1) - return -1; + if (this->event_loop_threads_waiting_) + { + return this->event_loop_threads_condition_.broadcast (); + } + else if (this->follower_available ()) + { + ACE_SYNCH_CONDITION* condition_ptr = this->get_next_follower (); + if (condition_ptr == 0 || condition_ptr->signal () == -1) + return -1; + } } return 0; } @@ -161,3 +202,67 @@ TAO_Leader_Follower::has_clients (void) const { return this->clients_; } + +ACE_INLINE +TAO_LF_Client_Thread_Helper::TAO_LF_Client_Thread_Helper (TAO_Leader_Follower &leader_follower) + : leader_follower_ (leader_follower) +{ + this->leader_follower_.set_client_thread (); +} + +ACE_INLINE +TAO_LF_Client_Thread_Helper::~TAO_LF_Client_Thread_Helper (void) +{ + this->leader_follower_.reset_client_thread (); +} + +ACE_INLINE +TAO_LF_Client_Leader_Thread_Helper::TAO_LF_Client_Leader_Thread_Helper (TAO_Leader_Follower &leader_follower) + : leader_follower_ (leader_follower) +{ + this->leader_follower_.set_client_leader_thread (); +} + +ACE_INLINE +TAO_LF_Client_Leader_Thread_Helper::~TAO_LF_Client_Leader_Thread_Helper (void) +{ + this->leader_follower_.reset_client_leader_thread (); +} + +ACE_INLINE int +TAO_LF_Event_Loop_Thread_Helper::set_event_loop_thread (ACE_Time_Value *max_wait_time) +{ + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->leader_follower_.lock (), -1); + + int result = + this->leader_follower_.set_event_loop_thread (max_wait_time); + + // If successful, reset has to be called. + if (result == 0) + this->call_reset_ = 1; + + return result; +} + +ACE_INLINE +TAO_LF_Event_Loop_Thread_Helper::TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower) + : leader_follower_ (leader_follower), + call_reset_ (0) +{ +} + +ACE_INLINE +TAO_LF_Event_Loop_Thread_Helper::~TAO_LF_Event_Loop_Thread_Helper (void) +{ + ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->leader_follower_.lock ()); + + if (this->call_reset_) + this->leader_follower_.reset_event_loop_thread (); + + int result = this->leader_follower_.elect_new_leader (); + + if (result == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("TAO (%P|%t) Failed to wake up ") + ASYS_TEXT ("a follower thread\n"))); +} diff --git a/TAO/tao/Linear_Priority_Mapping.cpp b/TAO/tao/Linear_Priority_Mapping.cpp index e18fa777ccc..27c346394d4 100644 --- a/TAO/tao/Linear_Priority_Mapping.cpp +++ b/TAO/tao/Linear_Priority_Mapping.cpp @@ -2,7 +2,7 @@ #include "tao/orbconf.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/Linear_Priority_Mapping.h" #include "tao/debug.h" @@ -155,4 +155,4 @@ TAO_Linear_Priority_Mapping::to_CORBA (RTCORBA::NativePriority native_priority, #endif /* ACE_WIN32 */ } -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/Linear_Priority_Mapping.h b/TAO/tao/Linear_Priority_Mapping.h index 7984a5ec2d6..242bc6f27ed 100644 --- a/TAO/tao/Linear_Priority_Mapping.h +++ b/TAO/tao/Linear_Priority_Mapping.h @@ -22,7 +22,7 @@ #include "tao/orbconf.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/Priority_Mapping.h" @@ -69,6 +69,6 @@ private: # include "tao/Linear_Priority_Mapping.i" #endif /* __ACE_INLINE__ */ -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ #endif /* TAO_LINEAR_PRIORITY_MAPPING_H */ diff --git a/TAO/tao/MessagingC.cpp b/TAO/tao/MessagingC.cpp index 8abd088c179..735a8ebd26c 100644 --- a/TAO/tao/MessagingC.cpp +++ b/TAO/tao/MessagingC.cpp @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // $Id$ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. @@ -23,6 +24,7 @@ ACE_RCSID(tao, MessagingC, "$Id$") + static const CORBA::Long _oc_Messaging_RebindMode[] = { TAO_ENCAP_BYTE_ORDER, // byte order @@ -77,6 +79,15 @@ TAO_NAMESPACE_TYPE (const CORBA::Short) TAO_NAMESPACE_BEGIN (Messaging) TAO_NAMESPACE_DEFINE (const CORBA::Short, SYNC_WITH_TARGET, 3) TAO_NAMESPACE_END +TAO_NAMESPACE_TYPE (const CORBA::Short) +TAO_NAMESPACE_BEGIN (Messaging) +TAO_NAMESPACE_DEFINE (const CORBA::Short, SYNC_EAGER_BUFFERING, 0) +TAO_NAMESPACE_END +TAO_NAMESPACE_TYPE (const CORBA::Short) +TAO_NAMESPACE_BEGIN (Messaging) +TAO_NAMESPACE_DEFINE (const CORBA::Short, SYNC_DELAYED_BUFFERING, -1) +TAO_NAMESPACE_END + static const CORBA::Long _oc_Messaging_RoutingType[] = { TAO_ENCAP_BYTE_ORDER, // byte order @@ -1671,7 +1682,7 @@ CORBA::Object_ptr Messaging::Poller::operation_target ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1725,7 +1736,7 @@ char * Messaging::Poller::operation_name ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1779,7 +1790,7 @@ Messaging::ReplyHandler_ptr Messaging::Poller::associated_handler ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1833,7 +1844,7 @@ void Messaging::Poller::associated_handler ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1888,7 +1899,7 @@ CORBA::Boolean Messaging::Poller::is_from_poller ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1942,7 +1953,7 @@ CORBA::Object_ptr Messaging::Poller::target ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1996,7 +2007,7 @@ char * Messaging::Poller::op_name ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); diff --git a/TAO/tao/MessagingC.h b/TAO/tao/MessagingC.h index 9f14b0e9f8a..c2101d87a8a 100644 --- a/TAO/tao/MessagingC.h +++ b/TAO/tao/MessagingC.h @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // // $Id$ + // // ================================================================ // @@ -84,6 +85,11 @@ TAO_NAMESPACE Messaging TAO_NAMESPACE_STORAGE_CLASS const CORBA::Short SYNC_WITH_TARGET; + // = TAO specific. + TAO_NAMESPACE_STORAGE_CLASS const CORBA::Short SYNC_EAGER_BUFFERING; + + TAO_NAMESPACE_STORAGE_CLASS const CORBA::Short SYNC_DELAYED_BUFFERING; + typedef CORBA::Short RoutingType; typedef CORBA::Short_out RoutingType_out; TAO_NAMESPACE_STORAGE_CLASS CORBA::TypeCode_ptr _tc_RoutingType; @@ -2110,8 +2116,7 @@ TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, Messaging::PolicyValu #if (TAO_HAS_AMI_CALLBACK == 1) extern TAO_Export Messaging::ReplyHandler_ptr (*_TAO_collocation_Messaging_ReplyHandler_Stub_Factory_function_pointer) ( - CORBA::Object_ptr obj); - + CORBA::Object_ptr obj); // Any operators for interface Messaging::ReplyHandler TAO_Export void operator<<= (CORBA::Any &, Messaging::ReplyHandler_ptr); TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, Messaging::ReplyHandler *&); @@ -2119,14 +2124,12 @@ TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const Messaging::Excepti TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &, Messaging::ExceptionHolder *&); #endif /* TAO_HAS_AMI_CALLBACK == 1 */ - #if (TAO_HAS_AMI_POLLER == 1) // Any operators for interface Messaging::Poller TAO_Export void operator<<= (CORBA::Any &, Messaging::Poller_ptr); TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, Messaging::Poller *&); #endif /* TAO_HAS_AMI_POLLER == 1 */ - #ifndef __ACE_INLINE__ TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const Messaging::PriorityRange &); // diff --git a/TAO/tao/MessagingS.cpp b/TAO/tao/MessagingS.cpp index b177dca761f..505f5d50ef3 100644 --- a/TAO/tao/MessagingS.cpp +++ b/TAO/tao/MessagingS.cpp @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // $Id$ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/MessagingS_T.cpp b/TAO/tao/MessagingS_T.cpp index af9370500a4..71addde084d 100644 --- a/TAO/tao/MessagingS_T.cpp +++ b/TAO/tao/MessagingS_T.cpp @@ -136,7 +136,7 @@ POA_Messaging::QueueOrderPolicy_tie<T>::_default_POA (CORBA::Environment &ACE_TR return this->QueueOrderPolicy::_default_POA (ACE_TRY_ENV); } -#if defined (TAO_HAS_AMI_CALLBACK) +#if (TAO_HAS_AMI_CALLBACK == 1) template <class T> PortableServer::POA_ptr POA_Messaging::ReplyHandler_tie<T>::_default_POA (CORBA::Environment &ACE_TRY_ENV) @@ -147,9 +147,9 @@ POA_Messaging::ReplyHandler_tie<T>::_default_POA (CORBA::Environment &ACE_TRY_EN return this->ReplyHandler::_default_POA (ACE_TRY_ENV); } -#endif /* TAO_HAS_AMI_CALLBACK */ +#endif /* TAO_HAS_AMI_CALLBACK == 1 */ -#if defined (TAO_HAS_AMI_POLLER) +#if (TAO_HAS_AMI_POLLER == 1) template <class T> PortableServer::POA_ptr POA_Messaging::Poller_tie<T>::_default_POA (CORBA::Environment &ACE_TRY_ENV) @@ -159,6 +159,6 @@ POA_Messaging::Poller_tie<T>::_default_POA (CORBA::Environment &ACE_TRY_ENV) return this->Poller::_default_POA (ACE_TRY_ENV); } -#endif /* TAO_HAS_AMI_POLLER */ +#endif /* TAO_HAS_AMI_POLLER == 1 */ #endif /* ifndef */ diff --git a/TAO/tao/MessagingS_T.i b/TAO/tao/MessagingS_T.i index fd4a7cf99c9..00d92c671cb 100644 --- a/TAO/tao/MessagingS_T.i +++ b/TAO/tao/MessagingS_T.i @@ -12,30 +12,30 @@ #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::RebindPolicy_tie<T>::RebindPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RebindPolicy_tie<T>::RebindPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RebindPolicy_tie<T>::RebindPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::RebindPolicy_tie<T>::RebindPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -123,30 +123,30 @@ void POA_Messaging::RebindPolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::SyncScopePolicy_tie<T>::SyncScopePolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::SyncScopePolicy_tie<T>::SyncScopePolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::SyncScopePolicy_tie<T>::SyncScopePolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::SyncScopePolicy_tie<T>::SyncScopePolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -200,6 +200,12 @@ Messaging::SyncScope POA_Messaging::SyncScopePolicy_tie<T>::synchronization ( } template <class T> ACE_INLINE +Messaging::SyncScope POA_Messaging::SyncScopePolicy_tie<T>::synchronization (void) +{ + return this->ptr_->synchronization (); +} + +template <class T> ACE_INLINE CORBA::PolicyType POA_Messaging::SyncScopePolicy_tie<T>::policy_type ( CORBA::Environment &ACE_TRY_ENV ) @@ -234,30 +240,30 @@ void POA_Messaging::SyncScopePolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::RequestPriorityPolicy_tie<T>::RequestPriorityPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RequestPriorityPolicy_tie<T>::RequestPriorityPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RequestPriorityPolicy_tie<T>::RequestPriorityPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::RequestPriorityPolicy_tie<T>::RequestPriorityPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -345,30 +351,30 @@ void POA_Messaging::RequestPriorityPolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::ReplyPriorityPolicy_tie<T>::ReplyPriorityPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyPriorityPolicy_tie<T>::ReplyPriorityPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyPriorityPolicy_tie<T>::ReplyPriorityPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::ReplyPriorityPolicy_tie<T>::ReplyPriorityPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -456,30 +462,30 @@ void POA_Messaging::ReplyPriorityPolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::RequestStartTimePolicy_tie<T>::RequestStartTimePolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RequestStartTimePolicy_tie<T>::RequestStartTimePolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RequestStartTimePolicy_tie<T>::RequestStartTimePolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::RequestStartTimePolicy_tie<T>::RequestStartTimePolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -567,30 +573,30 @@ void POA_Messaging::RequestStartTimePolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::RequestEndTimePolicy_tie<T>::RequestEndTimePolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RequestEndTimePolicy_tie<T>::RequestEndTimePolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RequestEndTimePolicy_tie<T>::RequestEndTimePolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::RequestEndTimePolicy_tie<T>::RequestEndTimePolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -678,30 +684,30 @@ void POA_Messaging::RequestEndTimePolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::ReplyStartTimePolicy_tie<T>::ReplyStartTimePolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyStartTimePolicy_tie<T>::ReplyStartTimePolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyStartTimePolicy_tie<T>::ReplyStartTimePolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::ReplyStartTimePolicy_tie<T>::ReplyStartTimePolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -789,30 +795,30 @@ void POA_Messaging::ReplyStartTimePolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::ReplyEndTimePolicy_tie<T>::ReplyEndTimePolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyEndTimePolicy_tie<T>::ReplyEndTimePolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyEndTimePolicy_tie<T>::ReplyEndTimePolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::ReplyEndTimePolicy_tie<T>::ReplyEndTimePolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -900,30 +906,30 @@ void POA_Messaging::ReplyEndTimePolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::RelativeRequestTimeoutPolicy_tie<T>::RelativeRequestTimeoutPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RelativeRequestTimeoutPolicy_tie<T>::RelativeRequestTimeoutPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RelativeRequestTimeoutPolicy_tie<T>::RelativeRequestTimeoutPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::RelativeRequestTimeoutPolicy_tie<T>::RelativeRequestTimeoutPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -1011,30 +1017,30 @@ void POA_Messaging::RelativeRequestTimeoutPolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::RelativeRoundtripTimeoutPolicy_tie<T>::RelativeRoundtripTimeoutPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RelativeRoundtripTimeoutPolicy_tie<T>::RelativeRoundtripTimeoutPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RelativeRoundtripTimeoutPolicy_tie<T>::RelativeRoundtripTimeoutPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::RelativeRoundtripTimeoutPolicy_tie<T>::RelativeRoundtripTimeoutPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -1122,30 +1128,30 @@ void POA_Messaging::RelativeRoundtripTimeoutPolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::RoutingPolicy_tie<T>::RoutingPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RoutingPolicy_tie<T>::RoutingPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::RoutingPolicy_tie<T>::RoutingPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::RoutingPolicy_tie<T>::RoutingPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -1233,30 +1239,30 @@ void POA_Messaging::RoutingPolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::MaxHopsPolicy_tie<T>::MaxHopsPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::MaxHopsPolicy_tie<T>::MaxHopsPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::MaxHopsPolicy_tie<T>::MaxHopsPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::MaxHopsPolicy_tie<T>::MaxHopsPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -1344,30 +1350,30 @@ void POA_Messaging::MaxHopsPolicy_tie<T>::destroy ( #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::QueueOrderPolicy_tie<T>::QueueOrderPolicy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::QueueOrderPolicy_tie<T>::QueueOrderPolicy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::QueueOrderPolicy_tie<T>::QueueOrderPolicy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::QueueOrderPolicy_tie<T>::QueueOrderPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -1452,34 +1458,34 @@ void POA_Messaging::QueueOrderPolicy_tie<T>::destroy ( #endif /* ACE_HAS_USING_KEYWORD */ -#if defined(TAO_POLLER) +#if (TAO_HAS_AMI_POLLER == 1) #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::ReplyHandler_tie<T>::ReplyHandler_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyHandler_tie<T>::ReplyHandler_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::ReplyHandler_tie<T>::ReplyHandler_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::ReplyHandler_tie<T>::ReplyHandler_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -1527,30 +1533,30 @@ POA_Messaging::ReplyHandler_tie<T>::_is_owner (CORBA::Boolean b) #if defined (ACE_HAS_USING_KEYWORD) template <class T> ACE_INLINE POA_Messaging::Poller_tie<T>::Poller_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_nil ()), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::Poller_tie<T>::Poller_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) + : ptr_ (&t), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (0) {} template <class T> ACE_INLINE POA_Messaging::Poller_tie<T>::Poller_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_nil ()), + rel_ (release) {} template <class T> ACE_INLINE POA_Messaging::Poller_tie<T>::Poller_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) + : ptr_ (tp), + poa_ (PortableServer::POA::_duplicate (poa)), + rel_ (release) {} template <class T> ACE_INLINE @@ -1688,4 +1694,4 @@ CORBA::PollableSet_ptr POA_Messaging::Poller_tie<T>::create_pollable_set ( } #endif /* ACE_HAS_USING_KEYWORD */ -#endif /* TAO_POLLER */ +#endif /* TAO_HAS_AMI_POLLER == 1 */ diff --git a/TAO/tao/Messaging_Policy_i.cpp b/TAO/tao/Messaging_Policy_i.cpp index eb2d9247589..eaef8da234b 100644 --- a/TAO/tao/Messaging_Policy_i.cpp +++ b/TAO/tao/Messaging_Policy_i.cpp @@ -1,5 +1,6 @@ // $Id$ + #include "tao/Messaging_Policy_i.h" #if (TAO_HAS_CORBA_MESSAGING == 1) @@ -13,6 +14,7 @@ ACE_RCSID(TAO, Messaging_Policy_i, "$Id$") + TAO_RelativeRoundtripTimeoutPolicy::TAO_RelativeRoundtripTimeoutPolicy (PortableServer::POA_ptr poa, const TimeBase::TimeT& relative_expiry) : poa_ (PortableServer::POA::_duplicate (poa)), @@ -159,18 +161,6 @@ TAO_Sync_Scope_Policy::TAO_Sync_Scope_Policy (const TAO_Sync_Scope_Policy &rhs) { } -Messaging::SyncScope -TAO_Sync_Scope_Policy::synchronization (CORBA::Environment &) -{ - return this->synchronization_; -} - -Messaging::SyncScope -TAO_Sync_Scope_Policy::synchronization (void) -{ - return this->synchronization_; -} - CORBA::PolicyType TAO_Sync_Scope_Policy::policy_type (CORBA_Environment &) { diff --git a/TAO/tao/Messaging_Policy_i.i b/TAO/tao/Messaging_Policy_i.i index cfa1da318d3..dc9fb6240c0 100644 --- a/TAO/tao/Messaging_Policy_i.i +++ b/TAO/tao/Messaging_Policy_i.i @@ -1 +1,13 @@ // $Id$ + +ACE_INLINE Messaging::SyncScope +TAO_Sync_Scope_Policy::synchronization (CORBA::Environment &) +{ + return this->synchronization_; +} + +ACE_INLINE Messaging::SyncScope +TAO_Sync_Scope_Policy::synchronization (void) +{ + return this->synchronization_; +} diff --git a/TAO/tao/NVList.cpp b/TAO/tao/NVList.cpp index 6f055ab3b6f..8e266bf50b7 100644 --- a/TAO/tao/NVList.cpp +++ b/TAO/tao/NVList.cpp @@ -344,7 +344,7 @@ CORBA_NVList::_tao_encode (TAO_OutputCDR &cdr, arg = "(nil)"; ACE_DEBUG ((LM_DEBUG, - "NVList::_tao_encode - parameter <%s>\n", + ASYS_TEXT ("NVList::_tao_encode - parameter <%s>\n"), arg)); } CORBA::TypeCode_var tc = nv->value ()->type (); @@ -388,7 +388,7 @@ CORBA_NVList::_tao_decode (TAO_InputCDR &incoming, CORBA::Environment &ACE_TRY_ENV) { if (TAO_debug_level > 3) - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) : NVList::_tao_decode\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("TAO (%P|%t) : NVList::_tao_decode\n"))); // Then unmarshal each "in" and "inout" parameter. ACE_Unbounded_Queue_Iterator<CORBA::NamedValue_ptr> i (this->values_); @@ -409,7 +409,7 @@ CORBA_NVList::_tao_decode (TAO_InputCDR &incoming, if (TAO_debug_level > 3) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) : NVList::_tao_decode - %s\n", + ASYS_TEXT ("TAO (%P|%t) : NVList::_tao_decode - %s\n"), nv->name ()?nv->name ():"(no name given)" )); CORBA::Any_ptr any = nv->value (); diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 26d58660a4a..431ecd88664 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1,4 +1,5 @@ // $Id$ + #include "tao/ORB.h" #include "tao/Acceptor_Registry.h" #include "tao/Connector_Registry.h" @@ -66,7 +67,6 @@ using std::set_unexpected; ACE_RCSID(tao, ORB, "$Id$") - static const char ior_prefix [] = "IOR:"; static const char file_prefix[] = "file://"; @@ -219,24 +219,48 @@ CORBA_ORB::destroy (CORBA::Environment &ACE_TRY_ENV) } int -CORBA_ORB::perform_work (const ACE_Time_Value &tv, - CORBA::Environment &ACE_TRY_ENV) +CORBA_ORB::run (CORBA::Environment &ACE_TRY_ENV) +{ + return this->run (0, ACE_TRY_ENV); +} + +int +CORBA_ORB::run (ACE_Time_Value &tv, CORBA::Environment &ACE_TRY_ENV) +{ + return this->run (&tv, ACE_TRY_ENV); +} + +int +CORBA_ORB::run (ACE_Time_Value *tv, + CORBA::Environment &ACE_TRY_ENV) { - // This method should not be called if the ORB has been shutdown. this->check_shutdown (ACE_TRY_ENV); ACE_CHECK_RETURN (-1); - ACE_Reactor *r = this->orb_core_->reactor (); + return this->orb_core ()->run (tv, 0, ACE_TRY_ENV); +} - // Set the owning thread of the Reactor to the one which we're - // currently in. This is necessary b/c it's possible that the - // application is calling us from a thread other than that in which - // the Reactor's CTOR (which sets the owner) was called. - r->owner (ACE_Thread::self ()); +int +CORBA_ORB::perform_work (CORBA::Environment &ACE_TRY_ENV) +{ + return this->perform_work (0, ACE_TRY_ENV); +} + +int +CORBA_ORB::perform_work (ACE_Time_Value &tv, CORBA::Environment &ACE_TRY_ENV) +{ + return this->perform_work (&tv, ACE_TRY_ENV); +} - ACE_Time_Value tmp_tv (tv); +int +CORBA_ORB::perform_work (ACE_Time_Value *tv, + CORBA::Environment &ACE_TRY_ENV) +{ + // This method should not be called if the ORB has been shutdown. + this->check_shutdown (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); - return r->handle_events (tmp_tv); + return this->orb_core ()->run (tv, 1, ACE_TRY_ENV); } CORBA::Boolean @@ -246,11 +270,14 @@ CORBA_ORB::work_pending (CORBA_Environment &ACE_TRY_ENV) this->check_shutdown (ACE_TRY_ENV); ACE_CHECK_RETURN (0); - // For the moment, there's always work to do... + int result = this->orb_core_->reactor ()->work_pending (); + if (result == 0) + return 0; + + if (result == -1) + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + return 1; -#if 0 - return this->orb_core_->reactor ()->work_pending (); -#endif } #if !defined (TAO_HAS_MINIMUM_CORBA) @@ -369,35 +396,6 @@ CORBA_ORB::poll_next_response (CORBA_Environment &ACE_TRY_ENV) #endif /* TAO_HAS_MINIMUM_CORBA */ -int -CORBA_ORB::run (ACE_Time_Value *tv, - int break_on_timeouts, - CORBA::Environment &ACE_TRY_ENV) -{ - this->check_shutdown (ACE_TRY_ENV); - ACE_CHECK_RETURN (-1); - - return this->orb_core ()->run (tv, break_on_timeouts, ACE_TRY_ENV); -} - -int -CORBA_ORB::run (ACE_Time_Value &tv, CORBA::Environment &ACE_TRY_ENV) -{ - return this->run (&tv, 1, ACE_TRY_ENV); -} - -int -CORBA_ORB::run (ACE_Time_Value *tv, CORBA::Environment &ACE_TRY_ENV) -{ - return this->run (tv, 1, ACE_TRY_ENV); -} - -int -CORBA_ORB::run (CORBA::Environment &ACE_TRY_ENV) -{ - return this->run (0, 0, ACE_TRY_ENV); -} - CORBA_Object_ptr CORBA_ORB::resolve_root_poa (CORBA::Environment &ACE_TRY_ENV, const char *adapter_name, diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index dae86fbce06..b95a3ad271a 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -553,6 +553,24 @@ public: // Otherwise, if we've returned since we've been asked to shut down // the value of 1 is returned. + CORBA::Boolean work_pending (CORBA_Environment &ACE_TRY_ENV = + TAO_default_environment ()); + // Returns an indication of whether the ORB needs to perform some + // work. + + int perform_work (CORBA_Environment &ACE_TRY_ENV = + TAO_default_environment ()); + int perform_work (ACE_Time_Value &, + CORBA_Environment &ACE_TRY_ENV = + TAO_default_environment ()); + int perform_work (ACE_Time_Value *, + CORBA_Environment &ACE_TRY_ENV = + TAO_default_environment ()); + // This operation performs an implementation-defined unit of + // work. Note that the default behavior is not to block; this + // behavior can be modified by passing an appropriate + // <ACE_Time_Value>. + void shutdown (CORBA::Boolean wait_for_completion = 0, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); // This operation instructs the ORB to shut down. Shutting down the @@ -569,19 +587,6 @@ public: // return the same pointer if called with the same ORBid, only after // ORB::destroy() is called it may return a new one. - CORBA::Boolean work_pending (CORBA_Environment &ACE_TRY_ENV = - TAO_default_environment ()); - // Returns an indication of whether the ORB needs to perform some - // work. - - int perform_work (const ACE_Time_Value & = ACE_Time_Value::zero, - CORBA_Environment &ACE_TRY_ENV = - TAO_default_environment ()); - // This operation performs an implementation-defined unit of - // work. Note that the default behavior is not to block; this - // behavior can be modified by passing an appropriate - // <ACE_Time_Value>. - CORBA_Object_ptr resolve_initial_references (const char *name, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -733,11 +738,6 @@ protected: CORBA_Object_ptr resolve_ior_manipulation (CORBA::Environment&); // Resolve the IOR Manipulation reference for this ORB. - int run (ACE_Time_Value *tv, - int break_on_timeouts, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); - // Implements the run routine - private: CORBA_Object_ptr resolve_service (MCAST_SERVICEID service_id, diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index eb3824679db..f46b0386eb4 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -1,6 +1,7 @@ // $Id$ + #include "tao/ORB_Core.h" #include "ace/Env_Value_T.h" @@ -108,7 +109,8 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) open_called_ (0), priority_mapping_ (0), #if (TAO_HAS_CORBA_MESSAGING == 1) - none_sync_strategy_ (0), + eager_buffering_sync_strategy_ (0), + delayed_buffering_sync_strategy_ (0), #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ transport_sync_strategy_ (0), svc_config_argc_ (0), @@ -124,8 +126,12 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) #if (TAO_HAS_CORBA_MESSAGING == 1) - ACE_NEW (this->none_sync_strategy_, - TAO_None_Sync_Strategy); + ACE_NEW (this->eager_buffering_sync_strategy_, + TAO_Eager_Buffering_Sync_Strategy); + + + ACE_NEW (this->delayed_buffering_sync_strategy_, + TAO_Delayed_Buffering_Sync_Strategy); ACE_NEW (this->policy_manager_, TAO_Policy_Manager); @@ -152,7 +158,8 @@ TAO_ORB_Core::~TAO_ORB_Core (void) #if (TAO_HAS_CORBA_MESSAGING == 1) - delete this->none_sync_strategy_; + delete this->eager_buffering_sync_strategy_; + delete this->delayed_buffering_sync_strategy_; delete this->policy_manager_; delete this->default_policies_; @@ -833,7 +840,7 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) ("-ORBLogFile"))) { // - // redirect all ACE_DEUBG and ACE_ERROR output to a file + // redirect all ACE_DEBUG and ACE_ERROR output to a file // USAGE: -ORBLogFile <file> // default: if <file> is present = append // if <file> is not present = create @@ -889,6 +896,45 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) arg_shifter.consume_arg (); } + else if ((current_arg = arg_shifter.get_the_parameter + ("-ORBSetUID"))) + { + // Set the effective user ID of the current ORB process. + uid_t orb_uid = + ACE_static_cast (uid_t, ACE_OS::atoi (current_arg)); + + arg_shifter.consume_arg (); + + if (ACE_OS::setuid (orb_uid) != 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("Error setting effective user ") + ASYS_TEXT ("ID for ORB <%s>%p\n"), + this->orbid_, + ASYS_TEXT("")), + -1); + } + } + else if ((current_arg = arg_shifter.get_the_parameter + ("-ORBSetGID"))) + { + // Set the effective group ID of the current ORB process. + + uid_t orb_gid = + ACE_static_cast (gid_t, ACE_OS::atoi (current_arg)); + + arg_shifter.consume_arg (); + + if (ACE_OS::setgid (orb_gid) != 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("Error setting effective group ") + ASYS_TEXT ("ID for ORB <%s>%p\n"), + this->orbid_, + ASYS_TEXT("")), + -1); + } + } //////////////////////////////////////////////////////////////// // catch all the remaining -ORB args // @@ -1597,20 +1643,24 @@ TAO_ORB_Core::leader_follower (void) int TAO_ORB_Core::run (ACE_Time_Value *tv, - int break_on_timeouts, + int perform_work, CORBA::Environment &ACE_TRY_ENV) { if (TAO_debug_level >= 3) ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("TAO (%P|%t) - start of run\n"))); + ASYS_TEXT ("TAO (%P|%t) - start of run/perform_work\n"))); TAO_Leader_Follower &leader_follower = this->leader_follower (); - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, - leader_follower.lock (), -1); + TAO_LF_Event_Loop_Thread_Helper event_loop_thread_helper (leader_follower); - leader_follower.set_server_thread (); - } + int result = event_loop_thread_helper.set_event_loop_thread (tv); + if (result != 0) + { + if (errno == ETIME) + return 0; + else + return result; + } ACE_Reactor *r = this->reactor (); @@ -1630,7 +1680,7 @@ TAO_ORB_Core::run (ACE_Time_Value *tv, if (ret == -1) return -1; - int result = 1; + result = 1; // 1 to detect that nothing went wrong // Loop handling client requests until the ORB is shutdown. @@ -1647,8 +1697,10 @@ TAO_ORB_Core::run (ACE_Time_Value *tv, ASYS_TEXT ("TAO (%P|%t) - blocking on handle events\n"))); switch (r->handle_events (tv)) { - case 0: // Timed out, so we return to caller. - if (break_on_timeouts) + case 0: + // Make sure that a timed out occured. If so, we return to + // caller. + if (tv != 0 && *tv == ACE_Time_Value::zero) result = 0; break; /* NOTREACHED */ @@ -1664,23 +1716,14 @@ TAO_ORB_Core::run (ACE_Time_Value *tv, } if (result == 0 || result == -1) break; - } - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, - leader_follower.lock (), -1); - - leader_follower.reset_server_thread (); - - if (leader_follower.elect_new_leader () == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("TAO (%P|%t) Failed to wake up ") - ASYS_TEXT ("a follower thread\n")), - -1); - } + // In perform_work, we only run the loop once. + if (perform_work) + break; + } if (TAO_debug_level >= 3) - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("TAO (%P|%t) - end of run %d\n"), result)); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("TAO (%P|%t) - end of run/perform_work %d\n"), result)); return result; } @@ -2139,8 +2182,8 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void) input_cdr_dblock_allocator_ (0), input_cdr_buffer_allocator_ (0), connection_cache_ (0), - is_server_thread_ (0), - is_leader_thread_ (0), + event_loop_thread_ (0), + client_leader_thread_ (0), leader_follower_condition_variable_ (0), reactor_registry_ (0), reactor_registry_cookie_ (0) @@ -2266,6 +2309,8 @@ TAO_ORB_Table::unbind (const char *orb_id) Iterator end = this->end (); if (begin != end) this->first_orb_ = (*begin).int_id_; + else + this->first_orb_ = 0; } } return result; diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 0130f38df11..f0a8dcceab9 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -57,7 +57,8 @@ class TAO_Priority_Mapping; #if (TAO_HAS_CORBA_MESSAGING == 1) -class TAO_None_Sync_Strategy; +class TAO_Eager_Buffering_Sync_Strategy; +class TAO_Delayed_Buffering_Sync_Strategy; #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ @@ -100,11 +101,13 @@ public: // cache will be separated from the connectors and it will be a // (potentially) TSS object. - int is_server_thread_; - // Is this thread a server for this ORB? + int event_loop_thread_; + // Counter for how (nested) calls this thread has made to run the + // event loop. - int is_leader_thread_; - // Is this thread a leader for this ORB? + int client_leader_thread_; + // Counter for how many times this thread has become a client + // leader. ACE_SYNCH_CONDITION* leader_follower_condition_variable_; // Condition variable for the leader follower model. @@ -333,8 +336,9 @@ public: TAO_Buffering_Constraint_Policy *default_buffering_constraint (void) const; - TAO_None_Sync_Strategy &none_sync_strategy (void); - // This strategy will buffer messages. + // = This strategy will buffer messages. + TAO_Eager_Buffering_Sync_Strategy &eager_buffering_sync_strategy (void); + TAO_Delayed_Buffering_Sync_Strategy &delayed_buffering_sync_strategy (void); TAO_RelativeRoundtripTimeoutPolicy *stubless_relative_roundtrip_timeout (void); // Access to the RoundtripTimeoutPolicy policy set on the thread or @@ -368,7 +372,7 @@ public: // Get access to the leader_follower class. int run (ACE_Time_Value *tv, - int break_on_timeouts, + int perform_work, CORBA::Environment &ACE_TRY_ENV); // Run the event loop @@ -593,7 +597,10 @@ protected: #if (TAO_HAS_CORBA_MESSAGING == 1) - TAO_None_Sync_Strategy *none_sync_strategy_; + TAO_Eager_Buffering_Sync_Strategy *eager_buffering_sync_strategy_; + // This strategy will buffer messages. + + TAO_Delayed_Buffering_Sync_Strategy *delayed_buffering_sync_strategy_; // This strategy will buffer messages. #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index 143aec01210..06bc2a075b3 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -1,7 +1,6 @@ // -*- C++ -*- // $Id$ - #include "ace/Dynamic_Service.h" ACE_INLINE ACE_Thread_Manager * @@ -205,10 +204,16 @@ TAO_ORB_Core::implrepo_service (const CORBA::Object_ptr ir) #if (TAO_HAS_CORBA_MESSAGING == 1) -ACE_INLINE TAO_None_Sync_Strategy & -TAO_ORB_Core::none_sync_strategy (void) +ACE_INLINE TAO_Eager_Buffering_Sync_Strategy & +TAO_ORB_Core::eager_buffering_sync_strategy (void) +{ + return *this->eager_buffering_sync_strategy_; +} + +ACE_INLINE TAO_Delayed_Buffering_Sync_Strategy & +TAO_ORB_Core::delayed_buffering_sync_strategy (void) { - return *this->none_sync_strategy_; + return *this->delayed_buffering_sync_strategy_; } #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index 9552b80b40d..b5c6db36528 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -30,7 +30,6 @@ ACE_RCSID(tao, Object, "$Id$") - CORBA_Object::~CORBA_Object (void) { if (this->protocol_proxy_) @@ -124,7 +123,7 @@ CORBA_Object::_is_a (const CORBA::Char *type_id, _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -275,55 +274,65 @@ CORBA_Object::_non_existent (CORBA::Environment &ACE_TRY_ENV) } CORBA::Boolean _tao_retval = 0; + // Must catch exceptions, if the server raises a + // CORBA::OBJECT_NOT_EXIST then we must return 1, instead of + // propagating the exception. + ACE_TRY + { + TAO_Stub *istub = this->_stubobj (); + if (istub == 0) + ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval); - TAO_Stub *istub = this->_stubobj (); - if (istub == 0) - ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval); - - - TAO_GIOP_Twoway_Invocation _tao_call ( - istub, - "_non_existent", - istub->orb_core () - ); - - - // ACE_TRY_ENV.clear (); - for (;;) - { - _tao_call.start (ACE_TRY_ENV); - ACE_CHECK_RETURN (_tao_retval); - - CORBA::Short flag = TAO::SYNC_WITH_TARGET; - _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), - ACE_TRY_ENV); - ACE_CHECK_RETURN (_tao_retval); + TAO_GIOP_Twoway_Invocation _tao_call ( + istub, + "_non_existent", + istub->orb_core () + ); - int _invoke_status = - _tao_call.invoke (0, 0, ACE_TRY_ENV); - ACE_CHECK_RETURN (_tao_retval); - if (_invoke_status == TAO_INVOKE_RESTART) - continue; - // if (_invoke_status == TAO_INVOKE_EXCEPTION) - // cannot happen - if (_invoke_status != TAO_INVOKE_OK) + // ACE_TRY_ENV.clear (); + for (;;) + { + _tao_call.start (ACE_TRY_ENV); + ACE_TRY_CHECK; + + CORBA::Short flag = 131; + + _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), + ACE_TRY_ENV); + ACE_TRY_CHECK; + + int _invoke_status = + _tao_call.invoke (0, 0, ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (_invoke_status == TAO_INVOKE_RESTART) + continue; + ACE_ASSERT (_invoke_status != TAO_INVOKE_EXCEPTION); + if (_invoke_status != TAO_INVOKE_OK) + { + ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_YES), + _tao_retval); + } + break; + } + TAO_InputCDR &_tao_in = _tao_call.inp_stream (); + if (!( + (_tao_in >> CORBA::Any::to_boolean (_tao_retval)) + )) + ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval); + } + ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex) { - ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, - CORBA::COMPLETED_YES), - _tao_retval); - + _tao_retval = 1; } - break; - - } - - TAO_InputCDR &_tao_in = _tao_call.inp_stream (); - if (!( - (_tao_in >> CORBA::Any::to_boolean (_tao_retval)) - )) - ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval); + ACE_CATCHANY + { + ACE_RETHROW; + } + ACE_ENDTRY; return _tao_retval; } @@ -430,7 +439,7 @@ CORBA_Object::_get_interface (CORBA::Environment &ACE_TRY_ENV) _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h index 6569fead04c..960acee3639 100644 --- a/TAO/tao/Object.h +++ b/TAO/tao/Object.h @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/Object_Adapter.cpp b/TAO/tao/Object_Adapter.cpp index 41b8252be0b..7d0421cffa6 100644 --- a/TAO/tao/Object_Adapter.cpp +++ b/TAO/tao/Object_Adapter.cpp @@ -11,7 +11,7 @@ # include "tao/Object_Adapter.i" #endif /* __ACE_INLINE__ */ -ACE_RCSID(tao, POA, "$Id$") +ACE_RCSID(tao, Object_Adapter, "$Id$") // Timeprobes class #include "tao/Timeprobe.h" @@ -71,6 +71,7 @@ TAO_Object_Adapter::set_transient_poa_name_size (const TAO_Server_Strategy_Facto { switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_) { +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) case TAO_LINEAR: TAO_Object_Adapter::transient_poa_name_size_ = sizeof (CORBA::ULong); @@ -79,6 +80,7 @@ TAO_Object_Adapter::set_transient_poa_name_size (const TAO_Server_Strategy_Facto TAO_Object_Adapter::transient_poa_name_size_ = sizeof (CORBA::ULong); break; +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_ACTIVE_DEMUX: default: TAO_Object_Adapter::transient_poa_name_size_ = @@ -122,9 +124,18 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ switch (creation_parameters.poa_lookup_strategy_for_persistent_id_policy_) { case TAO_LINEAR: +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) ACE_NEW (ppnm, persistent_poa_name_linear_map (creation_parameters.poa_map_size_)); + break; +#else + ACE_ERROR ((LM_ERROR, + "linear option for -ORBPersistentidPolicyDemuxStrategy " + "not supported with minimum POA maps. " + "Ingoring option to use default... \n")); + /* FALL THROUGH */ +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_DYNAMIC_HASH: default: ACE_NEW (ppnm, @@ -137,6 +148,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ transient_poa_map *tpm = 0; switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_) { +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) case TAO_LINEAR: ACE_NEW (tpm, transient_poa_linear_map (creation_parameters.poa_map_size_)); @@ -145,6 +157,15 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ ACE_NEW (tpm, transient_poa_hash_map (creation_parameters.poa_map_size_)); break; +#else + case TAO_LINEAR: + case TAO_DYNAMIC_HASH: + ACE_ERROR ((LM_ERROR, + "linear and dynamic options for -ORBTransientidPolicyDemuxStrategy " + "are not supported with minimum POA maps. " + "Ingoring option to use default... \n")); + /* FALL THROUGH */ +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_ACTIVE_DEMUX: default: ACE_NEW (tpm, @@ -310,7 +331,7 @@ TAO_Object_Adapter::activate_poa (const poa_name &folded_name, { int result = -1; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // A recursive thread lock without using a recursive thread lock. // Non_Servant_Upcall has a magic constructor and destructor. We @@ -353,7 +374,7 @@ TAO_Object_Adapter::activate_poa (const poa_name &folded_name, ACE_UNUSED_ARG (folded_name); ACE_UNUSED_ARG (poa); ACE_UNUSED_ARG (ACE_TRY_ENV); -#endif /* !TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ return result; } @@ -727,10 +748,10 @@ TAO_Object_Adapter::Servant_Upcall::Servant_Upcall (TAO_Object_Adapter &object_a state_ (INITIAL_STAGE), id_ (), current_context_ (), -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) cookie_ (0), operation_ (0), -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ active_object_map_entry_ (0), using_servant_locator_ (0) { @@ -885,7 +906,7 @@ TAO_Object_Adapter::Servant_Upcall::wait_for_non_servant_upcalls_to_complete (CO void TAO_Object_Adapter::Servant_Upcall::servant_locator_cleanup (void) { -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) if (this->using_servant_locator_) { @@ -919,13 +940,13 @@ TAO_Object_Adapter::Servant_Upcall::servant_locator_cleanup (void) ACE_ENDTRY; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ } void TAO_Object_Adapter::Servant_Upcall::single_threaded_poa_setup (CORBA::Environment &ACE_TRY_ENV) { -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // Lock servant (if necessary). // @@ -945,17 +966,17 @@ TAO_Object_Adapter::Servant_Upcall::single_threaded_poa_setup (CORBA::Environmen } #else ACE_UNUSED_ARG (ACE_TRY_ENV); -#endif /* !TAO_HAS_MINIMUM_CORBA */ +#endif /* !TAO_HAS_MINIMUM_POA == 0 */ } void TAO_Object_Adapter::Servant_Upcall::single_threaded_poa_cleanup (void) { // Since the servant lock was acquired, we must release it. -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) if (this->poa_->policies ().thread () == PortableServer::SINGLE_THREAD_MODEL) this->servant_->_single_threaded_poa_lock ().release (); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ } void @@ -1173,7 +1194,9 @@ template class ACE_Map_Reverse_Iterator<ACE_Active_Map_Manager_Key, expanded_val template class ACE_Map_Entry<ACE_Active_Map_Manager_Key, expanded_value>; // Hash Map Manager related. +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) template class ACE_Hash_Map_Manager_Ex_Adapter<key, value, hash_key, compare_keys, TAO_Incremental_Key_Generator>; +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ template class ACE_Hash_Map_Manager_Ex_Adapter<key, value, hash_key, compare_keys, noop_key_generator>; template class ACE_Hash_Map_Manager_Ex_Iterator_Adapter<tao_value_type, key, value, hash_key, compare_keys>; template class ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<tao_value_type, key, value, hash_key, compare_keys>; @@ -1186,6 +1209,7 @@ template class ACE_Hash_Map_Entry<key, value>; // Already in Active_Object_Map.cpp // template class ACE_Equal_To<key>; +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) // Map Manager related. template class ACE_Map_Manager_Iterator_Adapter<tao_value_type, key, value>; template class ACE_Map_Manager_Reverse_Iterator_Adapter<tao_value_type, key, value>; @@ -1196,6 +1220,7 @@ template class ACE_Map_Iterator_Base<key, value, ACE_Null_Mutex>; template class ACE_Map_Iterator<key, value, ACE_Null_Mutex>; template class ACE_Map_Reverse_Iterator<key, value, ACE_Null_Mutex>; template class ACE_Map_Entry<key, value>; +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ template class ACE_Unbounded_Set<TAO_POA_Manager *>; template class ACE_Node<TAO_POA_Manager *>; @@ -1251,7 +1276,9 @@ typedef ACE_Noop_Key_Generator<key> noop_key_generator; #pragma instantiate ACE_Map_Entry<ACE_Active_Map_Manager_Key, expanded_value> // Hash Map Manager related. +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) #pragma instantiate ACE_Hash_Map_Manager_Ex_Adapter<key, value, hash_key, compare_keys, TAO_Incremental_Key_Generator> +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ #pragma instantiate ACE_Hash_Map_Manager_Ex_Adapter<key, value, hash_key, compare_keys, noop_key_generator> #pragma instantiate ACE_Hash_Map_Manager_Ex_Iterator_Adapter<tao_value_type, key, value, hash_key, compare_keys> #pragma instantiate ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<tao_value_type, key, value, hash_key, compare_keys> @@ -1264,6 +1291,7 @@ typedef ACE_Noop_Key_Generator<key> noop_key_generator; // Already in Active_Object_Map.cpp // #pragma instantiate ACE_Equal_To<key> +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) // Map Manager related. #pragma instantiate ACE_Map_Manager_Iterator_Adapter<tao_value_type, key, value> #pragma instantiate ACE_Map_Manager_Reverse_Iterator_Adapter<tao_value_type, key, value> @@ -1274,6 +1302,7 @@ typedef ACE_Noop_Key_Generator<key> noop_key_generator; #pragma instantiate ACE_Map_Iterator<key, value, ACE_Null_Mutex> #pragma instantiate ACE_Map_Reverse_Iterator<key, value, ACE_Null_Mutex> #pragma instantiate ACE_Map_Entry<key, value> +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ #pragma instantiate ACE_Unbounded_Set<TAO_POA_Manager *> #pragma instantiate ACE_Node<TAO_POA_Manager *> diff --git a/TAO/tao/Object_Adapter.h b/TAO/tao/Object_Adapter.h index 94b4e9fa7a1..145f2e7a45b 100644 --- a/TAO/tao/Object_Adapter.h +++ b/TAO/tao/Object_Adapter.h @@ -391,6 +391,7 @@ protected: TAO_POA *> transient_poa_map; // Base class of the id map. +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) typedef ACE_Hash_Map_Manager_Ex_Adapter< poa_name, TAO_POA *, @@ -398,12 +399,15 @@ protected: ACE_Equal_To<poa_name>, TAO_Incremental_Key_Generator> transient_poa_hash_map; // Id hash map. +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) typedef ACE_Map_Manager_Adapter< poa_name, TAO_POA *, TAO_Incremental_Key_Generator> transient_poa_linear_map; // Id linear map. +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ typedef ACE_Active_Map_Manager_Adapter< poa_name, @@ -424,11 +428,13 @@ protected: ACE_Noop_Key_Generator<poa_name> > persistent_poa_name_hash_map; // Id hash map. +#if (TAO_HAS_MINIMUM_POA_MAPS == 0) typedef ACE_Map_Manager_Adapter< poa_name, TAO_POA *, ACE_Noop_Key_Generator<poa_name> > persistent_poa_name_linear_map; // Id linear map. +#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ public: @@ -570,7 +576,7 @@ public: PortableServer::Servant servant (void) const; // Servant accessor. -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ServantLocator::Cookie locator_cookie (void) const; // Get the Servant Locator's cookie @@ -584,7 +590,7 @@ public: void operation (const char *); // Set the operation name. -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ void active_object_map_entry (TAO_Active_Object_Map::Map_Entry *entry); // Set the <active_object_map_entry>. @@ -625,7 +631,7 @@ public: TAO_POA_Current_Impl current_context_; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ServantLocator::Cookie cookie_; // Servant Locator's cookie @@ -633,7 +639,7 @@ public: const char *operation_; // Operation name for this current. -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ TAO_Active_Object_Map::Map_Entry *active_object_map_entry_; // Pointer to the entry in the TAO_Active_Object_Map corresponding diff --git a/TAO/tao/Object_Adapter.i b/TAO/tao/Object_Adapter.i index ac888704fdb..1fdd4613a0d 100644 --- a/TAO/tao/Object_Adapter.i +++ b/TAO/tao/Object_Adapter.i @@ -166,7 +166,7 @@ TAO_Object_Adapter::Servant_Upcall::id (void) const return this->id_; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE PortableServer::ServantLocator::Cookie TAO_Object_Adapter::Servant_Upcall::locator_cookie (void) const @@ -192,7 +192,7 @@ TAO_Object_Adapter::Servant_Upcall::operation (const char *name) this->operation_ = name; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE void TAO_Object_Adapter::Servant_Upcall::active_object_map_entry (TAO_Active_Object_Map::Map_Entry *entry) diff --git a/TAO/tao/Operation_Table.cpp b/TAO/tao/Operation_Table.cpp index fdd2a299c57..d5992812b44 100644 --- a/TAO/tao/Operation_Table.cpp +++ b/TAO/tao/Operation_Table.cpp @@ -70,8 +70,8 @@ TAO_Dynamic_Hash_OpTable::TAO_Dynamic_Hash_OpTable (const TAO_operation_db_entry // @@ (ASG): what happens if bind fails ??? if (this->bind (db[i].opname_, db[i].skel_ptr_) == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "bind failed")); + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("bind failed"))); } TAO_Dynamic_Hash_OpTable::~TAO_Dynamic_Hash_OpTable (void) @@ -143,7 +143,7 @@ TAO_Linear_Search_OpTable::find (const char *opname, const TAO_operation_db_entry *entry = lookup (opname); if (entry == 0) ACE_ERROR_RETURN ((LM_ERROR, - "TAO_Linear_Search_Table:find failed\n"), + ASYS_TEXT ("TAO_Linear_Search_Table:find failed\n")), -1); // Valid entry. Figure out the skel_ptr. @@ -247,7 +247,7 @@ TAO_Perfect_Hash_OpTable::find (const char *opname, length); if (entry == 0) ACE_ERROR_RETURN ((LM_ERROR, - "TAO_Perfect_Hash_Table:find failed\n"), + ASYS_TEXT ("TAO_Perfect_Hash_Table:find failed\n")), -1); // Valid entry. Figure out the skel_ptr. @@ -290,7 +290,7 @@ TAO_Binary_Search_OpTable::find (const char *opname, if (entry == 0) ACE_ERROR_RETURN ((LM_ERROR, - "TAO_Binary_Search_Table:find failed\n"), + ASYS_TEXT ("TAO_Binary_Search_Table:find failed\n")), -1); // Valid entry. Figure out the skel_ptr. skelfunc = entry->skel_ptr_; diff --git a/TAO/tao/POA.cpp b/TAO/tao/POA.cpp index b400476a835..ebe4fc27136 100644 --- a/TAO/tao/POA.cpp +++ b/TAO/tao/POA.cpp @@ -11,6 +11,65 @@ #include "tao/Exception.h" #include "tao/debug.h" +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) +# include "tao/ImplRepoC.h" +# include "tao/ImplRepoS.h" +# include "tao/Acceptor_Registry.h" +#endif /* TAO_HAS_MINIMUM_CORBA */ + + +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) + +// This is to remove "inherits via dominance" warnings from MSVC. +// MSVC is being a little too paranoid. +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +class ServerObject_i +: public POA_ImplementationRepository::ServerObject, + public PortableServer::RefCountServantBase +{ + // = TITLE + // IMR Server Object Implementation + // + // = DESCRIPTION + // Implementation Repository uses this to communicate with the IMR + // registered server. +public: + ServerObject_i (CORBA::ORB_ptr orb) + : orb_ (orb) {} + + virtual void ping (CORBA::Environment &) + ACE_THROW_SPEC (()) + { + } + + virtual void shutdown (CORBA::Environment &) + ACE_THROW_SPEC (()) + { + this->orb_->shutdown (); + } +private: + CORBA::ORB_ptr orb_; +}; + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* TAO_HAS_MINIMUM_CORBA */ + + // Forwarding Servant class #include "tao/Forwarding_Servant.h" @@ -22,7 +81,7 @@ ACE_RCSID(tao, POA, "$Id$") #if !defined (TAO_NO_IOR_TABLE) // This is the TAO_Object_key-prefix that is appended to all TAO Object keys. -// Its an array of octets representing ^t^a^o/0 in octal. +// It's an array of octets representing ^t^a^o/0 in octal. CORBA::Octet TAO_POA::objectkey_prefix [TAO_POA::TAO_OBJECTKEY_PREFIX_SIZE] = { 024, // octal for ^t @@ -46,13 +105,23 @@ TAO_POA::TAO_POA (const TAO_POA::String &name, parent_ (parent), active_object_map_ (0), -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) adapter_activator_ (), servant_activator_ (), servant_locator_ (), default_servant_ (), +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) + + server_object_ (0), + use_imr_ (1), + #endif /* TAO_HAS_MINIMUM_CORBA */ children_ (), @@ -114,6 +183,21 @@ TAO_POA::TAO_POA (const TAO_POA::String &name, // Finally everything is fine. Make sure to take ownership away // from the auto pointer. this->active_object_map_ = new_active_object_map.release (); + +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) + if (this->policies_.lifespan () == PortableServer::PERSISTENT) + { + int temp = this->use_imr_; + this->use_imr_ = 0; + this->imr_notify_startup (ACE_TRY_ENV); + ACE_CHECK; + this->use_imr_ = temp; + } + +#endif /* TAO_HAS_MINIMUM_CORBA */ } TAO_POA::~TAO_POA (void) @@ -322,7 +406,7 @@ TAO_POA::find_POA_i (const ACE_CString &child_name, int result = this->children_.find (child_name, child); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) if (result != 0) { @@ -365,7 +449,7 @@ TAO_POA::find_POA_i (const ACE_CString &child_name, } #else ACE_UNUSED_ARG (activate_it); -#endif /* !TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ if (result == 0) { @@ -419,6 +503,30 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, ACE_CHECK; } + +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) + if (this->policies_.lifespan () == PortableServer::PERSISTENT) + { + this->imr_notify_shutdown (); + // Delete the servant, if there is one. + + if (this->server_object_) + { + PortableServer::ObjectId_var id = + this->servant_to_id_i (this->server_object_, ACE_TRY_ENV); + ACE_CHECK; + + this->deactivate_object_i (id.in (), ACE_TRY_ENV); + ACE_CHECK; + + this->server_object_->_remove_ref (); + } + } +#endif /* TAO_HAS_MINIMUM_CORBA */ + // When a POA is destroyed, any requests that have started execution // continue to completion. Any requests that have not started // execution are processed as if they were newly arrived, that is, @@ -468,7 +576,7 @@ TAO_POA::delete_child (const TAO_POA::String &child) return result; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ServantManager_ptr TAO_POA::get_servant_manager_i (CORBA::Environment &ACE_TRY_ENV) @@ -595,7 +703,7 @@ TAO_POA::set_servant_i (PortableServer::Servant servant, } } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ int TAO_POA::is_servant_in_map (PortableServer::Servant servant) @@ -617,7 +725,7 @@ TAO_POA::is_servant_in_map (PortableServer::Servant servant) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "(%t) TAO_POA::is_servant_in_map: waiting for servant to deactivate\n")); + ASYS_TEXT ("(%t) TAO_POA::is_servant_in_map: waiting for servant to deactivate\n"))); ++this->waiting_servant_deactivation_; @@ -654,7 +762,7 @@ TAO_POA::is_user_id_in_map (const PortableServer::ObjectId &id) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "(%t) TAO_POA::is_user_id_in_map: waiting for servant to deactivate\n")); + ASYS_TEXT ("(%t) TAO_POA::is_user_id_in_map: waiting for servant to deactivate\n"))); ++this->waiting_servant_deactivation_; @@ -979,7 +1087,7 @@ TAO_POA::cleanup_servant (TAO_Active_Object_Map::Map_Entry *active_object_map_en // this->teardown_servant_lock (active_object_map_entry->servant_); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) if (this->etherealize_objects_ && this->policies ().request_processing () == PortableServer::USE_SERVANT_MANAGER && @@ -1018,7 +1126,7 @@ TAO_POA::cleanup_servant (TAO_Active_Object_Map::Map_Entry *active_object_map_en } else -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ { active_object_map_entry->servant_->_remove_ref (ACE_TRY_ENV); @@ -1148,11 +1256,11 @@ TAO_POA::create_reference_i (const char *intf, TAO_ObjectKey_var key = this->create_object_key (system_id.in ()); // Ask the ORB to create you a reference - return this->orb_core_.orb ()->key_to_object (key.in (), - intf, - 0, - 1, - ACE_TRY_ENV); + return this->key_to_object (key.in (), + intf, + 0, + 1, + ACE_TRY_ENV); } CORBA::Object_ptr @@ -1215,11 +1323,11 @@ TAO_POA::create_reference_with_id_i (const PortableServer::ObjectId &user_id, TAO_ObjectKey_var key = this->create_object_key (system_id.in ()); // Ask the ORB to create you a reference - return this->orb_core_.orb ()->key_to_object (key.in (), - intf, - servant, - 1, - ACE_TRY_ENV); + return this->key_to_object (key.in (), + intf, + servant, + 1, + ACE_TRY_ENV); } PortableServer::ObjectId * @@ -1376,11 +1484,11 @@ TAO_POA::servant_to_reference (PortableServer::Servant servant, TAO_ObjectKey_var key = this->create_object_key (id.in ()); // Ask the ORB to create you a reference - return this->orb_core_.orb ()->key_to_object (key.in (), - servant->_interface_repository_id (), - servant, - 1, - ACE_TRY_ENV); + return this->key_to_object (key.in (), + servant->_interface_repository_id (), + servant, + 1, + ACE_TRY_ENV); } PortableServer::Servant @@ -1479,7 +1587,7 @@ TAO_POA::reference_to_servant (CORBA::Object_ptr reference, } } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // Otherwise, if the POA has the USE_DEFAULT_SERVANT policy and a // default servant has been registered with the POA, this operation @@ -1513,7 +1621,7 @@ TAO_POA::reference_to_servant (CORBA::Object_ptr reference, } } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // Not reached return 0; @@ -1653,11 +1761,11 @@ TAO_POA::id_to_reference_i (const PortableServer::ObjectId &id, TAO_ObjectKey_var key = this->create_object_key (system_id.in ()); // Ask the ORB to create you a reference - return this->orb_core_.orb ()->key_to_object (key.in (), - servant->_interface_repository_id (), - servant, - 1, - ACE_TRY_ENV); + return this->key_to_object (key.in (), + servant->_interface_repository_id (), + servant, + 1, + ACE_TRY_ENV); } else // If the Object Id value is not active in the POA, an @@ -1668,6 +1776,9 @@ TAO_POA::id_to_reference_i (const PortableServer::ObjectId &id, } } +// +// Forwarding related. +// #if !defined (TAO_HAS_MINIMUM_CORBA) void @@ -1747,7 +1858,7 @@ TAO_POA::locate_servant_i (const PortableServer::ObjectId &system_id, return TAO_SERVANT_NOT_FOUND; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // If the POA has the USE_DEFAULT_SERVANT policy, a default servant // has been associated with the POA, return TAO_DEFAULT_SERVANT. If @@ -1784,7 +1895,7 @@ TAO_POA::locate_servant_i (const PortableServer::ObjectId &system_id, } } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // Failure return TAO_SERVANT_NOT_FOUND; @@ -1855,7 +1966,7 @@ TAO_POA::locate_servant_i (const char *operation, 0); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // If the POA has the USE_DEFAULT_SERVANT policy, a default servant // has been associated with the POA so the POA will invoke the @@ -2043,7 +2154,7 @@ TAO_POA::locate_servant_i (const char *operation, } #else ACE_UNUSED_ARG (operation); -#endif /* !TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // Failure ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), @@ -2566,7 +2677,7 @@ TAO_POA::decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> &seq, seq.length (i); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ThreadPolicy_ptr TAO_POA::create_thread_policy (PortableServer::ThreadPolicyValue value, @@ -2582,23 +2693,20 @@ TAO_POA::create_thread_policy (PortableServer::ThreadPolicyValue value, CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (PortableServer::ThreadPolicy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Thread_Policy> new_thread_policy (thread_policy); - - PortableServer::ThreadPolicy_var result = new_thread_policy->_this (ACE_TRY_ENV); - ACE_CHECK_RETURN (PortableServer::ThreadPolicy::_nil ()); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var thread_policy_var (thread_policy); - // Give ownership of this servant to the POA. - new_thread_policy->_remove_ref (ACE_TRY_ENV); + PortableServer::ThreadPolicy_var result = thread_policy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (PortableServer::ThreadPolicy::_nil ()); - // Make sure that the auto_ptr does not delete the implementation - // object. - new_thread_policy.release (); return result._retn (); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::LifespanPolicy_ptr TAO_POA::create_lifespan_policy (PortableServer::LifespanPolicyValue value, @@ -2614,19 +2722,16 @@ TAO_POA::create_lifespan_policy (PortableServer::LifespanPolicyValue value, CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (PortableServer::LifespanPolicy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Lifespan_Policy> new_lifespan_policy (lifespan_policy); - - PortableServer::LifespanPolicy_var result = new_lifespan_policy->_this (ACE_TRY_ENV); - ACE_CHECK_RETURN (PortableServer::LifespanPolicy::_nil ()); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var lifespan_policy_var (lifespan_policy); - // Give ownership of this servant to the POA. - new_lifespan_policy->_remove_ref (ACE_TRY_ENV); + PortableServer::LifespanPolicy_var result = lifespan_policy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (PortableServer::LifespanPolicy::_nil ()); - // Make sure that the auto_ptr does not delete the implementation - // object. - new_lifespan_policy.release (); return result._retn (); } @@ -2644,19 +2749,16 @@ TAO_POA::create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue va CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (PortableServer::IdUniquenessPolicy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Id_Uniqueness_Policy> new_id_uniqueness_policy (id_uniqueness_policy); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var id_uniqueness_policy_var (id_uniqueness_policy); - PortableServer::IdUniquenessPolicy_var result = new_id_uniqueness_policy->_this (ACE_TRY_ENV); + PortableServer::IdUniquenessPolicy_var result = id_uniqueness_policy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (PortableServer::IdUniquenessPolicy::_nil ()); - // Give ownership of this servant to the POA. - new_id_uniqueness_policy->_remove_ref (ACE_TRY_ENV); - ACE_CHECK_RETURN (PortableServer::IdUniquenessPolicy::_nil ()); - - // Make sure that the auto_ptr does not delete the implementation - // object. - new_id_uniqueness_policy.release (); return result._retn (); } @@ -2674,23 +2776,20 @@ TAO_POA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue va CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (PortableServer::IdAssignmentPolicy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Id_Assignment_Policy> new_id_assignment_policy (id_assignment_policy); - - PortableServer::IdAssignmentPolicy_var result = new_id_assignment_policy->_this (ACE_TRY_ENV); - ACE_CHECK_RETURN (PortableServer::IdAssignmentPolicy::_nil ()); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var id_assignment_policy_var (id_assignment_policy); - // Give ownership of this servant to the POA. - new_id_assignment_policy->_remove_ref (ACE_TRY_ENV); + PortableServer::IdAssignmentPolicy_var result = id_assignment_policy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (PortableServer::IdAssignmentPolicy::_nil ()); - // Make sure that the auto_ptr does not delete the implementation - // object. - new_id_assignment_policy.release (); return result._retn (); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ImplicitActivationPolicy_ptr TAO_POA::create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, @@ -2706,19 +2805,16 @@ TAO_POA::create_implicit_activation_policy (PortableServer::ImplicitActivationPo CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (PortableServer::ImplicitActivationPolicy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Implicit_Activation_Policy> new_implicit_activation_policy (implicit_activation_policy); - - PortableServer::ImplicitActivationPolicy_var result = new_implicit_activation_policy->_this (ACE_TRY_ENV); - ACE_CHECK_RETURN (PortableServer::ImplicitActivationPolicy::_nil ()); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var implicit_activation_policy_var (implicit_activation_policy); - // Give ownership of this servant to the POA. - new_implicit_activation_policy->_remove_ref (ACE_TRY_ENV); + PortableServer::ImplicitActivationPolicy_var result = implicit_activation_policy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (PortableServer::ImplicitActivationPolicy::_nil ()); - // Make sure that the auto_ptr does not delete the implementation - // object. - new_implicit_activation_policy.release (); return result._retn (); } @@ -2736,19 +2832,16 @@ TAO_POA::create_servant_retention_policy (PortableServer::ServantRetentionPolicy CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (PortableServer::ServantRetentionPolicy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Servant_Retention_Policy> new_servant_retention_policy (servant_retention_policy); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var servant_retention_policy_var (servant_retention_policy); - PortableServer::ServantRetentionPolicy_var result = new_servant_retention_policy->_this (ACE_TRY_ENV); + PortableServer::ServantRetentionPolicy_var result = servant_retention_policy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (PortableServer::ServantRetentionPolicy::_nil ()); - // Give ownership of this servant to the POA. - new_servant_retention_policy->_remove_ref (ACE_TRY_ENV); - ACE_CHECK_RETURN (PortableServer::ServantRetentionPolicy::_nil ()); - - // Make sure that the auto_ptr does not delete the implementation - // object. - new_servant_retention_policy.release (); return result._retn (); } @@ -2766,25 +2859,22 @@ TAO_POA::create_request_processing_policy (PortableServer::RequestProcessingPoli CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (PortableServer::RequestProcessingPolicy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Request_Processing_Policy> new_request_processing_policy (request_processing_policy); - - PortableServer::RequestProcessingPolicy_var result = new_request_processing_policy->_this (ACE_TRY_ENV); - ACE_CHECK_RETURN (PortableServer::RequestProcessingPolicy::_nil ()); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var request_processing_policy_var (request_processing_policy); - // Give ownership of this servant to the POA. - new_request_processing_policy->_remove_ref (ACE_TRY_ENV); + PortableServer::RequestProcessingPolicy_var result = request_processing_policy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (PortableServer::RequestProcessingPolicy::_nil ()); - // Make sure that the auto_ptr does not delete the implementation - // object. - new_request_processing_policy.release (); return result._retn (); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) TAO_Thread_Policy::TAO_Thread_Policy (PortableServer::ThreadPolicyValue value, PortableServer::POA_ptr poa) @@ -2809,19 +2899,16 @@ TAO_Thread_Policy::copy (CORBA::Environment &ACE_TRY_ENV) CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Thread_Policy> new_thread_policy (thread_policy_copy); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var thread_policy_var (thread_policy_copy); - CORBA::Policy_var result = new_thread_policy->_this (ACE_TRY_ENV); + CORBA::Policy_var result = thread_policy_copy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of this servant to the POA. - new_thread_policy->_remove_ref (ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - // Make sure that the auto_ptr does not delete the implementation - // object. - new_thread_policy.release (); return result._retn (); } @@ -2859,7 +2946,7 @@ TAO_Thread_Policy::_default_POA (CORBA::Environment & /* ACE_TRY_ENV */) return PortableServer::POA::_duplicate (this->poa_.in ()); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ TAO_Lifespan_Policy::TAO_Lifespan_Policy (PortableServer::LifespanPolicyValue value, PortableServer::POA_ptr poa) @@ -2884,19 +2971,16 @@ TAO_Lifespan_Policy::copy (CORBA::Environment &ACE_TRY_ENV) CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Lifespan_Policy> new_lifespan_policy (lifespan_policy_copy); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var lifespan_policy_var (lifespan_policy_copy); - CORBA::Policy_var result = new_lifespan_policy->_this (ACE_TRY_ENV); + CORBA::Policy_var result = lifespan_policy_copy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of this servant to the POA. - new_lifespan_policy->_remove_ref (ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - // Make sure that the auto_ptr does not delete the implementation - // object. - new_lifespan_policy.release (); return result._retn (); } @@ -2957,19 +3041,16 @@ TAO_Id_Uniqueness_Policy::copy (CORBA::Environment &ACE_TRY_ENV) CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Id_Uniqueness_Policy> new_id_uniqueness_policy (id_uniqueness_policy_copy); - - CORBA::Policy_var result = new_id_uniqueness_policy->_this (ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var id_uniqueness_policy_var (id_uniqueness_policy_copy); - // Give ownership of this servant to the POA. - new_id_uniqueness_policy->_remove_ref (ACE_TRY_ENV); + CORBA::Policy_var result = id_uniqueness_policy_copy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Make sure that the auto_ptr does not delete the implementation - // object. - new_id_uniqueness_policy.release (); return result._retn (); } @@ -3030,19 +3111,16 @@ TAO_Id_Assignment_Policy::copy (CORBA::Environment &ACE_TRY_ENV) CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Id_Assignment_Policy> new_id_assignment_policy (id_assignment_policy_copy); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var id_assignment_policy_var (id_assignment_policy_copy); - CORBA::Policy_var result = new_id_assignment_policy->_this (ACE_TRY_ENV); + CORBA::Policy_var result = id_assignment_policy_copy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of this servant to the POA. - new_id_assignment_policy->_remove_ref (ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - // Make sure that the auto_ptr does not delete the implementation - // object. - new_id_assignment_policy.release (); return result._retn (); } @@ -3080,7 +3158,7 @@ TAO_Id_Assignment_Policy::_default_POA (CORBA::Environment & /* ACE_TRY_ENV */) return PortableServer::POA::_duplicate (this->poa_.in ()); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) TAO_Implicit_Activation_Policy::TAO_Implicit_Activation_Policy (PortableServer::ImplicitActivationPolicyValue value, PortableServer::POA_ptr poa) @@ -3105,19 +3183,16 @@ TAO_Implicit_Activation_Policy::copy (CORBA::Environment &ACE_TRY_ENV) CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Implicit_Activation_Policy> new_implicit_activation_policy (implicit_activation_policy_copy); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var implicit_activation_policy_var (implicit_activation_policy_copy); - CORBA::Policy_var result = new_implicit_activation_policy->_this (ACE_TRY_ENV); + CORBA::Policy_var result = implicit_activation_policy_copy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of this servant to the POA. - new_implicit_activation_policy->_remove_ref (ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - // Make sure that the auto_ptr does not delete the implementation - // object. - new_implicit_activation_policy.release (); return result._retn (); } @@ -3178,19 +3253,16 @@ TAO_Servant_Retention_Policy::copy (CORBA::Environment &ACE_TRY_ENV) CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Servant_Retention_Policy> new_servant_retention_policy (servant_retention_policy_copy); - - CORBA::Policy_var result = new_servant_retention_policy->_this (ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var servant_retention_policy_var (servant_retention_policy_copy); - // Give ownership of this servant to the POA. - new_servant_retention_policy->_remove_ref (ACE_TRY_ENV); + CORBA::Policy_var result = servant_retention_policy_copy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Make sure that the auto_ptr does not delete the implementation - // object. - new_servant_retention_policy.release (); return result._retn (); } @@ -3251,19 +3323,16 @@ TAO_Request_Processing_Policy::copy (CORBA::Environment &ACE_TRY_ENV) CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of the copy to the auto pointer. - auto_ptr<TAO_Request_Processing_Policy> new_request_processing_policy (request_processing_policy_copy); + // Give ownership of the copy to the servant var. In the case when + // _this() succeeds, the servant var will reduce the servant ref + // count to 1, hence giving the ownership to the POA. In the case + // where _this() fails, the servant var will reduce the servant ref + // count to 0, hence deleting the servant and avoiding memory leaks. + PortableServer::ServantBase_var request_processing_policy_var (request_processing_policy_copy); - CORBA::Policy_var result = new_request_processing_policy->_this (ACE_TRY_ENV); + CORBA::Policy_var result = request_processing_policy_copy->_this (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - // Give ownership of this servant to the POA. - new_request_processing_policy->_remove_ref (ACE_TRY_ENV); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - // Make sure that the auto_ptr does not delete the implementation - // object. - new_request_processing_policy.release (); return result._retn (); } @@ -3301,7 +3370,7 @@ TAO_Request_Processing_Policy::_default_POA (CORBA::Environment & /* ACE_TRY_ENV return PortableServer::POA::_duplicate (this->poa_.in ()); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ TAO_POA_Policies::TAO_POA_Policies (void) : thread_ (PortableServer::ORB_CTRL_MODEL), @@ -3367,7 +3436,7 @@ TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, CORBA::Environment &ACE_TRY_ENV) { -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ThreadPolicy_var thread = PortableServer::ThreadPolicy::_narrow (policy, @@ -3382,7 +3451,7 @@ TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, return; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::LifespanPolicy_var lifespan = PortableServer::LifespanPolicy::_narrow (policy, @@ -3423,7 +3492,7 @@ TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, return; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ImplicitActivationPolicy_var implicit_activation = PortableServer::ImplicitActivationPolicy::_narrow (policy, @@ -3464,12 +3533,12 @@ TAO_POA_Policies::parse_policy (const CORBA::Policy_ptr policy, return; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_THROW (PortableServer::POA::InvalidPolicy ()); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) TAO_Adapter_Activator::TAO_Adapter_Activator (PortableServer::POAManager_ptr poa_manager) : poa_manager_ (PortableServer::POAManager::_duplicate (poa_manager)) @@ -3514,24 +3583,222 @@ TAO_Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, return 1; } +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + +CORBA::Object_ptr +TAO_POA::key_to_object (const TAO_ObjectKey &key, + const char *type_id, + TAO_ServantBase *servant, + CORBA::Boolean collocated, + CORBA_Environment &ACE_TRY_ENV) +{ + CORBA::Object_ptr obj = CORBA::Object::_nil (); + +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) + + if (this->use_imr_ + && this->policies_.lifespan () == PortableServer::PERSISTENT) + { + // Check to see if we alter the IOR. + CORBA::Object_var imr = this->orb_core ().implrepo_service (); + + if (CORBA::is_nil (imr.in ()) + || !imr->_stubobj () + || !imr->_stubobj ()->profile_in_use ()) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "Invalid Implementation Repository IOR, skipping IMRification\n")); + + goto orbkey; + } + + CORBA::String_var imr_str = imr->_stubobj ()->profile_in_use ()->to_string (ACE_TRY_ENV); + ACE_CHECK_RETURN (obj); + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "IMR IOR = \n%s\n", imr_str.in ())); + + char *pos = ACE_OS::strstr (imr_str.inout (), "://"); + + pos = ACE_OS::strchr (pos + 3, imr->_stubobj ()->profile_in_use ()->object_key_delimiter ()); + + if (pos) + *(pos + 1) = 0; // Crop the string + else + { + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, "Could not parse IMR IOR, skipping IMRification\n")); + + goto orbkey; + } + + ACE_CString ior (imr_str.in ()); + + // Add the key + + CORBA::String_var key_str; + TAO_POA::encode_sequence_to_string (key_str.inout (), key); + + ior += key_str.in (); + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "IMR-ified IOR = \n%s\n", ior.c_str ())); + + obj = this->orb_core_.orb ()->string_to_object (ior.c_str (), ACE_TRY_ENV); + ACE_CHECK_RETURN (obj); + + return obj; + } + +orbkey: + #endif /* TAO_HAS_MINIMUM_CORBA */ + obj = this->orb_core_.orb()->key_to_object (key, + type_id, + servant, + collocated, + ACE_TRY_ENV); + ACE_CHECK_RETURN (obj); + + return obj; +} + +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) + +void +TAO_POA::imr_notify_startup (CORBA_Environment &ACE_TRY_ENV) +{ + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "Notifing IMR of Startup\n")); + + CORBA::Object_var imr = this->orb_core ().implrepo_service (); + + if (CORBA::is_nil (imr.in ())) + return; + + ACE_NEW_THROW_EX (this->server_object_, + ServerObject_i (this->orb_core_.orb ()), + CORBA::NO_MEMORY ()); + ACE_CHECK; + + // @@ (brunsch) The server should really be in the root poa, but + // there are locking issues... + + PortableServer::ObjectId_var id = + PortableServer::string_to_ObjectId ("_tao_imr_server_object"); + + this->activate_object_with_id_i (id.in (), + this->server_object_, + ACE_TRY_ENV); + ACE_CHECK; + + CORBA::Object_var obj = this->id_to_reference_i (id.in (), + ACE_TRY_ENV); + ACE_CHECK; + + ImplementationRepository::ServerObject_ptr svr + = ImplementationRepository::ServerObject::_narrow (obj.in (), + ACE_TRY_ENV); + ACE_CHECK; + + if (!svr->_stubobj () || !svr->_stubobj ()->profile_in_use ()) + { + ACE_ERROR ((LM_ERROR, "Invalid ServerObject, bailing out.\n")); + return; + } + + CORBA::String_var svr_str = + svr->_stubobj ()->profile_in_use ()->to_string (ACE_TRY_ENV); + ACE_CHECK; + + char *pos = ACE_OS::strstr (svr_str.inout (), "://"); + + pos = ACE_OS::strchr (pos + 3, + svr->_stubobj ()->profile_in_use ()->object_key_delimiter ()); + + if (pos) + *(pos + 1) = 0; // Crop the string + else + { + ACE_ERROR ((LM_ERROR, + "Could not parse ServerObject IOR, bailing out.\n")); + return; + } + + ACE_CString ior (svr_str.in ()); + + CORBA::String_var curr_addr (svr_str); + + ImplementationRepository::Administration_var imr_admin = + ImplementationRepository::Administration::_narrow (imr.in (), ACE_TRY_ENV); + ACE_CHECK; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "Informing IMR that we are running at: %s\n", curr_addr.in ())); + + imr_admin->server_is_running (this->the_name (), + curr_addr.in (), + svr, + ACE_TRY_ENV); + ACE_CHECK; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "Successfully notified IMR of Startup\n")); + +} + +void +TAO_POA::imr_notify_shutdown (void) +{ + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "Notifing IMR of Shutdown\n")); + + // Notify the Implementation Repository about shutting down. + CORBA::Object_var imr = this->orb_core ().implrepo_service (); + + // Check to see if there was an imr returned. If none, return ourselves. + if (CORBA::is_nil (imr.in ())) + return; + + ACE_TRY_NEW_ENV + { + // Get the IMR's administrative object and call shutting_down on it + ImplementationRepository::Administration_var imr_admin = + ImplementationRepository::Administration::_narrow (imr.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + imr_admin->server_is_shutting_down (this->the_name (), ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Server_i::init"); + // Ignore exceptions + } + ACE_ENDTRY; +} + +#endif /* TAO_HAS_MINIMUM_CORBA */ + + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Array<PortableServer::ObjectId>; template class ACE_Array_Base<PortableServer::ObjectId>; -template class ACE_Auto_Basic_Ptr<TAO_Id_Assignment_Policy>; -template class ACE_Auto_Basic_Ptr<TAO_Id_Uniqueness_Policy>; -template class ACE_Auto_Basic_Ptr<TAO_Lifespan_Policy>; - +// +// Forwarding related. +// #if !defined (TAO_HAS_MINIMUM_CORBA) -template class ACE_Auto_Basic_Ptr<TAO_Thread_Policy>; -template class ACE_Auto_Basic_Ptr<TAO_Implicit_Activation_Policy>; -template class ACE_Auto_Basic_Ptr<TAO_Servant_Retention_Policy>; -template class ACE_Auto_Basic_Ptr<TAO_Request_Processing_Policy>; - template class ACE_Auto_Basic_Ptr<TAO_Forwarding_Servant>; +template class auto_ptr<TAO_Forwarding_Servant>; #endif /* TAO_HAS_MINIMUM_CORBA */ @@ -3555,20 +3822,6 @@ template class ACE_Hash_Map_Reverse_Iterator_Ex<ACE_CString, TAO_POA *, ACE_Hash template class ACE_Hash_Map_Iterator_Base_Ex<ACE_CString, TAO_POA *, ACE_Hash<ACE_CString>, ACE_Equal_To<ACE_CString>, ACE_Null_Mutex>; template class ACE_Write_Guard<ACE_Lock>; template class ACE_Read_Guard<ACE_Lock>; -template class auto_ptr<TAO_Id_Assignment_Policy>; -template class auto_ptr<TAO_Id_Uniqueness_Policy>; -template class auto_ptr<TAO_Lifespan_Policy>; - -#if !defined (TAO_HAS_MINIMUM_CORBA) - -template class auto_ptr<TAO_Thread_Policy>; -template class auto_ptr<TAO_Implicit_Activation_Policy>; -template class auto_ptr<TAO_Servant_Retention_Policy>; -template class auto_ptr<TAO_Request_Processing_Policy>; - -template class auto_ptr<TAO_Forwarding_Servant>; - -#endif /* TAO_HAS_MINIMUM_CORBA */ //template class auto_ptr<TAO_Active_Object_Map_Iterator_Impl>; template class auto_ptr<TAO_POA>; @@ -3581,18 +3834,13 @@ template class ACE_Node<TAO_POA *>; #pragma instantiate ACE_Array<PortableServer::ObjectId> #pragma instantiate ACE_Array_Base<PortableServer::ObjectId> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Id_Assignment_Policy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Id_Uniqueness_Policy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Lifespan_Policy> - +// +// Forwarding related. +// #if !defined (TAO_HAS_MINIMUM_CORBA) -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Thread_Policy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Implicit_Activation_Policy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Servant_Retention_Policy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Request_Processing_Policy> - #pragma instantiate ACE_Auto_Basic_Ptr<TAO_Forwarding_Servant> +#pragma instantiate auto_ptr<TAO_Forwarding_Servant> #endif /* TAO_HAS_MINIMUM_CORBA */ @@ -3616,20 +3864,6 @@ template class ACE_Node<TAO_POA *>; #pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ACE_CString, TAO_POA *, ACE_Hash<ACE_CString>, ACE_Equal_To<ACE_CString>, ACE_Null_Mutex> #pragma instantiate ACE_Write_Guard<ACE_Lock> #pragma instantiate ACE_Read_Guard<ACE_Lock> -#pragma instantiate auto_ptr<TAO_Id_Assignment_Policy> -#pragma instantiate auto_ptr<TAO_Id_Uniqueness_Policy> -#pragma instantiate auto_ptr<TAO_Lifespan_Policy> - -#if !defined (TAO_HAS_MINIMUM_CORBA) - -#pragma instantiate auto_ptr<TAO_Thread_Policy> -#pragma instantiate auto_ptr<TAO_Implicit_Activation_Policy> -#pragma instantiate auto_ptr<TAO_Servant_Retention_Policy> -#pragma instantiate auto_ptr<TAO_Request_Processing_Policy> - -#pragma instantiate auto_ptr<TAO_Forwarding_Servant> - -#endif /* TAO_HAS_MINIMUM_CORBA */ //#pragma instantiate auto_ptr<TAO_Active_Object_Map_Iterator_Impl> #pragma instantiate auto_ptr<TAO_POA> diff --git a/TAO/tao/POA.h b/TAO/tao/POA.h index 7870573a59d..80992ac85c5 100644 --- a/TAO/tao/POA.h +++ b/TAO/tao/POA.h @@ -45,15 +45,26 @@ // POA Manager #include "tao/POAManager.h" +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) +// Implementation Repository +# include "tao/ImplRepoC.h" +#endif /* TAO_HAS_MINIMUM_CORBA */ + // This is to remove "inherits via dominance" warnings from MSVC. // MSVC is being a little too paranoid. -#if defined (_MSC_VER) -# pragma warning (disable : 4250) +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) #endif /* _MSC_VER */ class TAO_POA; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) class TAO_Export TAO_Thread_Policy : public virtual PortableServer::RefCountServantBase, public virtual POA_PortableServer::ThreadPolicy @@ -78,7 +89,7 @@ protected: PortableServer::POA_var poa_; }; -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ class TAO_Export TAO_Lifespan_Policy : public virtual PortableServer::RefCountServantBase, public virtual POA_PortableServer::LifespanPolicy @@ -149,7 +160,7 @@ protected: PortableServer::POA_var poa_; }; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) class TAO_Export TAO_Implicit_Activation_Policy : public virtual PortableServer::RefCountServantBase, public virtual POA_PortableServer::ImplicitActivationPolicy @@ -220,7 +231,7 @@ protected: PortableServer::POA_var poa_; }; -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ class TAO_Export TAO_POA_Policies { @@ -228,12 +239,12 @@ public: TAO_POA_Policies (void); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ThreadPolicyValue thread (void) const; void thread (PortableServer::ThreadPolicyValue value); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::LifespanPolicyValue lifespan (void) const; void lifespan (PortableServer::LifespanPolicyValue value); @@ -333,6 +344,9 @@ protected: void *time_stamp_; }; +// Forward Declaration +class ServerObject_i; + class TAO_Export TAO_POA : public POA_PortableServer::POA { public: @@ -357,12 +371,12 @@ public: CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -373,7 +387,7 @@ public: PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -384,7 +398,7 @@ public: PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ char * the_name (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -392,7 +406,7 @@ public: PortableServer::POAManager_ptr the_POAManager (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::AdapterActivator_ptr the_activator (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -409,7 +423,7 @@ public: void set_servant (PortableServer::Servant servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -445,6 +459,9 @@ public: CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); +// +// Forwarding related. +// #if !defined (TAO_HAS_MINIMUM_CORBA) void forward_object (const PortableServer::ObjectId &oid, @@ -524,7 +541,7 @@ protected: CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ServantManager_ptr get_servant_manager_i (CORBA_Environment &ACE_TRY_ENV); @@ -536,8 +553,30 @@ protected: void set_servant_i (PortableServer::Servant servant, CORBA_Environment &ACE_TRY_ENV); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + +// +// ImplRepo related. +// +#if !defined (TAO_HAS_MINIMUM_CORBA) + + void imr_notify_startup (CORBA_Environment &ACE_TRY_ENV); + // ImplRepo helper method, notify the ImplRepo on startup + + void imr_notify_shutdown (void); + // ImplRepo helper method, notify the ImplRepo on shutdown + #endif /* TAO_HAS_MINIMUM_CORBA */ + CORBA::Object_ptr key_to_object (const TAO_ObjectKey &key, + const char *type_id, + TAO_ServantBase *servant = 0, + CORBA::Boolean collocated = 1, + CORBA_Environment &ACE_TRY_ENV = + TAO_default_environment ()); + // Wrapper for the ORB's key_to_object that will alter the object pointer + // if the ImplRepo is used. + int is_servant_in_map (PortableServer::Servant servant); int is_user_id_in_map (const PortableServer::ObjectId &user_id); @@ -588,6 +627,9 @@ protected: CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid, CORBA_Environment &ACE_TRY_ENV); +// +// Forwarding related. +// #if !defined (TAO_HAS_MINIMUM_CORBA) void forward_object_i (const PortableServer::ObjectId &oid, @@ -689,7 +731,7 @@ protected: int delete_active_object_map_; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::AdapterActivator_var adapter_activator_; @@ -699,6 +741,16 @@ protected: PortableServer::ServantBase_var default_servant_; +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + +#if !defined (TAO_HAS_MINIMUM_CORBA) + + ServerObject_i *server_object_; + // Implementation Repository Server Object + + int use_imr_; + // Flag for whether the IR should be used or not. + #endif /* TAO_HAS_MINIMUM_CORBA */ typedef ACE_Hash_Map_Manager<ACE_CString, TAO_POA *, ACE_Null_Mutex> @@ -733,7 +785,7 @@ protected: CORBA::ULong waiting_servant_deactivation_; }; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) class TAO_Export TAO_Adapter_Activator : public POA_PortableServer::AdapterActivator { @@ -751,7 +803,11 @@ protected: // POA Manager }; -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma warning(pop) +#endif /* _MSC_VER */ #if defined (__ACE_INLINE__) # include "tao/POA.i" diff --git a/TAO/tao/POA.i b/TAO/tao/POA.i index f2145675125..58f279abb31 100644 --- a/TAO/tao/POA.i +++ b/TAO/tao/POA.i @@ -4,7 +4,7 @@ #include "tao/poa_macros.h" #include "tao/Environment.h" -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE PortableServer::ThreadPolicyValue TAO_POA_Policies::thread (void) const @@ -18,7 +18,7 @@ TAO_POA_Policies::thread (PortableServer::ThreadPolicyValue value) this->thread_ = value; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE PortableServer::LifespanPolicyValue TAO_POA_Policies::lifespan (void) const @@ -248,7 +248,7 @@ TAO_POA::active_object_map (void) const return *this->active_object_map_; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE PortableServer::ServantManager_ptr TAO_POA::get_servant_manager (CORBA::Environment &ACE_TRY_ENV) @@ -290,7 +290,7 @@ TAO_POA::set_servant (PortableServer::Servant servant, ACE_TRY_ENV); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE PortableServer::ObjectId * TAO_POA::activate_object (PortableServer::Servant servant, @@ -396,6 +396,9 @@ TAO_POA::id_to_reference (const PortableServer::ObjectId &oid, return this->id_to_reference_i (oid, ACE_TRY_ENV); } +// +// Forwarding related. +// #if !defined (TAO_HAS_MINIMUM_CORBA) ACE_INLINE void @@ -428,7 +431,7 @@ TAO_POA::the_POAManager (CORBA::Environment &ACE_TRY_ENV) return this->poa_manager_._this (ACE_TRY_ENV); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE PortableServer::AdapterActivator_ptr TAO_POA::the_activator (CORBA::Environment &ACE_TRY_ENV) @@ -449,7 +452,7 @@ TAO_POA::the_activator (PortableServer::AdapterActivator_ptr adapter_activator, this->adapter_activator_ = PortableServer::AdapterActivator::_duplicate (adapter_activator); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE const TAO_Creation_Time & TAO_POA::creation_time (void) @@ -623,27 +626,27 @@ TAO_POA::decrement_outstanding_requests (void) ACE_INLINE void TAO_POA::establish_servant_lock (PortableServer::Servant servant) { -#if defined (TAO_HAS_MINIMUM_CORBA) - ACE_UNUSED_ARG (servant); -#else /* ! TAO_HAS_MINIMUM_CORBA */ +#if (TAO_HAS_MINIMUM_POA == 0) if (this->policies ().thread () == PortableServer::SINGLE_THREAD_MODEL) { servant->_increment_single_threaded_poa_lock_count (); } -#endif /* ! TAO_HAS_MINIMUM_CORBA */ +#else /* TAO_HAS_MINIMUM_POA == 0 */ + ACE_UNUSED_ARG (servant); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ } ACE_INLINE void TAO_POA::teardown_servant_lock (PortableServer::Servant servant) { -#if defined (TAO_HAS_MINIMUM_CORBA) - ACE_UNUSED_ARG (servant); -#else /* ! TAO_HAS_MINIMUM_CORBA */ +#if (TAO_HAS_MINIMUM_POA == 0) if (this->policies ().thread () == PortableServer::SINGLE_THREAD_MODEL) { servant->_decrement_single_threaded_poa_lock_count (); } -#endif /* ! TAO_HAS_MINIMUM_CORBA */ +#else /* TAO_HAS_MINIMUM_POA == 0 */ + ACE_UNUSED_ARG (servant); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ } ACE_INLINE TAO_ORB_Core & diff --git a/TAO/tao/POAC.cpp b/TAO/tao/POAC.cpp index 9dc34495fdd..182c77f7da5 100644 --- a/TAO/tao/POAC.cpp +++ b/TAO/tao/POAC.cpp @@ -250,7 +250,7 @@ TAO_NAMESPACE_BEGIN (PortableServer) TAO_NAMESPACE_DEFINE (const CORBA::ULong, REQUEST_PROCESSING_POLICY_ID, 22) TAO_NAMESPACE_END -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) static const CORBA::Long _oc_PortableServer_ThreadPolicyValue[] = { @@ -351,7 +351,7 @@ PortableServer::ThreadPolicyValue PortableServer::ThreadPolicy::value(CORBA::Env _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -413,7 +413,7 @@ TAO_NAMESPACE_BEGIN (PortableServer) TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_ThreadPolicy, &_tc_TAO_tc_PortableServer_ThreadPolicy) TAO_NAMESPACE_END -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ static const CORBA::Long _oc_PortableServer_LifespanPolicyValue[] = { @@ -514,7 +514,7 @@ PortableServer::LifespanPolicyValue PortableServer::LifespanPolicy::value(CORBA: _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -677,7 +677,7 @@ PortableServer::IdUniquenessPolicyValue PortableServer::IdUniquenessPolicy::valu _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -839,7 +839,7 @@ PortableServer::IdAssignmentPolicyValue PortableServer::IdAssignmentPolicy::valu _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -903,7 +903,7 @@ TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_IdAssignmentPolicy, &_tc_TAO_tc_P TAO_NAMESPACE_END -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) static const CORBA::Long _oc_PortableServer_ImplicitActivationPolicyValue[] = { @@ -1004,7 +1004,7 @@ PortableServer::ImplicitActivationPolicyValue PortableServer::ImplicitActivation _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1167,7 +1167,7 @@ PortableServer::ServantRetentionPolicyValue PortableServer::ServantRetentionPoli _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1330,7 +1330,7 @@ PortableServer::RequestProcessingPolicyValue PortableServer::RequestProcessingPo _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1393,7 +1393,7 @@ TAO_NAMESPACE_BEGIN (PortableServer) TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_RequestProcessingPolicy, &_tc_TAO_tc_PortableServer_RequestProcessingPolicy) TAO_NAMESPACE_END -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::POAManager_ptr PortableServer::POAManager::_duplicate (PortableServer::POAManager_ptr obj) { @@ -1601,7 +1601,7 @@ TAO_NAMESPACE_BEGIN (PortableServer) TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_POAManager, &_tc_TAO_tc_PortableServer_POAManager) TAO_NAMESPACE_END -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_duplicate (PortableServer::AdapterActivator_ptr obj) { @@ -1897,7 +1897,7 @@ TAO_NAMESPACE_BEGIN (PortableServer) TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_ServantLocator, &_tc_TAO_tc_PortableServer_ServantLocator) TAO_NAMESPACE_END -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::POA_ptr PortableServer::POA::_duplicate (PortableServer::POA_ptr obj) { @@ -2073,7 +2073,7 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_AdapterAlreadyExists (PortableServer::POA::AdapterAlreadyExists)); CORBA::TypeCode_ptr PortableServer::POA::_tc_AdapterAlreadyExists = &_tc_TAO_tc_PortableServer_POA_AdapterAlreadyExists; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // default constructor PortableServer::POA::AdapterInactive::AdapterInactive (void) @@ -2207,7 +2207,7 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_AdapterInactive (PortableServer::POA::AdapterInactive)); CORBA::TypeCode_ptr PortableServer::POA::_tc_AdapterInactive = &_tc_TAO_tc_PortableServer_POA_AdapterInactive; -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // default constructor PortableServer::POA::AdapterNonExistent::AdapterNonExistent (void) @@ -2485,7 +2485,7 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_InvalidPolicy (PortableServer::POA::InvalidPolicy)); CORBA::TypeCode_ptr PortableServer::POA::_tc_InvalidPolicy = &_tc_TAO_tc_PortableServer_POA_InvalidPolicy; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // default constructor PortableServer::POA::NoServant::NoServant (void) @@ -2621,7 +2621,7 @@ static CORBA::TypeCode _tc_TAO_tc_PortableServer_POA_NoServant (CORBA::tk_except sizeof (PortableServer::POA::NoServant)); CORBA::TypeCode_ptr PortableServer::POA::_tc_NoServant = &_tc_TAO_tc_PortableServer_POA_NoServant; -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // default constructor PortableServer::POA::ObjectAlreadyActive::ObjectAlreadyActive (void) @@ -3654,7 +3654,7 @@ PortableServer::ObjectId * PortableServer::Current::get_object_id (CORBA::Enviro _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); diff --git a/TAO/tao/POAC.h b/TAO/tao/POAC.h index b96ec311aa8..97a9cc3db09 100644 --- a/TAO/tao/POAC.h +++ b/TAO/tao/POAC.h @@ -1,5 +1,4 @@ // $Id$ - // // ============================================================================ // diff --git a/TAO/tao/POAC.i b/TAO/tao/POAC.i index 82876a5b4cc..07b043d1b4c 100644 --- a/TAO/tao/POAC.i +++ b/TAO/tao/POAC.i @@ -209,7 +209,7 @@ ACE_INLINE PortableServer::_tao_seq_Octet_var::_tao_seq_Octet_var (const PortableServer::_tao_seq_Octet_var &p) // copy constructor { if (p.ptr_) - ACE_NEW (this->ptr_, + ACE_NEW (this->ptr_, PortableServer::_tao_seq_Octet (*p.ptr_)); else this->ptr_ = 0; @@ -235,9 +235,9 @@ PortableServer::_tao_seq_Octet_var::operator= (const PortableServer::_tao_seq_Oc if (this != &p) { delete this->ptr_; - ACE_NEW_RETURN (this->ptr_, - PortableServer::_tao_seq_Octet (*p.ptr_), - *this); + ACE_NEW_RETURN (this->ptr_, + PortableServer::_tao_seq_Octet (*p.ptr_), + *this); } return *this; } @@ -385,7 +385,7 @@ PortableServer::_tao_seq_Octet_out::operator[] (CORBA::ULong slot) #endif // end #if !defined -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE PortableServer::ThreadPolicy::ThreadPolicy( @@ -579,7 +579,7 @@ PortableServer::ThreadPolicy_out::operator-> (void) #endif // end #if !defined -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE PortableServer::LifespanPolicy::LifespanPolicy( @@ -1160,7 +1160,7 @@ PortableServer::IdAssignmentPolicy_out::operator-> (void) #endif // end #if !defined -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE PortableServer::ImplicitActivationPolicy::ImplicitActivationPolicy( @@ -1741,7 +1741,7 @@ PortableServer::RequestProcessingPolicy_out::operator-> (void) #endif // end #if !defined -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE PortableServer::POAManager::POAManager( @@ -1936,7 +1936,7 @@ PortableServer::POAManager_out::operator-> (void) #endif // end #if !defined -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE PortableServer::AdapterActivator::AdapterActivator( @@ -2710,7 +2710,7 @@ PortableServer::ServantLocator_out::operator-> (void) #endif // end #if !defined -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE PortableServer::POA::POA( @@ -3106,7 +3106,8 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::Thread return 0; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) + ACE_INLINE CORBA::Boolean operator<< ( TAO_OutputCDR &, @@ -3155,7 +3156,8 @@ operator>> ( ACE_ENDTRY; return 0; } -#endif /* end #if !defined */ + +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::LifespanPolicyValue &_tao_enumval) { @@ -3355,6 +3357,8 @@ operator>> ( return 0; } +#if (TAO_HAS_MINIMUM_POA == 0) + ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::ImplicitActivationPolicyValue &_tao_enumval) { return strm.write_ulong ((CORBA::ULong) _tao_enumval); @@ -3372,8 +3376,6 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::Implic return 0; } -#if !defined (TAO_HAS_MINIMUM_CORBA) - ACE_INLINE CORBA::Boolean operator<< ( TAO_OutputCDR &, @@ -3422,8 +3424,6 @@ operator>> ( ACE_ENDTRY; return 0; } -#endif /* !defined (TAO_HAS_MINIMUM_CORBA) */ - ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::ServantRetentionPolicyValue &_tao_enumval) { @@ -3442,8 +3442,6 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::Servan return 0; } -#if !defined (TAO_HAS_MINIMUM_CORBA) - ACE_INLINE CORBA::Boolean operator<< ( TAO_OutputCDR &, @@ -3493,8 +3491,6 @@ operator>> ( return 0; } -#endif /* TAO_HAS_MINIMUM_CORBA */ - ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::RequestProcessingPolicyValue &_tao_enumval) { return strm.write_ulong ((CORBA::ULong) _tao_enumval); @@ -3512,8 +3508,6 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::Reques return 0; } -#if !defined(TAO_HAS_MINIMUM_CORBA) - ACE_INLINE CORBA::Boolean operator<< ( TAO_OutputCDR &, @@ -3562,7 +3556,8 @@ operator>> ( ACE_ENDTRY; return 0; } -#endif /* TAO_HAS_MINIMUM_CORBA */ + +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::POA::AdapterAlreadyExists &_tao_aggregate) @@ -3587,7 +3582,7 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::POA::A return 0; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::POA::AdapterInactive &_tao_aggregate) { @@ -3610,7 +3605,8 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::POA::A else return 0; } -#endif /* TAO_HAS_MINIMUM_CORBA */ + +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::POA::AdapterNonExistent &_tao_aggregate) { @@ -3666,7 +3662,7 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::POA::I return 0; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::POA::NoServant &_tao_aggregate) { @@ -3689,7 +3685,8 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, PortableServer::POA::N else return 0; } -#endif /* !defined (TAO_HAS_MINIMUM_CORBA) */ + +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const PortableServer::POA::ObjectAlreadyActive &_tao_aggregate) { diff --git a/TAO/tao/POAManager.cpp b/TAO/tao/POAManager.cpp index fa7d5ca89bb..8c86e550a06 100644 --- a/TAO/tao/POAManager.cpp +++ b/TAO/tao/POAManager.cpp @@ -110,7 +110,7 @@ TAO_POA_Manager::deactivate_i (CORBA::Boolean etherealize_objects, // of ORB::shutdown. } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) void TAO_POA_Manager::hold_requests_i (CORBA::Boolean wait_for_completion, @@ -220,7 +220,7 @@ TAO_POA_Manager::discard_requests_i (CORBA::Boolean wait_for_completion, } } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ int TAO_POA_Manager::remove_poa (TAO_POA *poa) diff --git a/TAO/tao/POAManager.h b/TAO/tao/POAManager.h index 4370f37be37..2a15d65d946 100644 --- a/TAO/tao/POAManager.h +++ b/TAO/tao/POAManager.h @@ -42,7 +42,7 @@ public: void activate (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) void hold_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -54,7 +54,7 @@ public: CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::POAManager::State get_state (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -70,7 +70,7 @@ protected: CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) void hold_requests_i (CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV); @@ -78,7 +78,7 @@ protected: void discard_requests_i (CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::POAManager::State get_state_i (); diff --git a/TAO/tao/POAManager.i b/TAO/tao/POAManager.i index 28e8acbd991..b953dfd69b3 100644 --- a/TAO/tao/POAManager.i +++ b/TAO/tao/POAManager.i @@ -17,7 +17,7 @@ TAO_POA_Manager::activate (CORBA_Environment &ACE_TRY_ENV) this->activate_i (ACE_TRY_ENV); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) ACE_INLINE void TAO_POA_Manager::hold_requests (CORBA::Boolean wait_for_completion, @@ -52,7 +52,7 @@ TAO_POA_Manager::deactivate (CORBA::Boolean etherealize_objects, ACE_TRY_ENV); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ ACE_INLINE PortableServer::POAManager::State TAO_POA_Manager::get_state_i (void) diff --git a/TAO/tao/POAS.cpp b/TAO/tao/POAS.cpp index 5a56aa90a1b..0fcd784cdac 100644 --- a/TAO/tao/POAS.cpp +++ b/TAO/tao/POAS.cpp @@ -19,7 +19,7 @@ ACE_RCSID(tao, POAS, "$Id$") -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) class TAO_PortableServer_ThreadPolicy_Perfect_Hash_OpTable : public TAO_Perfect_Hash_OpTable @@ -223,7 +223,7 @@ void POA_PortableServer::ThreadPolicy::_dispatch (CORBA::ServerRequest &req, voi // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -314,7 +314,7 @@ POA_PortableServer::ThreadPolicy::_this (CORBA_Environment &ACE_TRY_ENV) return retval; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) class TAO_PortableServer_LifespanPolicy_Perfect_Hash_OpTable : public TAO_Perfect_Hash_OpTable @@ -519,7 +519,7 @@ void POA_PortableServer::LifespanPolicy::_dispatch (CORBA::ServerRequest &req, v // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -812,7 +812,7 @@ void POA_PortableServer::IdUniquenessPolicy::_dispatch (CORBA::ServerRequest &re // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -1108,7 +1108,7 @@ void POA_PortableServer::IdAssignmentPolicy::_dispatch (CORBA::ServerRequest &re // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -1200,7 +1200,7 @@ POA_PortableServer::IdAssignmentPolicy::_this (CORBA_Environment &ACE_TRY_ENV) return retval; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) class TAO_PortableServer_ImplicitActivationPolicy_Perfect_Hash_OpTable : public TAO_Perfect_Hash_OpTable @@ -1405,7 +1405,7 @@ void POA_PortableServer::ImplicitActivationPolicy::_dispatch (CORBA::ServerReque // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -1700,7 +1700,7 @@ void POA_PortableServer::ServantRetentionPolicy::_dispatch (CORBA::ServerRequest // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -1995,7 +1995,7 @@ void POA_PortableServer::RequestProcessingPolicy::_dispatch (CORBA::ServerReques // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("Bad operation <%s>\n"), opname)); ACE_THROW (CORBA_BAD_OPERATION ()); } else @@ -2087,7 +2087,7 @@ POA_PortableServer::RequestProcessingPolicy::_this (CORBA_Environment &ACE_TRY_E return retval; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // skeleton constructor POA_PortableServer::POAManager::POAManager (void) @@ -2158,7 +2158,7 @@ void POA_PortableServer::_tao_collocated_POAManager::activate ( ); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) void POA_PortableServer::_tao_collocated_POAManager::hold_requests ( CORBA::Boolean wait_for_completion, @@ -2195,7 +2195,7 @@ void POA_PortableServer::_tao_collocated_POAManager::deactivate ( ); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::POAManager::State POA_PortableServer::_tao_collocated_POAManager:: get_state(CORBA::Environment &ACE_TRY_ENV) @@ -2218,7 +2218,7 @@ POA_PortableServer::POAManager::_this (CORBA_Environment &) return retval; } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // skeleton constructor POA_PortableServer::AdapterActivator::AdapterActivator (void) @@ -2613,7 +2613,7 @@ POA_PortableServer::ServantLocator::_this (CORBA_Environment &) return retval; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // skeleton constructor POA_PortableServer::POA::POA (void) @@ -2716,7 +2716,7 @@ void POA_PortableServer::_tao_collocated_POA::destroy ( ); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ThreadPolicy_ptr POA_PortableServer::_tao_collocated_POA::create_thread_policy ( PortableServer::ThreadPolicyValue value, @@ -2729,7 +2729,7 @@ PortableServer::ThreadPolicy_ptr POA_PortableServer::_tao_collocated_POA::create ); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::LifespanPolicy_ptr POA_PortableServer::_tao_collocated_POA::create_lifespan_policy ( PortableServer::LifespanPolicyValue value, @@ -2764,7 +2764,7 @@ PortableServer::IdAssignmentPolicy_ptr POA_PortableServer::_tao_collocated_POA:: ); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ImplicitActivationPolicy_ptr POA_PortableServer::_tao_collocated_POA::create_implicit_activation_policy ( PortableServer::ImplicitActivationPolicyValue value, @@ -2799,7 +2799,7 @@ PortableServer::RequestProcessingPolicy_ptr POA_PortableServer::_tao_collocated_ ); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ char* POA_PortableServer::_tao_collocated_POA::the_name ( @@ -2823,7 +2823,7 @@ POA_PortableServer::_tao_collocated_POA::the_POAManager ( return this->servant_->the_POAManager(ACE_TRY_ENV); } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) PortableServer::AdapterActivator_ptr POA_PortableServer::_tao_collocated_POA::the_activator ( @@ -2884,7 +2884,7 @@ void POA_PortableServer::_tao_collocated_POA::set_servant ( ); } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::ObjectId * POA_PortableServer::_tao_collocated_POA::activate_object ( PortableServer::Servant p_servant, diff --git a/TAO/tao/POAS.h b/TAO/tao/POAS.h index 14f41651864..bb23b1fd692 100644 --- a/TAO/tao/POAS.h +++ b/TAO/tao/POAS.h @@ -41,7 +41,7 @@ TAO_NAMESPACE POA_PortableServer { -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) class ThreadPolicy; typedef ThreadPolicy *ThreadPolicy_ptr; @@ -119,7 +119,7 @@ TAO_NAMESPACE POA_PortableServer #endif // end #if !defined -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ class LifespanPolicy; typedef LifespanPolicy *LifespanPolicy_ptr; @@ -358,7 +358,7 @@ TAO_NAMESPACE POA_PortableServer #endif // end #if !defined -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) class ImplicitActivationPolicy; typedef ImplicitActivationPolicy *ImplicitActivationPolicy_ptr; @@ -596,7 +596,7 @@ TAO_NAMESPACE POA_PortableServer #endif // end #if !defined -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ class POAManager; @@ -615,7 +615,7 @@ TAO_NAMESPACE POA_PortableServer ); virtual void activate ( CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual void hold_requests (CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual @@ -623,7 +623,7 @@ TAO_NAMESPACE POA_PortableServer virtual void deactivate (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual PortableServer::POAManager::State get_state (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual @@ -651,7 +651,7 @@ TAO_NAMESPACE POA_PortableServer CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual void hold_requests ( CORBA::Boolean wait_for_completion, @@ -667,7 +667,7 @@ TAO_NAMESPACE POA_PortableServer CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual PortableServer::POAManager::State get_state (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -679,7 +679,7 @@ TAO_NAMESPACE POA_PortableServer #endif // end #if !defined -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) class AdapterActivator; typedef AdapterActivator *AdapterActivator_ptr; @@ -902,7 +902,7 @@ TAO_NAMESPACE POA_PortableServer #endif // end #if !defined -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ class POA; typedef POA *POA_ptr; @@ -924,11 +924,11 @@ TAO_NAMESPACE POA_PortableServer virtual void destroy (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual @@ -936,7 +936,7 @@ TAO_NAMESPACE POA_PortableServer virtual PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual @@ -944,7 +944,7 @@ TAO_NAMESPACE POA_PortableServer virtual PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual char * the_name (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; @@ -952,7 +952,7 @@ TAO_NAMESPACE POA_PortableServer virtual PortableServer::POAManager_ptr the_POAManager (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual PortableServer::AdapterActivator_ptr the_activator (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; @@ -966,7 +966,7 @@ TAO_NAMESPACE POA_PortableServer virtual void set_servant (PortableServer::Servant p_servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual PortableServer::ObjectId * activate_object (PortableServer::Servant p_servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()) = 0; // pure virtual @@ -1027,14 +1027,14 @@ TAO_NAMESPACE POA_PortableServer CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual PortableServer::ThreadPolicy_ptr create_thread_policy ( PortableServer::ThreadPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual PortableServer::LifespanPolicy_ptr create_lifespan_policy ( PortableServer::LifespanPolicyValue value, @@ -1048,7 +1048,7 @@ TAO_NAMESPACE POA_PortableServer PortableServer::IdAssignmentPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy ( PortableServer::ImplicitActivationPolicyValue value, @@ -1062,7 +1062,7 @@ TAO_NAMESPACE POA_PortableServer PortableServer::RequestProcessingPolicyValue value, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual char* the_name ( @@ -1074,7 +1074,7 @@ TAO_NAMESPACE POA_PortableServer virtual PortableServer::POAManager_ptr the_POAManager ( CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) virtual PortableServer::AdapterActivator_ptr the_activator ( CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () @@ -1097,7 +1097,7 @@ TAO_NAMESPACE POA_PortableServer CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ virtual PortableServer::ObjectId * activate_object ( PortableServer::Servant p_servant, diff --git a/TAO/tao/POAS.i b/TAO/tao/POAS.i index 0d08448e83d..ba9c7e0c1ff 100644 --- a/TAO/tao/POAS.i +++ b/TAO/tao/POAS.i @@ -7,7 +7,7 @@ // Information on TAO is available at // http://www.cs.wustl.edu/~schmidt/TAO.html -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // skeleton destructor ACE_INLINE @@ -33,7 +33,7 @@ ACE_INLINE void POA_PortableServer::ThreadPolicy::_get_policy_type_skel (CORBA:: } #endif /* !TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // skeleton destructor ACE_INLINE @@ -107,7 +107,7 @@ ACE_INLINE void POA_PortableServer::IdAssignmentPolicy::_get_policy_type_skel (C } #endif /* !TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // skeleton destructor ACE_INLINE @@ -181,7 +181,7 @@ ACE_INLINE void POA_PortableServer::RequestProcessingPolicy::_get_policy_type_sk } #endif /* !TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // skeleton destructor ACE_INLINE @@ -189,7 +189,7 @@ POA_PortableServer::POAManager::~POAManager (void) { } -#if !defined (TAO_HAS_MINIMUM_CORBA) +#if (TAO_HAS_MINIMUM_POA == 0) // skeleton destructor ACE_INLINE @@ -212,7 +212,7 @@ POA_PortableServer::ServantLocator::~ServantLocator (void) { } -#endif /* TAO_HAS_MINIMUM_CORBA */ +#endif /* TAO_HAS_MINIMUM_POA == 0 */ // skeleton destructor ACE_INLINE diff --git a/TAO/tao/POA_CORBA.h b/TAO/tao/POA_CORBA.h index a1b9f1ba5f3..77210f68c8d 100644 --- a/TAO/tao/POA_CORBA.h +++ b/TAO/tao/POA_CORBA.h @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index 181c8e211cc..e1c9c6112c0 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -109,7 +109,6 @@ TAO_Transport::reset_sent_message (ACE_Message_Block *message_block, 0); } - void TAO_Transport::reset_queued_message (ACE_Message_Block *message_block, size_t bytes_delivered) @@ -166,6 +165,7 @@ TAO_Transport::reset_message (ACE_Message_Block *message_block, { // Go to the next message block chain. message_block = message_block->next (); + // If queued message, adjust the queue. if (queued_message) // Release this <current_message_block>. @@ -198,11 +198,11 @@ TAO_Transport::idle_after_send (void) return this->tms ()->idle_after_send (); } -// int -// TAO_Transport::idle_after_reply (void) -// { -// return this->tms ()->idle_after_reply (); -// } +int +TAO_Transport::idle_after_reply (void) +{ + return this->tms ()->idle_after_reply (); +} // int // TAO_Transport::reply_received (const CORBA::ULong request_id) diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index acd0282eefd..73d2df4c872 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -61,6 +61,10 @@ class TAO_Export TAO_Transport // The transport object is created in the Service handler // constructor and deleted in the Service Handler's destructor!! + friend class TAO_Transport_Sync_Strategy; + friend class TAO_Eager_Buffering_Sync_Strategy; + friend class TAO_Delayed_Buffering_Sync_Strategy; + public: TAO_Transport (CORBA::ULong tag, TAO_ORB_Core *orb_core); @@ -179,6 +183,10 @@ public: // Request has been just sent, but the reply is not received. Idle // the transport now. + virtual int idle_after_reply (void); + // Request is sent and the reply is received. Idle the transport + // now. + virtual ACE_SYNCH_CONDITION *leader_follower_condition_variable (void); // Return the TSS leader follower condition variable used in the // Wait Strategy. Muxed Leader Follower implementation returns a diff --git a/TAO/tao/PolicyC.cpp b/TAO/tao/PolicyC.cpp index 4517078defe..dd5be304cd6 100644 --- a/TAO/tao/PolicyC.cpp +++ b/TAO/tao/PolicyC.cpp @@ -249,7 +249,7 @@ CORBA::PolicyType CORBA_Policy::policy_type ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -302,7 +302,7 @@ CORBA_Policy_ptr CORBA_Policy::copy ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -354,7 +354,7 @@ void CORBA_Policy::destroy ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); diff --git a/TAO/tao/Policy_Manager.cpp b/TAO/tao/Policy_Manager.cpp index 2fded2da609..cb0047b55ce 100644 --- a/TAO/tao/Policy_Manager.cpp +++ b/TAO/tao/Policy_Manager.cpp @@ -1,5 +1,6 @@ // $Id$ + #include "tao/Policy_Manager.h" #if (TAO_HAS_CORBA_MESSAGING == 1) @@ -17,6 +18,7 @@ ACE_RCSID(tao, Policy_Manager, "$Id$") + TAO_Policy_Manager_Impl::~TAO_Policy_Manager_Impl (void) { ACE_DECLARE_NEW_CORBA_ENV; diff --git a/TAO/tao/Policy_Manager.h b/TAO/tao/Policy_Manager.h index 569dd978c87..77b39fd9be7 100644 --- a/TAO/tao/Policy_Manager.h +++ b/TAO/tao/Policy_Manager.h @@ -1,6 +1,7 @@ // -*- C++ -*- // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/PollableC.cpp b/TAO/tao/PollableC.cpp index a7941e67d6a..48680e0cf0b 100644 --- a/TAO/tao/PollableC.cpp +++ b/TAO/tao/PollableC.cpp @@ -32,6 +32,7 @@ ACE_RCSID(tao, PollableC, "$Id$") + CORBA_Pollable_ptr CORBA_Pollable::_narrow ( CORBA::Object_ptr obj, CORBA::Environment &ACE_TRY_ENV @@ -137,7 +138,7 @@ CORBA::Boolean CORBA_Pollable::is_ready ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -197,7 +198,7 @@ CORBA_PollableSet_ptr CORBA_Pollable::create_pollable_set ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -570,7 +571,7 @@ CORBA::DIIPollable_ptr CORBA_PollableSet::create_dii_pollable ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -624,7 +625,7 @@ void CORBA_PollableSet::add_pollable ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -685,7 +686,7 @@ CORBA_Pollable_ptr CORBA_PollableSet::poll ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -750,7 +751,7 @@ void CORBA_PollableSet::remove ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -805,7 +806,7 @@ CORBA::UShort CORBA_PollableSet::number_left ( _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); diff --git a/TAO/tao/PollableC.h b/TAO/tao/PollableC.h index 654cbdd3aa8..3b3808dc808 100644 --- a/TAO/tao/PollableC.h +++ b/TAO/tao/PollableC.h @@ -2,6 +2,7 @@ // // $Id$ + // // ================================================================ // diff --git a/TAO/tao/PollableS.cpp b/TAO/tao/PollableS.cpp index 482ff6114fe..4c0f72f8a65 100644 --- a/TAO/tao/PollableS.cpp +++ b/TAO/tao/PollableS.cpp @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // // $Id$ + // // ================================================================ // @@ -30,6 +31,7 @@ ACE_RCSID(tao, PollableS, "$Id$") + class TAO_CORBA_Pollable_Perfect_Hash_OpTable : public TAO_Perfect_Hash_OpTable { private: diff --git a/TAO/tao/Pool_Per_Endpoint.cpp b/TAO/tao/Pool_Per_Endpoint.cpp index e2d28d8c409..832c3fd1f21 100644 --- a/TAO/tao/Pool_Per_Endpoint.cpp +++ b/TAO/tao/Pool_Per_Endpoint.cpp @@ -15,6 +15,7 @@ ACE_RCSID(tao, Pool_Per_Endpoint, "$Id$") + TAO_Pool_Per_Endpoint::TAO_Pool_Per_Endpoint (CORBA::ORB_ptr orb, int policy, int poolsize, diff --git a/TAO/tao/Principal.h b/TAO/tao/Principal.h index ba3b1b5bbd4..a861fa4fbb3 100644 --- a/TAO/tao/Principal.h +++ b/TAO/tao/Principal.h @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/Priority_Mapping.cpp b/TAO/tao/Priority_Mapping.cpp index 7bdad39a60b..aafd60b22b4 100644 --- a/TAO/tao/Priority_Mapping.cpp +++ b/TAO/tao/Priority_Mapping.cpp @@ -2,7 +2,7 @@ #include "tao/orbconf.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/Priority_Mapping.h" @@ -34,4 +34,4 @@ TAO_Priority_Mapping::to_CORBA (RTCORBA::NativePriority, return 0; } -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/Priority_Mapping.h b/TAO/tao/Priority_Mapping.h index 141cceeae0b..6aeff91fc4b 100644 --- a/TAO/tao/Priority_Mapping.h +++ b/TAO/tao/Priority_Mapping.h @@ -22,7 +22,7 @@ #include "tao/orbconf.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/rtcorbafwd.h" @@ -58,6 +58,6 @@ public: # include "tao/Priority_Mapping.i" #endif /* __ACE_INLINE__ */ -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ #endif /* TAO_PRIORITY_MAPPING_H */ diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp index 1e0d585d599..8fb3afde951 100644 --- a/TAO/tao/Profile.cpp +++ b/TAO/tao/Profile.cpp @@ -9,6 +9,7 @@ ACE_RCSID(tao, Profile, "$Id$") + // **************************************************************** TAO_Profile::~TAO_Profile (void) diff --git a/TAO/tao/Protocol_Factory.h b/TAO/tao/Protocol_Factory.h index c803a1dd73f..bdbb310b9f6 100644 --- a/TAO/tao/Protocol_Factory.h +++ b/TAO/tao/Protocol_Factory.h @@ -1,7 +1,6 @@ // -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/RT_Current.cpp b/TAO/tao/RT_Current.cpp index 9917e641a36..f6d98af18c4 100644 --- a/TAO/tao/RT_Current.cpp +++ b/TAO/tao/RT_Current.cpp @@ -4,7 +4,7 @@ #include "tao/RT_Current.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/Stub.h" #include "tao/ORB_Core.h" @@ -99,4 +99,4 @@ TAO_RT_Current::the_priority ( ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); } -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/RT_Current.h b/TAO/tao/RT_Current.h index fe212468c8f..9ed7a96aca0 100644 --- a/TAO/tao/RT_Current.h +++ b/TAO/tao/RT_Current.h @@ -18,7 +18,7 @@ #include "tao/rtcorbafwd.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #include "tao/Exception.h" #include "tao/CurrentC.h" @@ -143,6 +143,6 @@ private: # include "tao/RT_Current.i" #endif /* __ACE_INLINE__ */ -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ #endif /* TAO_RT_CURRENT_H */ diff --git a/TAO/tao/Reactor_Per_Priority.cpp b/TAO/tao/Reactor_Per_Priority.cpp index e55729b3228..273901a85c8 100644 --- a/TAO/tao/Reactor_Per_Priority.cpp +++ b/TAO/tao/Reactor_Per_Priority.cpp @@ -42,8 +42,8 @@ TAO_Reactor_Per_Priority::reactor (void) { if (TAO_debug_level > 3) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Reactor_Per_Priority::reactor: " - " cannot get priority for this thread\n")); + ASYS_TEXT ("TAO (%P|%t) - Reactor_Per_Priority::reactor: ") + ASYS_TEXT (" cannot get priority for this thread\n"))); return 0; } @@ -108,7 +108,7 @@ TAO_Reactor_Per_Priority::leader_follower_i (CORBA::Short priority) { if (TAO_debug_level > 3) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - new priority %d\n", + ASYS_TEXT ("TAO (%P|%t) - new priority %d\n"), priority)); // The priority is new, create an entry in the table. ACE_NEW_RETURN (leader_follower, diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp index 8add1236a1a..16ffa9d0c3c 100644 --- a/TAO/tao/Reply_Dispatcher.cpp +++ b/TAO/tao/Reply_Dispatcher.cpp @@ -1,5 +1,6 @@ // $Id$ + #include "tao/Reply_Dispatcher.h" #include "tao/ORB_Core.h" #include "tao/Leader_Follower.h" @@ -86,7 +87,7 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status, } // If condition variable is present, then we are doing leader - // follower model. Do all the nessary things. + // follower model. Do all the necessary things. if (this->leader_follower_condition_variable_ != 0) { TAO_Leader_Follower& leader_follower = @@ -142,14 +143,17 @@ TAO_Synch_Reply_Dispatcher::leader_follower_condition_variable (TAO_Transport *t // Constructor. TAO_Asynch_Reply_Dispatcher::TAO_Asynch_Reply_Dispatcher (const TAO_Reply_Handler_Skeleton &reply_handler_skel, Messaging::ReplyHandler_ptr reply_handler_ptr) -: reply_handler_skel_ (reply_handler_skel), - reply_handler_ (reply_handler_ptr) + : reply_handler_skel_ (reply_handler_skel), + reply_handler_ (reply_handler_ptr), + transport_ (0) { } // Destructor. TAO_Asynch_Reply_Dispatcher::~TAO_Asynch_Reply_Dispatcher (void) { + if (this->transport_ != 0) + this->transport_->idle_after_reply (); } // Dispatch the reply. @@ -189,7 +193,7 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status, case TAO_GIOP_SYSTEM_EXCEPTION: reply_error = TAO_AMI_REPLY_SYSTEM_EXCEPTION; break; - default: + default: case TAO_GIOP_LOCATION_FORWARD: // @@ Michael: Not even the spec mentions this case. // We have to think about this case. @@ -238,16 +242,17 @@ TAO_Asynch_Reply_Dispatcher::message_state (void) #if !defined (TAO_HAS_MINIMUM_CORBA) // Constructor. -TAO_DII_Deferred_Reply_Dispatcher::TAO_DII_Deferred_Reply_Dispatcher ( - const CORBA::Request_ptr req - ) - : req_ (req) +TAO_DII_Deferred_Reply_Dispatcher::TAO_DII_Deferred_Reply_Dispatcher (const CORBA::Request_ptr req) + : req_ (req), + transport_ (0) { } // Destructor. TAO_DII_Deferred_Reply_Dispatcher::~TAO_DII_Deferred_Reply_Dispatcher (void) { + if (this->transport_ != 0) + this->transport_->idle_after_reply (); } // Dispatch the reply. @@ -307,4 +312,3 @@ TAO_DII_Deferred_Reply_Dispatcher::message_state (void) } #endif /* TAO_HAS_MINIMUM_CORBA */ - diff --git a/TAO/tao/Reply_Dispatcher.h b/TAO/tao/Reply_Dispatcher.h index ec7711d10ed..2073deabd74 100644 --- a/TAO/tao/Reply_Dispatcher.h +++ b/TAO/tao/Reply_Dispatcher.h @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY @@ -183,6 +182,9 @@ public: virtual TAO_GIOP_Message_State *message_state (void); // Return the message state. + void transport (TAO_Transport *t); + // Sets the transport for this invocation. + protected: IOP::ServiceContextList reply_service_info_; // The service context list @@ -208,6 +210,9 @@ private: Messaging::ReplyHandler_ptr reply_handler_; // Reply Handler passed in the Asynchronous Invocation. + + TAO_Transport *transport_; + // This invocation is using this transport, may change... }; # endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */ @@ -252,6 +257,9 @@ public: virtual TAO_GIOP_Message_State *message_state (void); // Return the message state. + void transport (TAO_Transport *t); + // Sets the transport for this invocation. + protected: IOP::ServiceContextList reply_service_info_; // The service context list @@ -274,6 +282,9 @@ private: const CORBA::Request_ptr req_; // Where the reply needs to go. + + TAO_Transport *transport_; + // This invocation is using this transport, may change... }; #endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/Reply_Dispatcher.i b/TAO/tao/Reply_Dispatcher.i index 647b8b802ae..ad5b11296ee 100644 --- a/TAO/tao/Reply_Dispatcher.i +++ b/TAO/tao/Reply_Dispatcher.i @@ -12,7 +12,9 @@ TAO_Synch_Reply_Dispatcher::version (void) const return this->version_; } -#if defined (TAO_HAS_CORBA_MESSAGING) && defined (TAO_POLLER) +#if (TAO_HAS_CORBA_MESSAGING == 1) + +# if (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1) ACE_INLINE CORBA::ULong TAO_Asynch_Reply_Dispatcher::reply_status (void) const @@ -20,13 +22,21 @@ TAO_Asynch_Reply_Dispatcher::reply_status (void) const return this->reply_status_; } -ACE_INLINE const TAO_GIOP_Version& +ACE_INLINE const TAO_GIOP_Version & TAO_Asynch_Reply_Dispatcher::version (void) const { return this->version_; } -#endif /* TAO_HAS_CORBA_MESSAGING && TAO_POLLER */ +ACE_INLINE void +TAO_Asynch_Reply_Dispatcher::transport (TAO_Transport *t) +{ + this->transport_ = t; +} + +# endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */ + +#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ //********************************************************************* @@ -44,5 +54,10 @@ TAO_DII_Deferred_Reply_Dispatcher::version (void) const return this->version_; } -#endif /* TAO_HAS_MINIMUM_CORBA */ +ACE_INLINE void +TAO_DII_Deferred_Reply_Dispatcher::transport (TAO_Transport *t) +{ + this->transport_ = t; +} +#endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/Request.cpp b/TAO/tao/Request.cpp index 41d2e492d63..3a713845a2c 100644 --- a/TAO/tao/Request.cpp +++ b/TAO/tao/Request.cpp @@ -1,5 +1,6 @@ // $Id$ + #include "tao/Request.h" #include "tao/GIOP_Utils.h" @@ -12,7 +13,6 @@ # include "tao/Request.i" #endif /* ! __ACE_INLINE__ */ - ACE_RCSID(tao, Request, "$Id$") @@ -85,7 +85,8 @@ CORBA_Request::CORBA_Request (CORBA::Object_ptr obj, contexts_ (0), ctx_ (0), refcount_ (1), - lazy_evaluation_ (0) + lazy_evaluation_ (0), + response_received_ (0) { target_ = CORBA::Object::_duplicate (obj); opname_ = CORBA::string_dup (op); @@ -162,7 +163,7 @@ CORBA_Request::send_deferred (CORBA::Environment &ACE_TRY_ENV) void CORBA_Request::get_response (CORBA::Environment &ACE_TRY_ENV) { - while (!this->response_received_ && this->orb_->work_pending ()) + while (!this->response_received_) { (void) this->orb_->perform_work (); } diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 57043e02811..199dd42e2ae 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -1,6 +1,7 @@ // $Id$ + // @ (#)iiopobj.cpp 1.9 95/11/04 // Copyright 1995 by Sun Microsystems Inc. // All Rights Reserved @@ -362,7 +363,7 @@ TAO_Stub::do_static_call (CORBA::Environment &ACE_TRY_ENV, call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -625,7 +626,7 @@ TAO_Stub::do_dynamic_call (const char *opname, call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -757,7 +758,7 @@ TAO_Stub::do_deferred_call (const CORBA::Request_ptr req, call.start (ACE_TRY_ENV); ACE_CHECK; - CORBA::Short flag = TAO::SYNC_WITH_TARGET; + CORBA::Short flag = 131; call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV); @@ -1154,8 +1155,13 @@ TAO_Stub::sync_strategy (void) scope == Messaging::SYNC_WITH_TARGET) return this->orb_core_->transport_sync_strategy (); - if (scope == Messaging::SYNC_NONE) - return this->orb_core_->none_sync_strategy (); + if (scope == Messaging::SYNC_NONE || + scope == Messaging::SYNC_EAGER_BUFFERING) + return this->orb_core_->eager_buffering_sync_strategy (); + + if (scope == Messaging::SYNC_DELAYED_BUFFERING) + return this->orb_core_->delayed_buffering_sync_strategy (); + } #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/Stub.i b/TAO/tao/Stub.i index 3399a0b1232..969882d3da2 100644 --- a/TAO/tao/Stub.i +++ b/TAO/tao/Stub.i @@ -12,7 +12,7 @@ TAO_Stub::set_profile_in_use_i (TAO_Profile *pfile) if (pfile && (pfile->_incr_refcnt () == 0)) { ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) unable to increment profile ref!\n"), + ASYS_TEXT ("(%P|%t) unable to increment profile ref!\n")), 0); } diff --git a/TAO/tao/Sync_Strategies.cpp b/TAO/tao/Sync_Strategies.cpp index 34e889b7e51..ecd56a9b6f3 100644 --- a/TAO/tao/Sync_Strategies.cpp +++ b/TAO/tao/Sync_Strategies.cpp @@ -2,6 +2,7 @@ // $Id$ + #include "tao/Sync_Strategies.h" #include "tao/Buffering_Constraint_Policy.h" @@ -30,10 +31,79 @@ TAO_Transport_Sync_Strategy::send (TAO_Transport &transport, #if (TAO_HAS_CORBA_MESSAGING == 1) ssize_t -TAO_None_Sync_Strategy::send (TAO_Transport &transport, - TAO_Stub &stub, - const ACE_Message_Block *message_block, - const ACE_Time_Value *max_wait_time) +TAO_Delayed_Buffering_Sync_Strategy::send (TAO_Transport &transport, + TAO_Stub &stub, + const ACE_Message_Block *mb, + const ACE_Time_Value *max_wait_time) +{ + ACE_Message_Block *message_block = + ACE_const_cast (ACE_Message_Block *, mb); + + ssize_t result = 0; + + // Get the message queue from the transport. + TAO_Transport_Buffering_Queue &buffering_queue = + transport.buffering_queue (); + + // Check if there are messages already in the queue. + if (!buffering_queue.is_empty ()) + return TAO_Eager_Buffering_Sync_Strategy::send (transport, + stub, + message_block, + max_wait_time); + + // + // Otherwise there were no queued messages. We first try to send + // the message right away. + // + + // Actual network send. + result = transport.send (message_block, + max_wait_time); + + // Cannot send. + if (result == -1 || + result == 0) + { + // Timeout. + if (errno == ETIME) + { + // Queue message. + return TAO_Eager_Buffering_Sync_Strategy::send (transport, + stub, + message_block, + max_wait_time); + } + + // Non-timeout error. + return -1; + } + + // If successful in sending some or all of the data, reset the + // message block appropriately. + transport.reset_sent_message (message_block, + result); + + // If there is still data left over, i.e., incomplete send, queue + // the rest. + if (message_block->total_length () != 0) + { + return result + + TAO_Eager_Buffering_Sync_Strategy::send (transport, + stub, + message_block, + max_wait_time); + } + + // Everything was successfully delivered. + return result; +} + +ssize_t +TAO_Eager_Buffering_Sync_Strategy::send (TAO_Transport &transport, + TAO_Stub &stub, + const ACE_Message_Block *message_block, + const ACE_Time_Value *max_wait_time) { ssize_t result = 0; @@ -47,7 +117,7 @@ TAO_None_Sync_Strategy::send (TAO_Transport &transport, // Enqueue current message. result = buffering_queue.enqueue_tail (copy); - // Enqueuing error. + // EnBuffering error. if (result == -1) { // Eliminate the copy. @@ -71,9 +141,9 @@ TAO_None_Sync_Strategy::send (TAO_Transport &transport, } int -TAO_None_Sync_Strategy::buffering_constraints_reached (TAO_Transport &transport, - TAO_Stub &stub, - TAO_Transport_Buffering_Queue &buffering_queue) +TAO_Eager_Buffering_Sync_Strategy::buffering_constraints_reached (TAO_Transport &transport, + TAO_Stub &stub, + TAO_Transport_Buffering_Queue &buffering_queue) { TAO_Buffering_Constraint_Policy *buffering_constraint_policy = stub.buffering_constraint (); @@ -104,8 +174,8 @@ TAO_None_Sync_Strategy::buffering_constraints_reached (TAO_Transport &transport, } void -TAO_None_Sync_Strategy::timer_check (TAO_Transport &transport, - const TAO::BufferingConstraint &buffering_constraint) +TAO_Eager_Buffering_Sync_Strategy::timer_check (TAO_Transport &transport, + const TAO::BufferingConstraint &buffering_constraint) { if (transport.buffering_timer_id () != 0) { @@ -163,7 +233,7 @@ TAO_None_Sync_Strategy::timer_check (TAO_Transport &transport, } ACE_Time_Value -TAO_None_Sync_Strategy::time_conversion (const TimeBase::TimeT &time) +TAO_Eager_Buffering_Sync_Strategy::time_conversion (const TimeBase::TimeT &time) { TimeBase::TimeT seconds = time / 10000000u; TimeBase::TimeT microseconds = (time % 10000000u) / 10; diff --git a/TAO/tao/Sync_Strategies.h b/TAO/tao/Sync_Strategies.h index 028fa194df2..13fa2ab65fa 100644 --- a/TAO/tao/Sync_Strategies.h +++ b/TAO/tao/Sync_Strategies.h @@ -52,7 +52,7 @@ public: #if (TAO_HAS_CORBA_MESSAGING == 1) -class TAO_Export TAO_None_Sync_Strategy : public TAO_Sync_Strategy +class TAO_Export TAO_Eager_Buffering_Sync_Strategy : public TAO_Sync_Strategy { public: ssize_t send (TAO_Transport &transport, @@ -70,6 +70,15 @@ public: ACE_Time_Value time_conversion (const TimeBase::TimeT &time); }; +class TAO_Export TAO_Delayed_Buffering_Sync_Strategy : public TAO_Eager_Buffering_Sync_Strategy +{ +public: + ssize_t send (TAO_Transport &transport, + TAO_Stub &stub, + const ACE_Message_Block *message_block, + const ACE_Time_Value *max_wait_time); +}; + #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ #if defined (__ACE_INLINE__) diff --git a/TAO/tao/TAO.cpp b/TAO/tao/TAO.cpp index 0930f9b9291..2b762d43364 100644 --- a/TAO/tao/TAO.cpp +++ b/TAO/tao/TAO.cpp @@ -64,7 +64,7 @@ TAO_ORB_Manager::init (int &argc, if (CORBA::is_nil (poa_object.in ())) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), + ASYS_TEXT (" (%P|%t) Unable to initialize the POA.\n")), -1); // Get the POA object. @@ -118,7 +118,7 @@ TAO_ORB_Manager::init_child_poa (int& argc, if (init_result == -1) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Error in init.\n"), + ASYS_TEXT (" (%P|%t) Error in init.\n")), -1); // Create the default policies - user-supplied ID, and persistent @@ -224,8 +224,8 @@ TAO_ORB_Manager::activate_under_child_poa (const char* object_name, { if (object_name == 0) ACE_ERROR_RETURN ((LM_ERROR, - "\n(%P|%t) TAO_ORB_Manager::register: " - "object_name is null!"), + ASYS_TEXT ("\n(%P|%t) TAO_ORB_Manager::register: ") + ASYS_TEXT ("object_name is null!")), 0); PortableServer::ObjectId_var id = @@ -282,8 +282,8 @@ TAO_ORB_Manager::run (CORBA_Environment &ACE_TRY_ENV, if (status == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) TAO_ORB_Manager %p\n", - "run"), + ASYS_TEXT ("(%P|%t) TAO_ORB_Manager %p\n"), + ASYS_TEXT ("run")), -1); return 0; } @@ -300,8 +300,8 @@ TAO_ORB_Manager::run (ACE_Time_Value &tv, if (status == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) TAO_ORB_Manager %p\n", - "run"), + ASYS_TEXT ("(%P|%t) TAO_ORB_Manager %p\n"), + ASYS_TEXT ("run")), -1); return 0; } @@ -317,8 +317,8 @@ TAO_ORB_Manager::run (CORBA_Environment &ACE_TRY_ENV) if (status == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) TAO_ORB_Manager %p\n", - "run"), + ASYS_TEXT ("(%P|%t) TAO_ORB_Manager %p\n"), + ASYS_TEXT ("run")), -1); return 0; } diff --git a/TAO/tao/TAOC.cpp b/TAO/tao/TAOC.cpp index 5481a52e65a..c1bd4f02bf0 100644 --- a/TAO/tao/TAOC.cpp +++ b/TAO/tao/TAOC.cpp @@ -1,5 +1,6 @@ /* -*- C++ -*- $Id$ */ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/TAOC.i b/TAO/tao/TAOC.i index 7ae034a1c5a..cc0e7b01748 100644 --- a/TAO/tao/TAOC.i +++ b/TAO/tao/TAOC.i @@ -11,7 +11,7 @@ // Inline operations for class TAO::PrioritySpecification_var // ************************************************************* -#if defined (TAO_HAS_CORBA_MESSAGING) +#if (TAO_HAS_CORBA_MESSAGING == 1) ACE_INLINE TAO::PrioritySpecification_var::PrioritySpecification_var (void) // default constructor @@ -655,4 +655,4 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, TAO::BufferingConstrai } -#endif /* TAO_HAS_CORBA_MESSAGING */ +#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/TAOS.cpp b/TAO/tao/TAOS.cpp index e04923885cd..0e5e142d52d 100644 --- a/TAO/tao/TAOS.cpp +++ b/TAO/tao/TAOS.cpp @@ -1,5 +1,6 @@ /* -*- C++ -*- $Id$ */ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/TAOS.h b/TAO/tao/TAOS.h index e4099dd5f00..0485ef30c6c 100644 --- a/TAO/tao/TAOS.h +++ b/TAO/tao/TAOS.h @@ -1,6 +1,5 @@ /* -*- C++ -*- $Id$ */ - // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO and the TAO IDL Compiler have been developed by the Center for // Distributed Object Computing at Washington University, St. Louis. diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp index f8c9fa6b402..2a714a82e4f 100644 --- a/TAO/tao/TAO_Internal.cpp +++ b/TAO/tao/TAO_Internal.cpp @@ -1,6 +1,7 @@ // $Id$ + #include "tao/TAO_Internal.h" #include "ace/Service_Config.h" #include "ace/Service_Repository.h" @@ -11,10 +12,8 @@ #include "tao/IIOP_Factory.h" #include "tao/UIOP_Factory.h" - ACE_RCSID(tao, TAO_Internal, "$Id$") - int TAO_Internal::service_open_count_ = 0; #if defined (TAO_PLATFORM_SVC_CONF_FILE_NOTSUP) const char *TAO_Internal::resource_factory_args_ = TAO_DEFAULT_RESOURCE_FACTORY_ARGS; diff --git a/TAO/tao/Tagged_Components.h b/TAO/tao/Tagged_Components.h index 7439943316f..75f6ea26068 100644 --- a/TAO/tao/Tagged_Components.h +++ b/TAO/tao/Tagged_Components.h @@ -100,6 +100,11 @@ public: int decode (TAO_InputCDR& cdr); // Marshal and demarshal the list. + IOP::MultipleComponentProfile &components (void); + // Read/Write access to the underlying + // MutipleComponentProfile. Added by request from Chris Hafey + // <chris@stentorsoft.com> + private: void set_code_sets_i (CONV_FRAME::CodeSetComponent &lhs, CONV_FRAME::CodeSetComponent &rhs); diff --git a/TAO/tao/Tagged_Components.i b/TAO/tao/Tagged_Components.i index 6f5f7e6d95b..da5b23331ba 100644 --- a/TAO/tao/Tagged_Components.i +++ b/TAO/tao/Tagged_Components.i @@ -79,3 +79,9 @@ TAO_Tagged_Components::unique_tag (IOP::ComponentId tag) const || tag == IOP::TAG_DCE_NO_PIPES || tag == IOP::TAG_DCE_SEC_MECH); } + +ACE_INLINE IOP::MultipleComponentProfile& +TAO_Tagged_Components::components (void) +{ + return this->components_; +} diff --git a/TAO/tao/TimeBaseC.h b/TAO/tao/TimeBaseC.h index c05e300be1a..fb940cf5861 100644 --- a/TAO/tao/TimeBaseC.h +++ b/TAO/tao/TimeBaseC.h @@ -2,6 +2,7 @@ // // $Id$ + // // ================================================================ // diff --git a/TAO/tao/Transport_Mux_Strategy.cpp b/TAO/tao/Transport_Mux_Strategy.cpp index 7d837cc2540..c970eb78765 100644 --- a/TAO/tao/Transport_Mux_Strategy.cpp +++ b/TAO/tao/Transport_Mux_Strategy.cpp @@ -84,7 +84,7 @@ TAO_Exclusive_TMS::dispatch_reply (CORBA::ULong request_id, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Exclusive_TMS::dispatch_reply - <%d != %d>\n", + ASYS_TEXT ("TAO_Exclusive_TMS::dispatch_reply - <%d != %d>\n"), this->request_id_, request_id)); return 0; } @@ -131,14 +131,14 @@ TAO_Exclusive_TMS::idle_after_send (void) return 0; } -// int -// TAO_Exclusive_TMS::idle_after_reply (void) -// { -// if (this->transport_ != 0) -// return this->transport_->idle (); -// -// return 0; -// } +int +TAO_Exclusive_TMS::idle_after_reply (void) +{ + if (this->transport_ != 0) + return this->transport_->idle (); + + return 0; +} // int // TAO_Exclusive_TMS::reply_received (const CORBA::ULong request_id) @@ -203,8 +203,8 @@ TAO_Muxed_TMS::bind_dispatcher (CORBA::ULong request_id, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "(%P | %t):TAO_Muxed_TMS::bind_dispatcher: " - "bind dispatcher failed: result = %d\n", + ASYS_TEXT ("(%P | %t):TAO_Muxed_TMS::bind_dispatcher: ") + ASYS_TEXT ("bind dispatcher failed: result = %d\n"), result)); return -1; @@ -236,8 +236,8 @@ TAO_Muxed_TMS::dispatch_reply (CORBA::ULong request_id, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "(%P | %t):TAO_Muxed_TMS::dispatch_reply: " - "unbind dispatcher failed: result = %d\n", + ASYS_TEXT ("(%P | %t):TAO_Muxed_TMS::dispatch_reply: ") + ASYS_TEXT ("unbind dispatcher failed: result = %d\n"), result)); return -1; @@ -288,11 +288,12 @@ TAO_Muxed_TMS::idle_after_send (void) return 0; } -// int -// TAO_Muxed_TMS::idle_after_reply (void) -// { -// return 0; -// } +int +TAO_Muxed_TMS::idle_after_reply (void) +{ + // No op. + return 0; +} // int // TAO_Muxed_TMS::reply_received (const CORBA::ULong request_id) diff --git a/TAO/tao/Transport_Mux_Strategy.h b/TAO/tao/Transport_Mux_Strategy.h index c75693fb6dc..1bb7b57fe49 100644 --- a/TAO/tao/Transport_Mux_Strategy.h +++ b/TAO/tao/Transport_Mux_Strategy.h @@ -85,7 +85,7 @@ public: // Request has been just sent, but the reply is not received. Idle // the transport now. - // virtual int idle_after_reply (void) = 0; + virtual int idle_after_reply (void) = 0; // Request is sent and the reply is received. Idle the transport // now. @@ -143,7 +143,7 @@ public: // Request has been just sent, but the reply is not received. Idle // the transport now. - // virtual int idle_after_reply (void); + virtual int idle_after_reply (void); // Request is sent and the reply is received. Idle the transport // now. @@ -211,7 +211,7 @@ public: // Request has been just sent, but the reply is not received. Idle // the transport now. - // virtual int idle_after_reply (void); + virtual int idle_after_reply (void); // Request is sent and the reply is received. Idle the transport // now. diff --git a/TAO/tao/Typecode.cpp b/TAO/tao/Typecode.cpp index da72eb2e871..e62bace6906 100644 --- a/TAO/tao/Typecode.cpp +++ b/TAO/tao/Typecode.cpp @@ -1943,8 +1943,8 @@ CORBA_TypeCode::private_member_label (CORBA::ULong n, || !stream.read_ulong (member_count)) // member count { ACE_DEBUG ((LM_DEBUG, - "TypeCode::private_member_label -- " - "error reading from stream")); + ASYS_TEXT ("TypeCode::private_member_label -- ") + ASYS_TEXT ("error reading from stream"))); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), 0); } @@ -2018,8 +2018,8 @@ CORBA_TypeCode::private_member_label (CORBA::ULong n, { if (TAO_debug_level > 0) ACE_ERROR ((LM_ERROR, - "TypeCode::private_member_label " - "error getting typecode for member %d\n", + ASYS_TEXT ("TypeCode::private_member_label ") + ASYS_TEXT ("error getting typecode for member %d\n"), i)); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), 0); diff --git a/TAO/tao/Typecode_Constants.cpp b/TAO/tao/Typecode_Constants.cpp index 35f12d687cc..3260e382e46 100644 --- a/TAO/tao/Typecode_Constants.cpp +++ b/TAO/tao/Typecode_Constants.cpp @@ -1,6 +1,7 @@ // $Id$ + // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp index f332fe9aea6..1a5370a9ed8 100644 --- a/TAO/tao/UIOP_Acceptor.cpp +++ b/TAO/tao/UIOP_Acceptor.cpp @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/UIOP_Acceptor.h b/TAO/tao/UIOP_Acceptor.h index 170ab0f8f7e..be692275ff5 100644 --- a/TAO/tao/UIOP_Acceptor.h +++ b/TAO/tao/UIOP_Acceptor.h @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h index 6bcc5c93cd9..ded4083ae74 100644 --- a/TAO/tao/UIOP_Connect.h +++ b/TAO/tao/UIOP_Connect.h @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/UIOP_Connect.i b/TAO/tao/UIOP_Connect.i index 5747a3bb451..a609f80ae7c 100644 --- a/TAO/tao/UIOP_Connect.i +++ b/TAO/tao/UIOP_Connect.i @@ -1,7 +1,7 @@ // -*- C++ -*- // $Id$ -#if defined (TAO_HAS_UIOP) +#if TAO_HAS_UIOP == 1 ACE_INLINE TAO_Transport * TAO_UIOP_Server_Connection_Handler::transport (void) @@ -15,4 +15,4 @@ TAO_UIOP_Client_Connection_Handler::transport (void) return &(this->transport_); } -#endif /* TAO_HAS_UIOP */ +#endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Connector.cpp b/TAO/tao/UIOP_Connector.cpp index 2b0ed09fc6a..e0858532f94 100644 --- a/TAO/tao/UIOP_Connector.cpp +++ b/TAO/tao/UIOP_Connector.cpp @@ -1,6 +1,7 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ + #include "tao/UIOP_Connector.h" #if TAO_HAS_UIOP == 1 @@ -11,7 +12,6 @@ #include "tao/Environment.h" #include "ace/Auto_Ptr.h" - ACE_RCSID(tao, UIOP_Connector, "$Id$") diff --git a/TAO/tao/UIOP_Connector.h b/TAO/tao/UIOP_Connector.h index 746404a50dc..06f4ff8ddaa 100644 --- a/TAO/tao/UIOP_Connector.h +++ b/TAO/tao/UIOP_Connector.h @@ -27,7 +27,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -# if defined (TAO_HAS_UIOP) +# if TAO_HAS_UIOP == 1 #include "ace/Connector.h" #include "ace/LSOCK_Connector.h" @@ -203,6 +203,6 @@ private: }; -# endif /* TAO_HAS_UIOP */ +# endif /* TAO_HAS_UIOP == 1 */ #endif /* TAO_UIOP_CONNECTOR_H */ diff --git a/TAO/tao/UIOP_Factory.cpp b/TAO/tao/UIOP_Factory.cpp index f5fc3e5b583..09fc3875bed 100644 --- a/TAO/tao/UIOP_Factory.cpp +++ b/TAO/tao/UIOP_Factory.cpp @@ -3,7 +3,7 @@ #include "tao/UIOP_Factory.h" -#if defined (TAO_HAS_UIOP) +#if TAO_HAS_UIOP == 1 #include "tao/UIOP_Acceptor.h" #include "tao/UIOP_Connector.h" @@ -69,6 +69,7 @@ TAO_UIOP_Protocol_Factory::make_connector (void) ACE_NEW_RETURN (connector, TAO_UIOP_Connector, 0); + return connector; } @@ -89,4 +90,4 @@ ACE_STATIC_SVC_DEFINE (TAO_UIOP_Protocol_Factory, ACE_FACTORY_DEFINE (TAO, TAO_UIOP_Protocol_Factory) -#endif /* TAO_HAS_UIOP */ +#endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Factory.h b/TAO/tao/UIOP_Factory.h index 17b5e1d8f40..aa79e57a1af 100644 --- a/TAO/tao/UIOP_Factory.h +++ b/TAO/tao/UIOP_Factory.h @@ -6,7 +6,7 @@ // TAO // // = FILENAME -// Protocol_Factory.h +// UIOP_Factory.h // // = AUTHOR // Fred Kuhns <fredk@cs.wustl.edu> @@ -19,7 +19,7 @@ #include "tao/Protocol_Factory.h" -# if defined (TAO_HAS_UIOP) +# if TAO_HAS_UIOP == 1 #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -64,6 +64,6 @@ private: ACE_STATIC_SVC_DECLARE (TAO_UIOP_Protocol_Factory) ACE_FACTORY_DECLARE (TAO, TAO_UIOP_Protocol_Factory) -# endif /* TAO_HAS_UIOP */ +# endif /* TAO_HAS_UIOP == 1 */ #endif /* TAO_UIOP_FACTORY_H */ diff --git a/TAO/tao/UIOP_Profile.cpp b/TAO/tao/UIOP_Profile.cpp index c3e0c7e3431..c1b7d861181 100644 --- a/TAO/tao/UIOP_Profile.cpp +++ b/TAO/tao/UIOP_Profile.cpp @@ -15,7 +15,6 @@ ACE_RCSID(tao, UIOP_Profile, "$Id$") - #if !defined (__ACE_INLINE__) # include "tao/UIOP_Profile.i" #endif /* __ACE_INLINE__ */ @@ -299,19 +298,24 @@ TAO_UIOP_Profile::decode (TAO_InputCDR& cdr) // profiles whose versions we don't understand. // FIXME: Version question again, what do we do about them for this // protocol? + CORBA::Octet major, minor; - if (!(cdr.read_octet (this->version_.major) - && this->version_.major == TAO_DEF_GIOP_MAJOR - && cdr.read_octet (this->version_.minor) - && this->version_.minor <= TAO_DEF_GIOP_MINOR)) + if (!(cdr.read_octet (major) + && (major == TAO_DEF_GIOP_MAJOR) + && cdr.read_octet (minor))) { ACE_DEBUG ((LM_DEBUG, "detected new v%d.%d UIOP profile\n", - this->version_.major, - this->version_.minor)); + major, + minor)); return -1; } + this->version_.major = major; + + if (minor <= TAO_DEF_GIOP_MINOR) + this->version_.minor = minor; + char *rendezvous = 0; // Get rendezvous_point diff --git a/TAO/tao/UIOP_Profile.i b/TAO/tao/UIOP_Profile.i index 6c6f41c1fd2..04e3cb9859c 100644 --- a/TAO/tao/UIOP_Profile.i +++ b/TAO/tao/UIOP_Profile.i @@ -1,7 +1,7 @@ // -*- C++ -*- // $Id$ -# if defined (TAO_HAS_UIOP) +# if TAO_HAS_UIOP == 1 ACE_INLINE const TAO_ObjectKey & TAO_UIOP_Profile::object_key (void) const @@ -52,4 +52,4 @@ TAO_UIOP_Profile::hint (void) return this->hint_; } -#endif /* TAO_HAS_UIOP */ +#endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Transport.cpp b/TAO/tao/UIOP_Transport.cpp index cb6629796e6..f1fcb8164c3 100644 --- a/TAO/tao/UIOP_Transport.cpp +++ b/TAO/tao/UIOP_Transport.cpp @@ -2,6 +2,7 @@ // $Id$ + #include "tao/UIOP_Transport.h" #if TAO_HAS_UIOP == 1 @@ -84,7 +85,7 @@ TAO_UIOP_Transport::handler (void) int TAO_UIOP_Transport::idle (void) { - return this->handler_->idle(); + return this->handler_->idle (); } void diff --git a/TAO/tao/UIOP_Transport.h b/TAO/tao/UIOP_Transport.h index 3f97b41970a..f9b6cc66112 100644 --- a/TAO/tao/UIOP_Transport.h +++ b/TAO/tao/UIOP_Transport.h @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/ValueBase.cpp b/TAO/tao/ValueBase.cpp index 188466baca0..6037f7bb9c3 100644 --- a/TAO/tao/ValueBase.cpp +++ b/TAO/tao/ValueBase.cpp @@ -134,7 +134,7 @@ CORBA_ValueBase::_tao_unmarshal (TAO_InputCDR &, // new_object->_tao_unmarshal_v () // new_object->_tao_unmarshal_post () - ACE_DEBUG ((LM_DEBUG, "unimpl. CORBA::ValueBase::_tao_unmarshal\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("unimpl. CORBA::ValueBase::_tao_unmarshal\n"))); return 0; // %! } @@ -177,7 +177,7 @@ CORBA_ValueBase::_tao_unmarshal_pre (TAO_InputCDR &strm, if (!TAO_OBV_GIOP_Flags::is_value_tag (value_tag)) { - ACE_DEBUG ((LM_DEBUG, "!CORBA::ValueBase::_tao_unmarshal_pre not value_tag\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("!CORBA::ValueBase::_tao_unmarshal_pre not value_tag\n"))); return 0; } @@ -200,7 +200,7 @@ CORBA_ValueBase::_tao_unmarshal_pre (TAO_InputCDR &strm, ->lookup_value_factory (repo_id_stream.in()); if (factory == 0) // %! except.! { - ACE_DEBUG ((LM_ERROR, "(%N:%l) OBV factory is null !!!\n")); + ACE_DEBUG ((LM_ERROR, ASYS_TEXT ("(%N:%l) OBV factory is null !!!\n"))); return 0; } diff --git a/TAO/tao/Version.h b/TAO/tao/Version.h index a04172ca56e..6eab39df02c 100644 --- a/TAO/tao/Version.h +++ b/TAO/tao/Version.h @@ -3,5 +3,5 @@ #define TAO_MAJOR_VERSION 1 #define TAO_MINOR_VERSION 0 -#define TAO_BETA_VERSION 9 -#define TAO_VERSION "1.0.9" +#define TAO_BETA_VERSION 13 +#define TAO_VERSION "1.0.13" diff --git a/TAO/tao/Wait_Strategy.cpp b/TAO/tao/Wait_Strategy.cpp index 4e0a4365ea4..9ad209b0a2e 100644 --- a/TAO/tao/Wait_Strategy.cpp +++ b/TAO/tao/Wait_Strategy.cpp @@ -55,15 +55,28 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, this->transport_->orb_core ()->reactor (); // Do the event loop, till we fully receive a reply. - - int result = 1; // Optimize the first iteration [no access to errno] - while (reply_received == 0 - && (result > 0 - || (result == 0 - && max_wait_time != 0 - && *max_wait_time != ACE_Time_Value::zero))) + int result = 0; + while (1) { + // Run the event loop. result = reactor->handle_events (max_wait_time); + + // If we got our reply, no need to run the event loop any + // further. + if (reply_received) + break; + + // Did we timeout? If so, stop running the loop. + if (result == 0 && + max_wait_time != 0 && + *max_wait_time == ACE_Time_Value::zero) + break; + + // Other errors? If so, stop running the loop. + if (result == -1) + break; + + // Otherwise, keep going... } if (result == -1 || reply_received == -1) @@ -158,7 +171,7 @@ TAO_Exclusive_Wait_On_Leader_Follower::~TAO_Exclusive_Wait_On_Leader_Follower (v // at this level since this is common for AMI also. (Alex). int TAO_Exclusive_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, - int two_way) + int two_way) { { ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, @@ -174,7 +187,7 @@ TAO_Exclusive_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, this->calling_thread_ = ACE_Thread::self (); if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - sending request for <%x>\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("TAO (%P|%t) - sending request for <%x>\n"), this->transport_)); } @@ -217,186 +230,213 @@ TAO_Exclusive_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, leader_follower.lock (), -1); - leader_follower.set_client_thread (); - - ACE_Countdown_Time countdown (max_wait_time); + int result = 0; - // Check if there is a leader, but the leader is not us - if (leader_follower.leader_available () - && !leader_follower.is_leader_thread ()) - { - // = Wait as a follower. - - // wait until we have input available or there is no leader, in - // which case we must become the leader anyway.... - // @@ Alex: I am uncertain about how many condition variables - // should we have, should there be one-per-thread (after all - // the thread blocks on the condition variable) or there - // should be one per-connection. I think the first case is - // the "Right Thing"[tm] - ACE_SYNCH_CONDITION* cond = - this->cond_response_available (); + // + // Begin artificial scope for auto_ptr like helpers calling: + // leader_follower.set_client_thread () and (maybe later on) + // leader_follower.set_client_leader_thread (). + // + { + // Calls leader_follower.set_client_thread () on construction and + // leader_follower.reset_client_thread () on destruction. + TAO_LF_Client_Thread_Helper client_thread_helper (leader_follower); + ACE_UNUSED_ARG (client_thread_helper); + + ACE_Countdown_Time countdown (max_wait_time); + + // Check if there is a leader. Note that it cannot be us since we + // gave up our leadership when we became a client. + if (leader_follower.leader_available ()) + { + // = Wait as a follower. + + // wait until we have input available or there is no leader, in + // which case we must become the leader anyway.... + // @@ Alex: I am uncertain about how many condition variables + // should we have, should there be one-per-thread (after all + // the thread blocks on the condition variable) or there + // should be one per-connection. I think the first case is + // the "Right Thing"[tm] + ACE_SYNCH_CONDITION* cond = + this->cond_response_available (); #if defined (TAO_DEBUG_LEADER_FOLLOWER) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t): TAO_Wait_On_LF::wait - " - "(follower) on <%x>\n", - cond)); + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t): TAO_Wait_On_LF::wait - " + "(follower) on <%x>\n", + cond)); #endif /* TAO_DEBUG_LEADER_FOLLOWER */ - while (!this->reply_received_ - && leader_follower.leader_available ()) - { - // Add to the follower set, that operation will if the - // condition variable returns due to an spurious wake up - // (i.e. a wait interrupted by the OS) but otherwise we risk - // dead-locks: - // Assume that we are the only follower, another thread is - // the leader and it completes its work, it sends us the - // signal and removes us from the set. - // Before waking up another thread becomes the leader, when - // we do wake up we believe that it was a false return from - // the condition variable and go into the loop again. - // But now the follower set is empty and nobody is ever - // going to wake us up, dead-locking the application. - - if (leader_follower.add_follower (cond) == -1) - { - // -1 indicates a severe problem, like running out of - // memory, the comment above does not apply in this - // case. - return -1; - } + while (!this->reply_received_ + && leader_follower.leader_available ()) + { + // Add to the follower set, that operation will if the + // condition variable returns due to an spurious wake up + // (i.e. a wait interrupted by the OS) but otherwise we + // risk dead-locks: + // Assume that we are the only follower, another thread + // is the leader and it completes its work, it sends us + // the signal and removes us from the set. Before + // waking up another thread becomes the leader, when we + // do wake up we believe that it was a false return from + // the condition variable and go into the loop again. + // But now the follower set is empty and nobody is ever + // going to wake us up, dead-locking the application. + + if (leader_follower.add_follower (cond) == -1) + { + // -1 indicates a severe problem, like running out of + // memory, the comment above does not apply in this + // case. + return -1; + } #if defined (TAO_DEBUG_LEADER_FOLLOWER) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t): TAO_Wait_On_LF::wait - " - "waiting in follower <%x>\n", - cond)); + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t): TAO_Wait_On_LF::wait - " + "waiting in follower <%x>\n", + cond)); #endif /* TAO_DEBUG_LEADER_FOLLOWER */ - if (max_wait_time == 0) - { - if (cond == 0 || cond->wait () == -1) - return -1; - } - else - { - countdown.update (); - ACE_Time_Value tv = ACE_OS::gettimeofday (); - tv += *max_wait_time; - if (cond == 0 || cond->wait (&tv) == -1) - return -1; - } - } + if (max_wait_time == 0) + { + if (cond == 0 || cond->wait () == -1) + return -1; + } + else + { + countdown.update (); + ACE_Time_Value tv = ACE_OS::gettimeofday (); + tv += *max_wait_time; + if (cond == 0 || cond->wait (&tv) == -1) + return -1; + } + } - countdown.update (); + countdown.update (); #if defined (TAO_DEBUG_LEADER_FOLLOWER) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t): TAO_Wait_On_LF::wait - " - "done (follower:%d) on <%x>\n", - this->reply_received_, cond)); + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t): TAO_Wait_On_LF::wait - " + "done (follower:%d) on <%x>\n", + this->reply_received_, cond)); #endif /* TAO_DEBUG_LEADER_FOLLOWER */ - // Now somebody woke us up to become a leader or to handle - // our input. We are already removed from the follower queue. - if (this->reply_received_ == 1) - { - // But first reset our state in case we are invoked - // again... - this->reply_received_ = 0; - this->expecting_response_ = 0; - this->calling_thread_ = ACE_OS::NULL_thread; - - leader_follower.reset_client_thread (); - - return 0; - } - else if (this->reply_received_ == -1) - { - // But first reset our state in case we are invoked - // again... - this->reply_received_ = 0; - this->expecting_response_ = 0; - this->calling_thread_ = ACE_OS::NULL_thread; + // Now somebody woke us up to become a leader or to handle our + // input. We are already removed from the follower queue. + if (this->reply_received_ == 1) + { + // But first reset our state in case we are invoked + // again... + this->reply_received_ = 0; + this->expecting_response_ = 0; + this->calling_thread_ = ACE_OS::NULL_thread; + + return 0; + } + else if (this->reply_received_ == -1) + { + // But first reset our state in case we are invoked + // again... + this->reply_received_ = 0; + this->expecting_response_ = 0; + this->calling_thread_ = ACE_OS::NULL_thread; + + return -1; + } + // FALLTHROUGH + // We only get here if we woke up but the reply is not + // complete yet, time to assume the leader role.... + // i.e. ACE_ASSERT (this->reply_received_ == 0); + } + + // = Leader Code. + + // The only way to reach this point is if we must become the + // leader, because there is no leader or we have to update to a + // leader or we are doing nested upcalls in this case we do + // increase the refcount on the leader in TAO_ORB_Core. + + // Calls leader_follower.set_client_leader_thread () on + // construction and leader_follower.reset_client_leader_thread () + // on destruction. Note that this may increase the refcount of + // the leader. + TAO_LF_Client_Leader_Thread_Helper client_leader_thread_helper (leader_follower); + ACE_UNUSED_ARG (client_leader_thread_helper); - leader_follower.reset_client_thread (); - - return -1; - } - // FALLTHROUGH - // We only get here if we woke up but the reply is not complete - // yet, time to assume the leader role.... - // i.e. ACE_ASSERT (this->reply_received_ == 0); - - } - - // = Leader Code. + { + ACE_GUARD_RETURN (ACE_Reverse_Lock<ACE_SYNCH_MUTEX>, rev_mon, + leader_follower.reverse_lock (), -1); - // The only way to reach this point is if we must become the leader, - // because there is no leader or we have to update to a leader or we - // are doing nested upcalls in this case we do increase the refcount - // on the leader in TAO_ORB_Core. + // @@ Do we need to do this? + // Become owner of the reactor. + orb_core->reactor ()->owner (ACE_Thread::self ()); - // This might increase the refcount of the leader. - leader_follower.set_leader_thread (); + // Run the reactor event loop. - int result = 1; // Optmize the first iteration [no access to errno] +#if defined (TAO_DEBUG_LEADER_FOLLOWER) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t): TAO_Wait_On_LF::wait - " + "wait (leader) on <%x>\n", + this->transport_)); +#endif /* TAO_DEBUG_LEADER_FOLLOWER */ - { - ACE_GUARD_RETURN (ACE_Reverse_Lock<ACE_SYNCH_MUTEX>, rev_mon, - leader_follower.reverse_lock (), -1); + while (1) + { + // Run the event loop. + result = orb_core->reactor ()->handle_events (max_wait_time); - // @@ Do we need to do this? - // Become owner of the reactor. - orb_core->reactor ()->owner (ACE_Thread::self ()); + // If we got our reply, no need to run the event loop any + // further. + if (this->reply_received_) + break; - // Run the reactor event loop. + // Did we timeout? If so, stop running the loop. + if (result == 0 && + max_wait_time != 0 && + *max_wait_time == ACE_Time_Value::zero) + break; -#if defined (TAO_DEBUG_LEADER_FOLLOWER) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t): TAO_Wait_On_LF::wait - " - "wait (leader) on <%x>\n", - this->transport_)); -#endif /* TAO_DEBUG_LEADER_FOLLOWER */ + // Other errors? If so, stop running the loop. + if (result == -1) + break; - while (this->reply_received_ == 0 - && (result > 0 - || (result == 0 - && max_wait_time != 0 - && *max_wait_time != ACE_Time_Value::zero))) - result = orb_core->reactor ()->handle_events (max_wait_time); + // Otherwise, keep going... + } #if defined (TAO_DEBUG_LEADER_FOLLOWER) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t): TAO_Wait_On_LF::wait - " - "done (leader) on <%x>\n", - this->transport_)); + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t): TAO_Wait_On_LF::wait - " + "done (leader) on <%x>\n", + this->transport_)); #endif /* TAO_DEBUG_LEADER_FOLLOWER */ + } } + // + // End artificial scope for auto_ptr like helpers calling: + // leader_follower.reset_client_thread () and (maybe) + // leader_follower.reset_client_leader_thread (). + // // Wake up the next leader, we cannot do that in handle_input, - // because the woken up thread would try to get into - // handle_events, which is at the time in handle_input still - // occupied. But do it before checking the error in <result>, even - // if there is an error in our input we should continue running the - // loop in another thread. - - leader_follower.reset_leader_thread (); - leader_follower.reset_client_thread (); + // because the woken up thread would try to get into handle_events, + // which is at the time in handle_input still occupied. But do it + // before checking the error in <result>, even if there is an error + // in our input we should continue running the loop in another + // thread. if (leader_follower.elect_new_leader () == -1) ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t): TAO_Wait_On_LF::wait - " - "Failed to unset the leader and wake up a " - "new follower.\n"), + ASYS_TEXT ("TAO (%P|%t): TAO_Wait_On_LF::wait - ") + ASYS_TEXT ("Failed to unset the leader and wake up a ") + ASYS_TEXT ("new follower.\n")), -1); if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t): TAO_Wait_On_LF::wait - " - "handle_events failed.\n"), + ASYS_TEXT ("TAO (%P|%t): TAO_Wait_On_LF::wait: %p.\n"), + ASYS_TEXT ("handle_events failed")), -1); // Return an error if there was a problem receiving the reply... @@ -446,15 +486,28 @@ TAO_Exclusive_Wait_On_Leader_Follower::handle_input (void) // error, but we should do more.... // @@ Alex: this could be a CloseConnection message or something // similar, has to be handled... + + // + // The following check is conflicting with the ability to buffer + // asynchronous calls. If we mark the asynchronous call as a twoway + // call, then buffering cannot take place. If we mark it as a + // oneway call, then the following check fails. For now I have + // selected to disable the check. The long term fix is to separate + // out the two concerns (a) can the call be buffered and (b) are we + // expecting a response. + // + + /* if (!this->expecting_response_) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Wait_On_LF::handle_input, " - "unexpected on <%x>\n", + ASYS_TEXT ("TAO (%P|%t) - Wait_On_LF::handle_input, ") + ASYS_TEXT ("unexpected on <%x>\n"), this->transport_)); return -1; } + */ // Receive any data that is available, without blocking... int result = this->transport_->handle_client_input (0); @@ -468,8 +521,8 @@ TAO_Exclusive_Wait_On_Leader_Follower::handle_input (void) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Wait_On_LF::handle_input, " - "handle_client_input == -1\n")); + ASYS_TEXT ("TAO (%P|%t) - Wait_On_LF::handle_input, ") + ASYS_TEXT ("handle_client_input == -1\n"))); this->reply_received_ = -1; } @@ -595,159 +648,196 @@ TAO_Muxed_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, leader_follower.lock (), -1); - leader_follower.set_client_thread (); + // Optmize the first iteration [no access to errno] + int result = 1; - ACE_Countdown_Time countdown (max_wait_time); + // + // Begin artificial scope for auto_ptr like helpers calling: + // leader_follower.set_client_thread () and (maybe later on) + // leader_follower.set_client_leader_thread (). + // + { + // Calls leader_follower.set_client_thread () on construction and + // leader_follower.reset_client_thread () on destruction. + TAO_LF_Client_Thread_Helper client_thread_helper (leader_follower); + ACE_UNUSED_ARG (client_thread_helper); - // Check if there is a leader, but the leader is not us - if (leader_follower.leader_available () - && !leader_follower.is_leader_thread ()) - { - // = Wait as a follower. + ACE_Countdown_Time countdown (max_wait_time); - // Grab the condtion variable. - ACE_SYNCH_CONDITION* cond = - orb_core->leader_follower_condition_variable (); + // Check if there is a leader. Note that it cannot be us since we + // gave up our leadership when we became a client. + if (leader_follower.leader_available ()) + { + // = Wait as a follower. - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - wait (follower) on Transport <%x>, cond <%x>\n", - this->transport_, - cond)); - - // Add ourselves to the list, do it only once because we can - // wake up multiple times from the CV loop. And only do it if - // the reply has not been received (it could have arrived while - // we were preparing to receive it). - - if (!reply_received - && leader_follower.leader_available ()) - { - if (leader_follower.add_follower (cond) == -1) - ACE_ERROR ((LM_ERROR, - "TAO (%P|%t) TAO_Muxed_Wait_On_Leader_Follower::wait - " - "add_follower failed for <%x>\n", - cond)); - } + // Grab the condtion variable. + ACE_SYNCH_CONDITION* cond = + orb_core->leader_follower_condition_variable (); + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("TAO (%P|%t) - wait (follower) on Transport <%x>, cond <%x>\n"), + this->transport_, + cond)); - while (!reply_received && - leader_follower.leader_available ()) - { - if (max_wait_time == 0) - { - if (cond == 0 || cond->wait () == -1) - { - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - wait (follower) on <%x> " - "cond == 0 || cond->wait () == -1 : cond = %d\n", - this->transport_, (cond == 0) ? 0 : cond)); + // Add ourselves to the list, do it only once because we can + // wake up multiple times from the CV loop. And only do it if + // the reply has not been received (it could have arrived + // while we were preparing to receive it). + + if (!reply_received + && leader_follower.leader_available ()) + { + if (leader_follower.add_follower (cond) == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("TAO (%P|%t) TAO_Muxed_Wait_On_Leader_Follower::wait - ") + ASYS_TEXT ("add_follower failed for <%x>\n"), + cond)); + } + + + while (!reply_received && + leader_follower.leader_available ()) + { + if (max_wait_time == 0) + { + if (cond == 0 || cond->wait () == -1) + { + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("TAO (%P|%t) - wait (follower) on <%x> ") + ASYS_TEXT ("cond == 0 || cond->wait () == -1 : cond = %d\n"), + this->transport_, (cond == 0) ? 0 : cond)); + return -1; + } + } + else + { + countdown.update (); + ACE_Time_Value tv = ACE_OS::gettimeofday (); + tv += *max_wait_time; + if (cond == 0 || cond->wait (&tv) == -1) + { + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("TAO (%P|%t) - wait (follower) on <%x> ") + ASYS_TEXT ("cond == 0 || cond->wait (tv) == -1\n"), + this->transport_)); return -1; - } - } - else - { - countdown.update (); - ACE_Time_Value tv = ACE_OS::gettimeofday (); - tv += *max_wait_time; - if (cond == 0 || cond->wait (&tv) == -1) - { - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - wait (follower) on <%x> " - "cond == 0 || cond->wait (tv) == -1\n", - this->transport_)); - return -1; - } - } - } + } + } + } - countdown.update (); + countdown.update (); #if 0 - // Cannot remove the follower here, we *must* remove it when we - // signal it so the same condition is not signalled for both - // wake up as a follower and as the next leader. - if (leader_follower.remove_follower (cond) == -1) - ACE_ERROR ((LM_ERROR, - "TAO (%P|%t) TAO_Muxed_Wait_On_Leader_Follower::wait - " - "remove_follower failed for <%x>\n", cond)); + // Cannot remove the follower here, we *must* remove it when + // we signal it so the same condition is not signalled for + // both wake up as a follower and as the next leader. + if (leader_follower.remove_follower (cond) == -1) + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) TAO_Muxed_Wait_On_Leader_Follower::wait - " + "remove_follower failed for <%x>\n", cond)); #endif /* 0 */ - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - done (follower) on <%x>, reply_received %d\n", - this->transport_, reply_received)); + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("TAO (%P|%t) - done (follower) on <%x>, reply_received %d\n"), + this->transport_, reply_received)); - // Now somebody woke us up to become a leader or to handle - // our input. We are already removed from the follower queue. + // Now somebody woke us up to become a leader or to handle our + // input. We are already removed from the follower queue. - if (reply_received == 1) - return 0; + if (reply_received == 1) + return 0; - // FALLTHROUGH - // We only get here if we woke up but the reply is not complete - // yet, time to assume the leader role.... - // i.e. ACE_ASSERT (this->reply_received_ == 0); - } + // FALLTHROUGH + // We only get here if we woke up but the reply is not + // complete yet, time to assume the leader role.... + // i.e. ACE_ASSERT (this->reply_received_ == 0); + } - // = Leader Code. + // = Leader Code. - // The only way to reach this point is if we must become the leader, - // because there is no leader or we have to update to a leader or we - // are doing nested upcalls in this case we do increase the refcount - // on the leader in TAO_ORB_Core. + // The only way to reach this point is if we must become the + // leader, because there is no leader or we have to update to a + // leader or we are doing nested upcalls in this case we do + // increase the refcount on the leader in TAO_ORB_Core. - // This might increase the refcount of the leader. - leader_follower.set_leader_thread (); + // Calls leader_follower.set_client_leader_thread () on + // construction and leader_follower.reset_client_leader_thread () + // on destruction. Note that this may increase the refcount of + // the leader. + TAO_LF_Client_Leader_Thread_Helper client_leader_thread_helper (leader_follower); + ACE_UNUSED_ARG (client_leader_thread_helper); - int result = 1; + { + ACE_GUARD_RETURN (ACE_Reverse_Lock<ACE_SYNCH_MUTEX>, rev_mon, + leader_follower.reverse_lock (), -1); - { - ACE_GUARD_RETURN (ACE_Reverse_Lock<ACE_SYNCH_MUTEX>, rev_mon, - leader_follower.reverse_lock (), -1); + // @@ Do we need to do this? + // Become owner of the reactor. + orb_core->reactor ()->owner (ACE_Thread::self ()); - // @@ Do we need to do this? - // Become owner of the reactor. - orb_core->reactor ()->owner (ACE_Thread::self ()); + // Run the reactor event loop. - // Run the reactor event loop. + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("TAO (%P|%t) - wait (leader):to enter reactor event loop on <%x>\n"), + this->transport_)); - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - wait (leader):to enter reactor event loop on <%x>\n", - this->transport_)); + while (1) + { + // Run the event loop. + result = orb_core->reactor ()->handle_events (max_wait_time); - while (result > 0 && reply_received == 0) - result = orb_core->reactor ()->handle_events (max_wait_time); + // If we got our reply, no need to run the event loop any + // further. + if (reply_received) + break; - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - wait : (leader) : done with reactor event loop on <%x>\n", - this->transport_)); + // Did we timeout? If so, stop running the loop. + if (result == 0 && + max_wait_time != 0 && + *max_wait_time == ACE_Time_Value::zero) + break; + + // Other errors? If so, stop running the loop. + if (result == -1) + break; + + // Otherwise, keep going... + } + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("TAO (%P|%t) - wait : (leader) : done with reactor event loop on <%x>\n"), + this->transport_)); + } } + // + // End artificial scope for auto_ptr like helpers calling: + // leader_follower.reset_client_thread () and (maybe) + // leader_follower.reset_client_leader_thread (). + // // Wake up the next leader, we cannot do that in handle_input, - // because the woken up thread would try to get into - // handle_events, which is at the time in handle_input still - // occupied. But do it before checking the error in <result>, even - // if there is an error in our input we should continue running the - // loop in another thread. - - leader_follower.reset_leader_thread (); - leader_follower.reset_client_thread (); + // because the woken up thread would try to get into handle_events, + // which is at the time in handle_input still occupied. But do it + // before checking the error in <result>, even if there is an error + // in our input we should continue running the loop in another + // thread. if (leader_follower.elect_new_leader () == -1) ACE_ERROR_RETURN ((LM_ERROR, - "TAO:%N:%l:(%P|%t):TAO_Muxed_Wait_On_Leader_Follower::send_request: " - "Failed to unset the leader and wake up a new follower.\n"), + ASYS_TEXT ("TAO:%N:%l:(%P|%t):TAO_Muxed_Wait_On_Leader_Follower::send_request: ") + ASYS_TEXT ("Failed to unset the leader and wake up a new follower.\n")), -1); if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, - "TAO:%N:%l:(%P|%t):TAO_Muxed_Wait_On_Leader_Follower::wait: " - "handle_events failed.\n"), + ASYS_TEXT ("TAO:%N:%l:(%P|%t):TAO_Muxed_Wait_On_Leader_Follower::wait: ") + ASYS_TEXT ("handle_events failed.\n")), -1); // Return an error if there was a problem receiving the reply... @@ -788,7 +878,7 @@ TAO_Muxed_Wait_On_Leader_Follower::handle_input (void) if (TAO_debug_level >= 5) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - reading reply on <%x>\n", + ASYS_TEXT ("TAO (%P|%t) - reading reply on <%x>\n"), this->transport_)); // Receive any data that is available, without blocking... @@ -803,8 +893,8 @@ TAO_Muxed_Wait_On_Leader_Follower::handle_input (void) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Wait_On_LF::handle_input, " - "handle_client_input == -1\n")); + ASYS_TEXT ("TAO (%P|%t) - Wait_On_LF::handle_input, ") + ASYS_TEXT ("handle_client_input == -1\n"))); // this->reply_received_ = -1; } diff --git a/TAO/tao/append.cpp b/TAO/tao/append.cpp index d5e700b05ad..77803d46ee2 100644 --- a/TAO/tao/append.cpp +++ b/TAO/tao/append.cpp @@ -1,6 +1,4 @@ // $Id$ - - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index cb4ed2e0458..b0af49a5afa 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -1,7 +1,6 @@ // -*- C++ -*- // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp index 652ecc2c3e2..0a425cea0f8 100644 --- a/TAO/tao/decode.cpp +++ b/TAO/tao/decode.cpp @@ -1,6 +1,7 @@ // $Id$ + // ============================================================================ // // = LIBRARY @@ -40,7 +41,6 @@ ACE_RCSID(tao, decode, "$Id$") - // The decoder is exactly the reverse of the encoder, except that: // // * Unmarshaling some data types involve allocating memory. Such diff --git a/TAO/tao/deep_free.cpp b/TAO/tao/deep_free.cpp index bfcd28b3295..39bb3a3b134 100644 --- a/TAO/tao/deep_free.cpp +++ b/TAO/tao/deep_free.cpp @@ -84,10 +84,6 @@ DEEP_FREE (CORBA::TypeCode_ptr param, break; case CORBA::tk_struct: retval = TAO_Marshal_Struct::deep_free (param, source, dest, ACE_TRY_ENV); - - // @@ It's likely that other types will need their top-level - // memory freed as well. --- Carlos (and Seth). - // delete source; break; case CORBA::tk_union: retval = TAO_Marshal_Union::deep_free (param, source, dest, ACE_TRY_ENV); @@ -97,6 +93,14 @@ DEEP_FREE (CORBA::TypeCode_ptr param, break; case CORBA::tk_sequence: retval = TAO_Marshal_Sequence::deep_free (param, source, dest, ACE_TRY_ENV); + // @@ (JP) This takes care of a memory leak we had for recursive unions + // and unions that contain an anonymous sequence. For unions that contain + // typedef'd sequences and other cases where the union member is a + // pointer, we still have leaks. These are not so easy to fix for all + // cases. What we need is Carlos' _tao_destroy() method in the stubs. + delete ACE_reinterpret_cast (TAO_Base_Sequence *, + ACE_const_cast (void *, + source)); break; case CORBA::tk_array: retval = TAO_Marshal_Array::deep_free (param, source, dest, ACE_TRY_ENV); @@ -130,7 +134,7 @@ TAO_Marshal_Primitive::deep_free (CORBA::TypeCode_ptr tc, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Primitive::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Primitive::deep_free detected error\n"))); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } @@ -159,7 +163,7 @@ TAO_Marshal_Primitive::deep_free (CORBA::TypeCode_ptr tc, default: if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Primitive::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Primitive::deep_free detected error\n"))); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } @@ -177,7 +181,7 @@ TAO_Marshal_Struct::deep_free (CORBA::TypeCode_ptr tc, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Struct::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Struct::deep_free detected error\n"))); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } @@ -303,7 +307,7 @@ TAO_Marshal_Struct::deep_free (CORBA::TypeCode_ptr tc, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Struct::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Struct::deep_free detected error\n"))); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } @@ -502,7 +506,7 @@ TAO_Marshal_Array::deep_free (CORBA::TypeCode_ptr tc, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Struct::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Struct::deep_free detected error\n"))); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } @@ -647,7 +651,7 @@ TAO_Marshal_Array::deep_free (CORBA::TypeCode_ptr tc, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Sequence::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Sequence::deep_free detected error\n"))); // error exit ACE_THROW_RETURN (CORBA::MARSHAL (), CORBA::TypeCode::TRAVERSE_STOP); } @@ -669,7 +673,7 @@ TAO_Marshal_Alias::deep_free (CORBA::TypeCode_ptr tc, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Alias::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Alias::deep_free detected error\n"))); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } @@ -749,7 +753,7 @@ TAO_Marshal_Alias::deep_free (CORBA::TypeCode_ptr tc, // We should never reach here. if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Alias::decode detected error\n")); + ASYS_TEXT ("TAO_Marshal_Alias::decode detected error\n"))); ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } @@ -776,7 +780,7 @@ TAO_Marshal_Except::deep_free (CORBA::TypeCode_ptr tc, { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, - "TAO_Marshal_Except::deep_free detected error\n")); + ASYS_TEXT ("TAO_Marshal_Except::deep_free detected error\n"))); ACE_THROW_RETURN (CORBA::BAD_TYPECODE (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE), CORBA::TypeCode::TRAVERSE_STOP); } diff --git a/TAO/tao/default_client.cpp b/TAO/tao/default_client.cpp index 219c8fbbf74..c889dd18ab9 100644 --- a/TAO/tao/default_client.cpp +++ b/TAO/tao/default_client.cpp @@ -77,9 +77,9 @@ TAO_Default_Client_Strategy_Factory::parse_args (int argc, char ** argv) "-ORBIIOPProfileLock") == 0) { ACE_DEBUG ((LM_DEBUG, - "WARNING: The -ORBIIOPProfileLock option" - " is deprecated and will be removed.\n" - " Please use -ORBProfileLock instead\n")); + ASYS_TEXT ("WARNING: The -ORBIIOPProfileLock option") + ASYS_TEXT (" is deprecated and will be removed.\n") + ASYS_TEXT (" Please use -ORBProfileLock instead\n"))); curarg++; if (curarg < argc) { diff --git a/TAO/tao/default_server.cpp b/TAO/tao/default_server.cpp index ca82d0294e1..bb0a10ddde2 100644 --- a/TAO/tao/default_server.cpp +++ b/TAO/tao/default_server.cpp @@ -332,8 +332,8 @@ TAO_Default_Server_Strategy_Factory::parse_args (int argc, char *argv[]) "-ORBDemuxStrategy") == 0) { ACE_DEBUG ((LM_DEBUG, - "Warning: -ORBDemuxStrategy is deprecated. Please use " - "-ORBSystemidPolicyDemuxStrategy or -ORBUseridPolicyDemuxStrategy instead.\n")); + ASYS_TEXT ("Warning: -ORBDemuxStrategy is deprecated. Please use ") + ASYS_TEXT ("-ORBSystemidPolicyDemuxStrategy or -ORBUseridPolicyDemuxStrategy instead.\n"))); curarg++; } else if (ACE_OS::strcasecmp (argv[curarg], @@ -373,9 +373,9 @@ TAO_Default_Server_Strategy_Factory::parse_args (int argc, char *argv[]) "-ORBConnectorLock") == 0) { ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) WARNING: the " - "-ORBConnectorLock option is in the client " - "strategy factory now\n")); + ASYS_TEXT ("TAO (%P|%t) WARNING: the ") + ASYS_TEXT ("-ORBConnectorLock option is in the client ") + ASYS_TEXT ("strategy factory now\n"))); } else if (ACE_OS::strcasecmp (argv[curarg], diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index cc92e0498e0..05bfbb31b1d 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // @ (#) $Id$ - // ============================================================================ // // = LIBRARY diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp index 6584ac7b317..6548cb3e8ad 100644 --- a/TAO/tao/params.cpp +++ b/TAO/tao/params.cpp @@ -8,6 +8,7 @@ ACE_RCSID(tao, params, "$Id$") + TAO_ORB_Parameters::TAO_ORB_Parameters (void) : preconnects_list_ (), endpoints_list_ (), diff --git a/TAO/tao/rtcorbafwd.cpp b/TAO/tao/rtcorbafwd.cpp index d9d055533b1..9c2398619f2 100644 --- a/TAO/tao/rtcorbafwd.cpp +++ b/TAO/tao/rtcorbafwd.cpp @@ -2,7 +2,7 @@ #include "tao/rtcorbafwd.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #if !defined (__ACE_INLINE__) # include "tao/rtcorbafwd.i" @@ -20,4 +20,4 @@ TAO_NAMESPACE_BEGIN (RTCORBA) TAO_NAMESPACE_DEFINE (const RTCORBA::Priority, maxPriority, 32767) TAO_NAMESPACE_END -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/rtcorbafwd.h b/TAO/tao/rtcorbafwd.h index ed769d3e573..8475baddb89 100644 --- a/TAO/tao/rtcorbafwd.h +++ b/TAO/tao/rtcorbafwd.h @@ -25,7 +25,7 @@ #include "tao/corbafwd.h" -#if defined (TAO_HAS_RT_CORBA) +#if (TAO_HAS_RT_CORBA == 1) #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -69,6 +69,6 @@ TAO_NAMESPACE_CLOSE // end of class (namespace) RTCORBA # include "tao/rtcorbafwd.i" #endif /* ! __ACE_INLINE__ */ -#endif /* TAO_HAS_RT_CORBA */ +#endif /* TAO_HAS_RT_CORBA == 1 */ #endif /* TAO_RTCORBAFWD_H */ diff --git a/TAO/tao/skip.cpp b/TAO/tao/skip.cpp index 768857ef35c..1d7413562ca 100644 --- a/TAO/tao/skip.cpp +++ b/TAO/tao/skip.cpp @@ -1,6 +1,5 @@ // $Id$ - // ============================================================================ // // = LIBRARY |