Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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 Methods

 TAO_Wait_On_Leader_Follower (TAO_Transport *transport)
 Constructor. More...

virtual ~TAO_Wait_On_Leader_Follower (void)
 Destructor. More...

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)
 Base class virtual method. Wait till the <reply_received> flag is true or the time expires. More...

virtual int register_handler (void)
 Register the handler needs with the reactor provided that it makes sense for the strategy. More...

virtual int non_blocking (void)
 Returns a value to indicate whether the transport needs to set the socket on which it is waiting to non-blocking mode or not. More...


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 impelementation is to work with the Muxed Transport Mechanism. Here the state variables such as <Condition Variable> 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 38 of file Wait_On_Leader_Follower.h.


Constructor & Destructor Documentation

TAO_Wait_On_Leader_Follower::TAO_Wait_On_Leader_Follower TAO_Transport   transport
 

Constructor.

Definition at line 13 of file Wait_On_Leader_Follower.cpp.

00014   : TAO_Wait_Strategy (transport)
00015 {
00016 }

TAO_Wait_On_Leader_Follower::~TAO_Wait_On_Leader_Follower void    [virtual]
 

Destructor.

Definition at line 18 of file Wait_On_Leader_Follower.cpp.

00019 {
00020 }


Member Function Documentation

int TAO_Wait_On_Leader_Follower::non_blocking void    [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 32 of file Wait_On_Leader_Follower.cpp.

00033 {
00034   return 1;
00035 }

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 23 of file Wait_On_Leader_Follower.cpp.

References TAO_Wait_Strategy::is_registered_, TAO_Transport::register_handler, and TAO_Wait_Strategy::transport_.

00024 {
00025   if (this->is_registered_ == 0)
00026     return this->transport_->register_handler ();
00027 
00028   return 1;
00029 }

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 38 of file Wait_On_Leader_Follower.cpp.

References TAO_Wait_Strategy::is_registered_, TAO_Transport::register_handler, TAO_Wait_Strategy::sending_request, and TAO_Wait_Strategy::transport_.

00040 {
00041   // Register the handler.
00042   if (this->is_registered_ == 0)
00043       this->transport_->register_handler ();
00044 
00045   // Send the request.
00046   return this->TAO_Wait_Strategy::sending_request (orb_core,
00047                                                    two_way);
00048 }

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.

Definition at line 51 of file Wait_On_Leader_Follower.cpp.

References TAO_ORB_Core::leader_follower, TAO_Transport::orb_core, TAO_Wait_Strategy::transport_, and TAO_Leader_Follower::wait_for_event.

00053 {
00054   TAO_Leader_Follower& leader_follower =
00055     this->transport_->orb_core ()->leader_follower ();
00056   return leader_follower.wait_for_event (&rd,
00057                                          this->transport_,
00058                                          max_wait_time);
00059 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:46:44 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002