From bd8638c8477f360c9816d54c4f6c2b21919efd46 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 17 Aug 2005 11:50:32 +0000 Subject: ChangeLogTag: Wed Aug 17 08:34:12 UTC 2005 Johnny Willemsen --- TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp | 5 ++-- TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h | 4 ++- TAO/tao/AnyTypeCode_Adapter.h | 4 ++- TAO/tao/PolicyC.cpp | 36 ++++++++++++++++++++---- TAO/tao/SystemException.cpp | 8 +++++- TAO/tao/WrongTransactionC.cpp | 19 +++++++++++-- 6 files changed, 62 insertions(+), 14 deletions(-) diff --git a/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp index 74dd578e1cd..0e35d292055 100644 --- a/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp +++ b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp @@ -51,8 +51,9 @@ ACE_RCSID (tao, TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \ TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \ TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED) \ - TAO_SYSTEM_EXCEPTION (WrongTransaction) - + TAO_SYSTEM_EXCEPTION (WrongTransaction) \ + TAO_SYSTEM_EXCEPTION (PolicyError) \ + TAO_SYSTEM_EXCEPTION (InvalidPolicies) #define TAO_SYSTEM_EXCEPTION(name) \ CORBA::TypeCode_ptr \ diff --git a/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h index 7dfa5031e77..ccee6c0a090 100644 --- a/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h +++ b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h @@ -76,7 +76,9 @@ public: TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \ TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \ TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED) \ - TAO_SYSTEM_EXCEPTION (WrongTransaction) + TAO_SYSTEM_EXCEPTION (WrongTransaction) \ + TAO_SYSTEM_EXCEPTION (PolicyError) \ + TAO_SYSTEM_EXCEPTION (InvalidPolicies) #define TAO_SYSTEM_EXCEPTION(name) \ virtual CORBA::TypeCode_ptr _tao_type_ ## name (void) const; diff --git a/TAO/tao/AnyTypeCode_Adapter.h b/TAO/tao/AnyTypeCode_Adapter.h index a43777ee555..5050a148c32 100644 --- a/TAO/tao/AnyTypeCode_Adapter.h +++ b/TAO/tao/AnyTypeCode_Adapter.h @@ -89,7 +89,9 @@ public: TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \ TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \ TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED) \ - TAO_SYSTEM_EXCEPTION (WrongTransaction) + TAO_SYSTEM_EXCEPTION (WrongTransaction) \ + TAO_SYSTEM_EXCEPTION (PolicyError) \ + TAO_SYSTEM_EXCEPTION (InvalidPolicies) #define TAO_SYSTEM_EXCEPTION(name) \ virtual CORBA::TypeCode_ptr _tao_type_ ## name (void) const = 0; diff --git a/TAO/tao/PolicyC.cpp b/TAO/tao/PolicyC.cpp index 1c31b498be6..606c217d2bf 100644 --- a/TAO/tao/PolicyC.cpp +++ b/TAO/tao/PolicyC.cpp @@ -36,6 +36,8 @@ #include "tao/Basic_Arguments.h" #include "tao/Object_Argument_T.h" #include "ace/OS_NS_string.h" +#include "tao/AnyTypeCode_Adapter.h" +#include "ace/Dynamic_Service.h" #if defined (__BORLANDC__) #pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig @@ -210,9 +212,20 @@ CORBA::PolicyError::PolicyError ( // TAO extension - the virtual _type method. CORBA::TypeCode_ptr CORBA::PolicyError::_tao_type (void) const { -/// @todo use adapter - return 0; -// return ::CORBA::_tc_PolicyError; + TAO_AnyTypeCode_Adapter *adapter = + ACE_Dynamic_Service::instance ( + "AnyTypeCode_Adapter" + ); + if (adapter != 0) + return adapter->_tao_type_PolicyError (); + else + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("Unable to find the ") + ACE_TEXT ("AnyTypeCode Adapter instance"))); + return 0; + } } // TAO_IDL - Generated from @@ -335,9 +348,20 @@ CORBA::InvalidPolicies::InvalidPolicies ( // TAO extension - the virtual _type method. CORBA::TypeCode_ptr CORBA::InvalidPolicies::_tao_type (void) const { - // todo - //return ::CORBA::_tc_InvalidPolicies; - return 0; + TAO_AnyTypeCode_Adapter *adapter = + ACE_Dynamic_Service::instance ( + "AnyTypeCode_Adapter" + ); + if (adapter != 0) + return adapter->_tao_type_InvalidPolicies (); + else + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("Unable to find the ") + ACE_TEXT ("AnyTypeCode Adapter instance"))); + return 0; + } } // TAO_IDL - Generated from diff --git a/TAO/tao/SystemException.cpp b/TAO/tao/SystemException.cpp index b411c1f356c..677f507c50c 100644 --- a/TAO/tao/SystemException.cpp +++ b/TAO/tao/SystemException.cpp @@ -897,7 +897,13 @@ CORBA::name ::_tao_type (void) const \ if (adapter != 0) \ return adapter->_tao_type_ ## name (); \ else \ - return 0; \ + { \ + ACE_ERROR ((LM_ERROR, \ + ACE_TEXT ("(%P|%t) %p\n"), \ + ACE_TEXT ("Unable to find the ") \ + ACE_TEXT ("AnyTypeCode Adapter instance"))); \ + return 0; \ + } \ } STANDARD_EXCEPTION_LIST diff --git a/TAO/tao/WrongTransactionC.cpp b/TAO/tao/WrongTransactionC.cpp index f34fe86e722..3ca279cf001 100644 --- a/TAO/tao/WrongTransactionC.cpp +++ b/TAO/tao/WrongTransactionC.cpp @@ -33,6 +33,8 @@ #include "tao/CDR.h" #include "tao/SystemException.h" #include "ace/OS_NS_string.h" +#include "tao/AnyTypeCode_Adapter.h" +#include "ace/Dynamic_Service.h" #if defined (__BORLANDC__) #pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig @@ -149,9 +151,20 @@ void CORBA::WrongTransaction::_tao_decode ( // TAO extension - the virtual _type method. CORBA::TypeCode_ptr CORBA::WrongTransaction::_tao_type (void) const { - // @todo - //return ::CORBA::_tc_WrongTransaction; - return 0; + TAO_AnyTypeCode_Adapter *adapter = + ACE_Dynamic_Service::instance ( + "AnyTypeCode_Adapter" + ); + if (adapter != 0) + return adapter->_tao_type_WrongTransaction (); + else + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("Unable to find the ") + ACE_TEXT ("AnyTypeCode Adapter instance"))); + return 0; + } } // TAO_IDL - Generated from -- cgit v1.2.1