00001 // 00002 // RT_Current.cpp,v 1.11 2006/03/10 07:19:16 jtc Exp 00003 // 00004 00005 #include "tao/RTCORBA/RT_Current.h" 00006 00007 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 00008 00009 #include "tao/RTCORBA/Priority_Mapping.h" 00010 00011 #include "tao/Stub.h" 00012 #include "tao/ORB_Core.h" 00013 #include "tao/Protocols_Hooks.h" 00014 00015 #include "ace/Thread.h" 00016 00017 ACE_RCSID (RTCORBA, 00018 RT_Current, 00019 "RT_Current.cpp,v 1.11 2006/03/10 07:19:16 jtc Exp") 00020 00021 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00022 00023 TAO_RT_Current::TAO_RT_Current (TAO_ORB_Core *orb_core) 00024 : orb_core_ (orb_core) 00025 { 00026 } 00027 00028 TAO_RT_Current::~TAO_RT_Current (void) 00029 { 00030 } 00031 00032 RTCORBA::Priority 00033 TAO_RT_Current::the_priority (ACE_ENV_SINGLE_ARG_DECL) 00034 ACE_THROW_SPEC ((CORBA::SystemException)) 00035 { 00036 TAO_Protocols_Hooks *tph = 00037 this->orb_core_->get_protocols_hooks (); 00038 00039 RTCORBA::Priority priority; 00040 00041 int result = 00042 tph->get_thread_CORBA_priority (priority 00043 ACE_ENV_ARG_PARAMETER); 00044 ACE_CHECK_RETURN (-1); 00045 00046 if (result == -1) 00047 ACE_THROW_RETURN (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO), -1); 00048 00049 return priority; 00050 } 00051 00052 void 00053 TAO_RT_Current::the_priority (RTCORBA::Priority the_priority 00054 ACE_ENV_ARG_DECL) 00055 ACE_THROW_SPEC ((CORBA::SystemException)) 00056 { 00057 00058 TAO_Protocols_Hooks *tph = 00059 this->orb_core_->get_protocols_hooks (); 00060 00061 int result = 00062 tph->set_thread_CORBA_priority (the_priority 00063 ACE_ENV_ARG_PARAMETER); 00064 ACE_CHECK; 00065 00066 if (result == -1) 00067 ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); 00068 } 00069 00070 TAO_END_VERSIONED_NAMESPACE_DECL 00071 00072 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */