00001 // 00002 // $Id: RT_Current.cpp 77265 2007-02-20 20:12:47Z johnnyw $ 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 #include "tao/SystemException.h" 00015 00016 #include "ace/Thread.h" 00017 00018 ACE_RCSID (RTCORBA, 00019 RT_Current, 00020 "$Id: RT_Current.cpp 77265 2007-02-20 20:12:47Z johnnyw $") 00021 00022 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00023 00024 TAO_RT_Current::TAO_RT_Current (TAO_ORB_Core *orb_core) 00025 : orb_core_ (orb_core) 00026 { 00027 } 00028 00029 TAO_RT_Current::~TAO_RT_Current (void) 00030 { 00031 } 00032 00033 RTCORBA::Priority 00034 TAO_RT_Current::the_priority (void) 00035 { 00036 TAO_Protocols_Hooks *tph = this->orb_core_->get_protocols_hooks (); 00037 00038 RTCORBA::Priority priority = 0; 00039 00040 if (tph != 0) 00041 { 00042 if (tph->get_thread_CORBA_priority (priority) == -1) 00043 throw ::CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO); 00044 } 00045 00046 return priority; 00047 } 00048 00049 void 00050 TAO_RT_Current::the_priority (RTCORBA::Priority the_priority) 00051 { 00052 00053 TAO_Protocols_Hooks *tph = this->orb_core_->get_protocols_hooks (); 00054 00055 if (tph != 0) 00056 { 00057 if (tph->set_thread_CORBA_priority (the_priority) == -1) 00058 throw ::CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO); 00059 } 00060 } 00061 00062 TAO_END_VERSIONED_NAMESPACE_DECL 00063 00064 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */