00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Wait_On_Leader_Follower.h 00006 * 00007 * $Id: Wait_On_Leader_Follower.h 76947 2007-02-07 20:26:03Z johnnyw $ 00008 * 00009 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_WAIT_ON_LEADER_FOLLOWER_H 00014 #define TAO_WAIT_ON_LEADER_FOLLOWER_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/Wait_Strategy.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 /** 00027 * @class TAO_Wait_On_Leader_Follower 00028 * 00029 * @brief Wait according to the Leader-Follower model. Leader does the 00030 * event loop of the Reactor and the Followers wait on the 00031 * condition variable. 00032 * 00033 * This implementation is to work with the Muxed Transport 00034 * Mechanism. Here the state variables such as <Condition 00035 * Variable> etc cannot be kept in the Wait Strategy, since the 00036 * Wait Strategy is per Transport object and here the Transport 00037 * is Muxed and hence there are multiple threads running in the 00038 * same Transport context. 00039 */ 00040 class TAO_Wait_On_Leader_Follower : public TAO_Wait_Strategy 00041 { 00042 00043 public: 00044 /// Constructor. 00045 TAO_Wait_On_Leader_Follower (TAO_Transport *transport); 00046 00047 /// Destructor. 00048 virtual ~TAO_Wait_On_Leader_Follower (void); 00049 00050 // = Documented in TAO_Wait_Strategy. 00051 virtual int sending_request (TAO_ORB_Core *orb_core, int two_way); 00052 virtual int wait (ACE_Time_Value *max_wait_time, 00053 TAO_Synch_Reply_Dispatcher &rd); 00054 virtual int register_handler (void); 00055 virtual bool non_blocking (void) const; 00056 virtual bool can_process_upcalls (void) const; 00057 }; 00058 00059 TAO_END_VERSIONED_NAMESPACE_DECL 00060 00061 #include /**/ "ace/post.h" 00062 00063 #endif /* TAO_WAIT_ON_LEADER_FOLLOWER_H */