00001 // -*- C++ -*- 00002 // 00003 // $Id: CSD_Strategy_Proxy.inl 81882 2008-06-10 14:59:20Z johnc $ 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 ACE_INLINE 00008 TAO::CSD::Strategy_Proxy::Strategy_Proxy() 00009 : strategy_impl_(0) 00010 { 00011 } 00012 00013 ACE_INLINE 00014 TAO::CSD::Strategy_Proxy::~Strategy_Proxy() 00015 { 00016 strategy_impl_ = 0; // don't delete it! The var will do it for us. 00017 } 00018 00019 ACE_INLINE 00020 void 00021 TAO::CSD::Strategy_Proxy::dispatch_request 00022 (TAO_ServerRequest& server_request, 00023 TAO::Portable_Server::Servant_Upcall& upcall) 00024 { 00025 00026 if (this->strategy_impl_ == 0) 00027 { 00028 // This is the "default" strategy implementation. 00029 upcall.servant()->_dispatch(server_request, (void*)&upcall); 00030 } 00031 else 00032 { 00033 // Delegate to the custom strategy object. 00034 this->strategy_impl_->dispatch_request(server_request, upcall); 00035 } 00036 } 00037 00038 ACE_INLINE 00039 bool 00040 TAO::CSD::Strategy_Proxy::poa_activated_event(TAO_ORB_Core& orb_core) 00041 { 00042 // Delegate to the custom strategy object (or return true if this proxy 00043 // is not holding a custom strategy). 00044 return (this->strategy_impl_ == 0) ? true 00045 : this->strategy_impl_->poa_activated_event(orb_core); 00046 } 00047 00048 00049 ACE_INLINE 00050 void 00051 TAO::CSD::Strategy_Proxy::poa_deactivated_event() 00052 { 00053 // We only need to do something if this proxy holds a custom strategy. 00054 if (this->strategy_impl_) 00055 { 00056 // Delegate to the custom strategy object. 00057 this->strategy_impl_->poa_deactivated_event(); 00058 } 00059 } 00060 00061 ACE_INLINE 00062 void 00063 TAO::CSD::Strategy_Proxy::servant_activated_event 00064 (PortableServer::Servant servant, 00065 const PortableServer::ObjectId& oid) 00066 { 00067 // We only need to do something if this proxy holds a custom strategy. 00068 if (this->strategy_impl_) 00069 { 00070 // Delegate to the custom strategy object. 00071 this->strategy_impl_->servant_activated_event(servant, oid); 00072 } 00073 } 00074 00075 ACE_INLINE 00076 void 00077 TAO::CSD::Strategy_Proxy::servant_deactivated_event 00078 (PortableServer::Servant servant, 00079 const PortableServer::ObjectId& oid) 00080 { 00081 // We only need to do something if this proxy holds a custom strategy. 00082 if (this->strategy_impl_) 00083 { 00084 // Delegate to the custom strategy object. 00085 this->strategy_impl_->servant_deactivated_event(servant, oid); 00086 } 00087 } 00088 00089 TAO_END_VERSIONED_NAMESPACE_DECL