00001 // -*- C++ -*- 00002 // 00003 // $Id: CSD_TP_Request.inl 76687 2007-01-29 19:18:13Z johnnyw $ 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 ACE_INLINE 00008 TAO::CSD::TP_Request::TP_Request(PortableServer::Servant servant, 00009 TP_Servant_State* servant_state) 00010 : prev_(0), 00011 next_(0), 00012 servant_ (servant), 00013 servant_state_(servant_state, false) 00014 { 00015 this->servant_->_add_ref (); 00016 } 00017 00018 00019 ACE_INLINE 00020 void 00021 TAO::CSD::TP_Request::prepare_for_queue() 00022 { 00023 this->prepare_for_queue_i(); 00024 } 00025 00026 00027 ACE_INLINE 00028 PortableServer::Servant 00029 TAO::CSD::TP_Request::servant() 00030 { 00031 // Used for chaining so we do not return a new "copy". 00032 return this->servant_.in(); 00033 } 00034 00035 00036 ACE_INLINE 00037 bool 00038 TAO::CSD::TP_Request::is_ready() const 00039 { 00040 if (this->servant_state_.is_nil()) 00041 { 00042 // This means that the serialization of servants is off. 00043 // We always answer true here to indicate that the servant is 00044 // never busy. 00045 return true; 00046 } 00047 00048 return !this->servant_state_->busy_flag(); 00049 } 00050 00051 00052 ACE_INLINE 00053 void 00054 TAO::CSD::TP_Request::mark_as_busy() 00055 { 00056 if (!this->servant_state_.is_nil()) 00057 { 00058 this->servant_state_->busy_flag(true); 00059 } 00060 } 00061 00062 00063 ACE_INLINE 00064 void 00065 TAO::CSD::TP_Request::mark_as_ready() 00066 { 00067 if (!this->servant_state_.is_nil()) 00068 { 00069 this->servant_state_->busy_flag(false); 00070 } 00071 } 00072 00073 00074 ACE_INLINE 00075 bool 00076 TAO::CSD::TP_Request::is_target(PortableServer::Servant servant) 00077 { 00078 // Compare pointers. Return true only if these are the exact same object. 00079 return (servant == this->servant_.in()); 00080 } 00081 00082 00083 ACE_INLINE 00084 void 00085 TAO::CSD::TP_Request::dispatch() 00086 { 00087 this->dispatch_i(); 00088 00089 } 00090 00091 00092 ACE_INLINE 00093 void 00094 TAO::CSD::TP_Request::cancel() 00095 { 00096 this->cancel_i(); 00097 } 00098 00099 TAO_END_VERSIONED_NAMESPACE_DECL