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

TAO_LF_Strategy_Complete Class Reference

A concrete TAO_LF_Strategy for ORB configurations that use the Leader/Followers event loop. More...

#include <LF_Strategy_Complete.h>

Inheritance diagram for TAO_LF_Strategy_Complete:

Inheritance graph
[legend]
Collaboration diagram for TAO_LF_Strategy_Complete:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_LF_Strategy_Complete (void)
 Constructor. More...

virtual ~TAO_LF_Strategy_Complete (void)
virtual void set_upcall_thread (TAO_Leader_Follower &)
 The current thread will handle an upcall. More...

virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, TAO_Leader_Follower &)
 The current thread is entering the reactor event loop. More...

virtual void reset_event_loop_thread (int call_reset, TAO_Leader_Follower &)
 The current thread is leaving the event loop. More...


Detailed Description

A concrete TAO_LF_Strategy for ORB configurations that use the Leader/Followers event loop.

Definition at line 27 of file LF_Strategy_Complete.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_LF_Strategy_Complete::TAO_LF_Strategy_Complete void   
 

Constructor.

Definition at line 4 of file LF_Strategy_Complete.inl.

00005 {
00006 }

TAO_LF_Strategy_Complete::~TAO_LF_Strategy_Complete void    [virtual]
 

Definition at line 14 of file LF_Strategy_Complete.cpp.

00015 {
00016 }


Member Function Documentation

void TAO_LF_Strategy_Complete::reset_event_loop_thread int    call_reset,
TAO_Leader_Follower  
[virtual]
 

The current thread is leaving the event loop.

When the thread leaves the event loop a new leader must be elected.

Implements TAO_LF_Strategy.

Definition at line 34 of file LF_Strategy_Complete.cpp.

References ACE_ERROR, ACE_GUARD, ACE_TEXT, TAO_Leader_Follower::elect_new_leader, LM_ERROR, TAO_Leader_Follower::lock, TAO_Leader_Follower::reset_event_loop_thread, and TAO_SYNCH_MUTEX.

00036 {
00037   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, lf.lock ());
00038 
00039   if (call_reset)
00040     lf.reset_event_loop_thread ();
00041 
00042   int result = lf.elect_new_leader ();
00043 
00044   if (result == -1)
00045     ACE_ERROR ((LM_ERROR,
00046                 ACE_TEXT ("TAO (%P|%t) Failed to wake up ")
00047                 ACE_TEXT ("a follower thread\n")));
00048 }

int TAO_LF_Strategy_Complete::set_event_loop_thread ACE_Time_Value   max_wait_time,
TAO_Leader_Follower  
[virtual]
 

The current thread is entering the reactor event loop.

Threads that block in the reactor event loop become "server" threads for the Leader/Follower set. They must be flagged specially because they do not wait for one specific event, but for any event whatsoever.

Implements TAO_LF_Strategy.

Definition at line 25 of file LF_Strategy_Complete.cpp.

References ACE_GUARD_RETURN, TAO_Leader_Follower::lock, TAO_Leader_Follower::set_event_loop_thread, and TAO_SYNCH_MUTEX.

00027 {
00028   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), -1);
00029 
00030   return lf.set_event_loop_thread (tv);
00031 }

void TAO_LF_Strategy_Complete::set_upcall_thread TAO_Leader_Follower   [virtual]
 

The current thread will handle an upcall.

Threads that handle requests can block for long periods of time, causing deadlocks if they don't elect a new leader before starting the upcall the system can become non-responsive or dead-lock.

Implements TAO_LF_Strategy.

Definition at line 19 of file LF_Strategy_Complete.cpp.

References TAO_Leader_Follower::set_upcall_thread.

00020 {
00021   lf.set_upcall_thread ();
00022 }


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