00001 // $Id: Wait_On_Leader_Follower.cpp 76593 2007-01-25 19:19:27Z johnnyw $ 00002 00003 #include "tao/Wait_On_Leader_Follower.h" 00004 #include "tao/LF_Follower.h" 00005 #include "tao/Leader_Follower.h" 00006 #include "tao/Transport.h" 00007 #include "tao/Synch_Reply_Dispatcher.h" 00008 #include "tao/ORB_Core.h" 00009 00010 ACE_RCSID (tao, 00011 Wait_On_Leader_Follower, 00012 "$Id: Wait_On_Leader_Follower.cpp 76593 2007-01-25 19:19:27Z johnnyw $") 00013 00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00015 00016 TAO_Wait_On_Leader_Follower::TAO_Wait_On_Leader_Follower 00017 (TAO_Transport *transport) 00018 : TAO_Wait_Strategy (transport) 00019 { 00020 } 00021 00022 TAO_Wait_On_Leader_Follower::~TAO_Wait_On_Leader_Follower (void) 00023 { 00024 } 00025 00026 /* 00027 * Hook to specialize the wait strategy when the concrete strategy is 00028 * a simple "lf" strategy. Add all public/protected/private methods 00029 * within the *COPY* hooks. 00030 */ 00031 00032 //@@ WAIT_STRATEGY_SPL_COPY_HOOK_START 00033 00034 int 00035 TAO_Wait_On_Leader_Follower::register_handler (void) 00036 { 00037 if (!this->is_registered_) 00038 { 00039 return this->transport_->register_handler (); 00040 } 00041 00042 return 1; 00043 } 00044 00045 bool 00046 TAO_Wait_On_Leader_Follower::non_blocking (void) const 00047 { 00048 return true; 00049 } 00050 00051 int 00052 TAO_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, 00053 int two_way) 00054 { 00055 // Register the handler. 00056 if (!this->is_registered_) 00057 { 00058 this->transport_->register_handler (); 00059 } 00060 00061 // Send the request. 00062 //@@ LF_WAIT_STRATEGY_SPL_SENDING_REQUEST_HOOK 00063 return this->TAO_Wait_Strategy::sending_request (orb_core, two_way); 00064 } 00065 00066 int 00067 TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, 00068 TAO_Synch_Reply_Dispatcher &rd) 00069 { 00070 TAO_Leader_Follower &leader_follower = 00071 this->transport_->orb_core ()->leader_follower (); 00072 return leader_follower.wait_for_event (&rd, this->transport_, max_wait_time); 00073 } 00074 00075 bool 00076 TAO_Wait_On_Leader_Follower::can_process_upcalls (void) const 00077 { 00078 return true; 00079 } 00080 00081 //@@ WAIT_STRATEGY_SPL_COPY_HOOK_END 00082 /* 00083 * End copy hook. 00084 */ 00085 00086 TAO_END_VERSIONED_NAMESPACE_DECL