TAO_Wait_On_Leader_Follower Class Reference

Wait according to the Leader-Follower model. Leader does the event loop of the Reactor and the Followers wait on the condition variable. More...

#include <Wait_On_Leader_Follower.h>

Inheritance diagram for TAO_Wait_On_Leader_Follower:

Inheritance graph
[legend]
Collaboration diagram for TAO_Wait_On_Leader_Follower:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Wait_On_Leader_Follower (TAO_Transport *transport)
 Constructor.

virtual ~TAO_Wait_On_Leader_Follower (void)
 Destructor.

virtual int sending_request (TAO_ORB_Core *orb_core, int two_way)
virtual int wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd)
virtual int register_handler (void)
virtual bool non_blocking (void) const
virtual bool can_process_upcalls (void) const

Detailed Description

Wait according to the Leader-Follower model. Leader does the event loop of the Reactor and the Followers wait on the condition variable.

This implementation is to work with the Muxed Transport Mechanism. Here the state variables such as etc cannot be kept in the Wait Strategy, since the Wait Strategy is per Transport object and here the Transport is Muxed and hence there are multiple threads running in the same Transport context.

Definition at line 40 of file Wait_On_Leader_Follower.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Wait_On_Leader_Follower::TAO_Wait_On_Leader_Follower TAO_Transport transport  ) 
 

Constructor.

Definition at line 16 of file Wait_On_Leader_Follower.cpp.

00017   : TAO_Wait_Strategy (transport)
00018 {
00019 }

TAO_Wait_On_Leader_Follower::~TAO_Wait_On_Leader_Follower void   )  [virtual]
 

Destructor.

Definition at line 21 of file Wait_On_Leader_Follower.cpp.

00022 {
00023 }


Member Function Documentation

bool TAO_Wait_On_Leader_Follower::can_process_upcalls void   )  const [virtual]
 

This flag is to check whether the thread can process upcalls while waiting for the reply. Some wait strategies, like Wait_On_LF_No_Upcall does not allow the client threads to process requests while waiting for the reply.

Implements TAO_Wait_Strategy.

Reimplemented in TAO::Wait_On_LF_No_Upcall.

Definition at line 69 of file Wait_On_Leader_Follower.cpp.

00070 {
00071   return true;
00072 }

bool TAO_Wait_On_Leader_Follower::non_blocking void   )  const [virtual]
 

Returns a value to indicate whether the transport needs to set the socket on which it is waiting to non-blocking mode or not.

Implements TAO_Wait_Strategy.

Definition at line 37 of file Wait_On_Leader_Follower.cpp.

00038 {
00039   return true;
00040 }

int TAO_Wait_On_Leader_Follower::register_handler void   )  [virtual]
 

Register the handler needs with the reactor provided that it makes sense for the strategy.

Implements TAO_Wait_Strategy.

Definition at line 26 of file Wait_On_Leader_Follower.cpp.

References TAO_Transport::register_handler().

00027 {
00028   if (!this->is_registered_)
00029     {
00030       return this->transport_->register_handler ();
00031     }
00032 
00033   return 1;
00034 }

int TAO_Wait_On_Leader_Follower::sending_request TAO_ORB_Core orb_core,
int  two_way
[virtual]
 

The user is going to send a request, prepare any internal variables because the reply may arrive *before* the user calls wait.

Reimplemented from TAO_Wait_Strategy.

Definition at line 43 of file Wait_On_Leader_Follower.cpp.

References TAO_Transport::register_handler(), and TAO_Wait_Strategy::sending_request().

00045 {
00046   // Register the handler.
00047   if (!this->is_registered_)
00048     {
00049       this->transport_->register_handler ();
00050     }
00051 
00052   // Send the request.
00053   return this->TAO_Wait_Strategy::sending_request (orb_core,
00054                                                    two_way);
00055 }

int TAO_Wait_On_Leader_Follower::wait ACE_Time_Value max_wait_time,
TAO_Synch_Reply_Dispatcher rd
[virtual]
 

Base class virtual method. Wait till the reply_received flag is true or the time expires.

Implements TAO_Wait_Strategy.

Reimplemented in TAO::Wait_On_LF_No_Upcall.

Definition at line 58 of file Wait_On_Leader_Follower.cpp.

References TAO_ORB_Core::leader_follower(), TAO_Transport::orb_core(), and TAO_Leader_Follower::wait_for_event().

00060 {
00061   TAO_Leader_Follower& leader_follower =
00062     this->transport_->orb_core ()->leader_follower ();
00063   return leader_follower.wait_for_event (&rd,
00064                                          this->transport_,
00065                                          max_wait_time);
00066 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:24:27 2006 for TAO by doxygen 1.3.6