TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, > Class Template Reference

TAO_ESF_Delayed_Operations. More...

#include <ESF_Delayed_Changes.h>

Inheritance diagram for TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >:

Inheritance graph
[legend]
Collaboration diagram for TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_ESF_Connected_Command<
TAO_ESF_Delayed_Changes<
PROXY, COLLECTION, ITERATOR,
ACE_SYNCH_USE >, PROXY > 
Connected_Command
typedef TAO_ESF_Reconnected_Command<
TAO_ESF_Delayed_Changes<
PROXY, COLLECTION, ITERATOR,
ACE_SYNCH_USE >, PROXY > 
Reconnected_Command
typedef TAO_ESF_Disconnected_Command<
TAO_ESF_Delayed_Changes<
PROXY, COLLECTION, ITERATOR,
ACE_SYNCH_USE >, PROXY > 
Disconnected_Command
typedef TAO_ESF_Shutdown_Command<
TAO_ESF_Delayed_Changes<
PROXY, COLLECTION, ITERATOR,
ACE_SYNCH_USE > > 
Shutdown_Command

Public Member Functions

 TAO_ESF_Delayed_Changes (void)
 TAO_ESF_Delayed_Changes (const COLLECTION &collection)
int busy (void)
int idle (void)
int execute_delayed_operations (void)
void connected_i (PROXY *proxy ACE_ENV_ARG_DECL)
void reconnected_i (PROXY *proxy ACE_ENV_ARG_DECL)
void disconnected_i (PROXY *proxy ACE_ENV_ARG_DECL)
void shutdown_i (ACE_ENV_SINGLE_ARG_DECL)
virtual void for_each (TAO_ESF_Worker< PROXY > *worker ACE_ENV_ARG_DECL)
virtual void connected (PROXY *proxy ACE_ENV_ARG_DECL)
virtual void reconnected (PROXY *proxy ACE_ENV_ARG_DECL)
virtual void disconnected (PROXY *proxy ACE_ENV_ARG_DECL)
virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)

Private Types

typedef TAO_ESF_Busy_Lock_Adapter<
TAO_ESF_Delayed_Changes<
PROXY, COLLECTION, ITERATOR,
ACE_SYNCH_USE > > 
Busy_Lock

Private Attributes

COLLECTION collection_
Busy_Lock lock_
ACE_SYNCH_MUTEX_T busy_lock_
ACE_SYNCH_CONDITION_T busy_cond_
CORBA::ULong busy_count_
CORBA::ULong write_delay_count_
CORBA::ULong busy_hwm_
 Control variables for the concurrency policies.

CORBA::ULong max_write_delay_
ACE_Unbounded_Queue< ACE_Command_Base * > command_queue_

Detailed Description

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
class TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >

TAO_ESF_Delayed_Operations.

This class implements the Delayed Operations protocol to solve the concurrency challenges outlined in the documentation of TAO_ESF_Proxy_Collection. In short the class delays changes by putting them on an "operation queue", the operations are stored as command objects in this queue and executed once the system is quiescent (i.e. no threads are iterating over the collection). The algorithm implemented so far is:

Definition at line 88 of file ESF_Delayed_Changes.h.


Member Typedef Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Busy_Lock_Adapter<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE> > TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Busy_Lock [private]
 

Definition at line 125 of file ESF_Delayed_Changes.h.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Connected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Connected_Command
 

Definition at line 106 of file ESF_Delayed_Changes.h.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::connected().

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Disconnected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Disconnected_Command
 

Definition at line 108 of file ESF_Delayed_Changes.h.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::disconnected().

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Reconnected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Reconnected_Command
 

Definition at line 107 of file ESF_Delayed_Changes.h.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::reconnected().

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Shutdown_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE> > TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Shutdown_Command
 

Definition at line 109 of file ESF_Delayed_Changes.h.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::shutdown().


Constructor & Destructor Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::TAO_ESF_Delayed_Changes void   ) 
 

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::TAO_ESF_Delayed_Changes const COLLECTION &  collection  ) 
 


Member Function Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
int TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy void   ) 
 

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
void TAO_ESF_Delayed_Changes< PROXY, C, I, >::connected PROXY *proxy  ACE_ENV_ARG_DECL  )  [virtual]
 

Definition at line 112 of file ESF_Delayed_Changes.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_GUARD_THROW_EX, ACE_NEW, ACE_SYNCH_MUTEX_T, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_count_, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::command_queue_, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Connected_Command, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::connected_i(), ACE_Unbounded_Queue< ACE_Command_Base * >::enqueue_tail(), and TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::write_delay_count_.

00114 {
00115   ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
00116       CORBA::INTERNAL ());
00117   ACE_CHECK;
00118 
00119   proxy->_incr_refcnt ();
00120   if (this->busy_count_ == 0)
00121     {
00122       // We can add the object immediately
00123       this->connected_i (proxy ACE_ENV_ARG_PARAMETER);
00124       ACE_CHECK;
00125     }
00126   else
00127     {
00128       ACE_Command_Base* command = 0;
00129       ACE_NEW (command,
00130                Connected_Command (this,
00131                                   proxy));
00132       this->command_queue_.enqueue_tail (command);
00133       this->write_delay_count_++;
00134     }
00135 }

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
TAO_BEGIN_VERSIONED_NAMESPACE_DECL void TAO_ESF_Delayed_Changes< PROXY, C, I, >::connected_i PROXY *proxy  ACE_ENV_ARG_DECL  ) 
 

Definition at line 9 of file ESF_Delayed_Changes.i.

References ACE_ENV_ARG_PARAMETER.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::connected().

00011 {
00012   this->collection_.connected (proxy ACE_ENV_ARG_PARAMETER);
00013 }

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
void TAO_ESF_Delayed_Changes< PROXY, C, I, >::disconnected PROXY *proxy  ACE_ENV_ARG_DECL  )  [virtual]
 

Definition at line 166 of file ESF_Delayed_Changes.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_GUARD_THROW_EX, ACE_NEW, ACE_SYNCH_MUTEX_T, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_count_, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::command_queue_, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Disconnected_Command, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::disconnected_i(), ACE_Unbounded_Queue< ACE_Command_Base * >::enqueue_tail(), and TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::write_delay_count_.

00168 {
00169   ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
00170       CORBA::INTERNAL ());
00171   ACE_CHECK;
00172 
00173   if (this->busy_count_ == 0)
00174     {
00175       // We can remove the object immediately
00176       this->disconnected_i (proxy ACE_ENV_ARG_PARAMETER);
00177       ACE_CHECK;
00178     }
00179   else
00180     {
00181       ACE_Command_Base* command;
00182       ACE_NEW (command,
00183                Disconnected_Command (this,
00184                                      proxy));
00185       this->command_queue_.enqueue_tail (command);
00186       this->write_delay_count_++;
00187     }
00188 }

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
void TAO_ESF_Delayed_Changes< PROXY, C, I, >::disconnected_i PROXY *proxy  ACE_ENV_ARG_DECL  ) 
 

Definition at line 25 of file ESF_Delayed_Changes.i.

References ACE_ENV_ARG_PARAMETER.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::disconnected().

00027 {
00028   this->collection_.disconnected (proxy ACE_ENV_ARG_PARAMETER);
00029 }

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
int TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::execute_delayed_operations void   ) 
 

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, ACE_SYNCH_USE >::idle().

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
virtual void TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::for_each TAO_ESF_Worker< PROXY > *worker  ACE_ENV_ARG_DECL  )  [virtual]
 

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
int TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::idle void   ) 
 

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
void TAO_ESF_Delayed_Changes< PROXY, C, I, >::reconnected PROXY *proxy  ACE_ENV_ARG_DECL  )  [virtual]
 

Definition at line 139 of file ESF_Delayed_Changes.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_GUARD_THROW_EX, ACE_NEW, ACE_SYNCH_MUTEX_T, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_count_, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::command_queue_, ACE_Unbounded_Queue< ACE_Command_Base * >::enqueue_tail(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Reconnected_Command, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::reconnected_i(), and TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::write_delay_count_.

00141 {
00142   ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
00143       CORBA::INTERNAL ());
00144   ACE_CHECK;
00145 
00146   proxy->_incr_refcnt ();
00147   if (this->busy_count_ == 0)
00148     {
00149       // We can reconnect the object immediately
00150       this->reconnected_i (proxy ACE_ENV_ARG_PARAMETER);
00151       ACE_CHECK;
00152     }
00153   else
00154     {
00155       ACE_Command_Base* command;
00156       ACE_NEW (command,
00157                Reconnected_Command (this,
00158                                     proxy));
00159       this->command_queue_.enqueue_tail (command);
00160       this->write_delay_count_++;
00161     }
00162 }

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
void TAO_ESF_Delayed_Changes< PROXY, C, I, >::reconnected_i PROXY *proxy  ACE_ENV_ARG_DECL  ) 
 

Definition at line 17 of file ESF_Delayed_Changes.i.

References ACE_ENV_ARG_PARAMETER.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::reconnected().

00019 {
00020   this->collection_.reconnected (proxy ACE_ENV_ARG_PARAMETER);
00021 }

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
void TAO_ESF_Delayed_Changes< PROXY, C, I, >::shutdown ACE_ENV_SINGLE_ARG_DECL   )  [virtual]
 

Definition at line 192 of file ESF_Delayed_Changes.cpp.

References ACE_CHECK, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, ACE_NEW, ACE_SYNCH_MUTEX_T, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_count_, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::command_queue_, ACE_Unbounded_Queue< ACE_Command_Base * >::enqueue_tail(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::Shutdown_Command, TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::shutdown_i(), and TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::write_delay_count_.

00193 {
00194   ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
00195       CORBA::INTERNAL ());
00196   ACE_CHECK;
00197 
00198   if (this->busy_count_ == 0)
00199     {
00200       // We can shutdown the object immediately
00201       this->shutdown_i (ACE_ENV_SINGLE_ARG_PARAMETER);
00202       ACE_CHECK;
00203     }
00204   else
00205     {
00206       ACE_Command_Base* command;
00207       ACE_NEW (command,
00208                Shutdown_Command (this));
00209       this->command_queue_.enqueue_tail (command);
00210       this->write_delay_count_++;
00211     }
00212 }

template<class PROXY, class C, class I, ACE_SYNCH_DECL >
void TAO_ESF_Delayed_Changes< PROXY, C, I, >::shutdown_i ACE_ENV_SINGLE_ARG_DECL   ) 
 

Definition at line 33 of file ESF_Delayed_Changes.i.

References ACE_ENV_SINGLE_ARG_PARAMETER.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::shutdown().

00034 {
00035   this->collection_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00036 }


Member Data Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
ACE_SYNCH_CONDITION_T TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_cond_ [private]
 

Definition at line 131 of file ESF_Delayed_Changes.h.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
CORBA::ULong TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_count_ [private]
 

Definition at line 133 of file ESF_Delayed_Changes.h.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::connected(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::disconnected(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::reconnected(), and TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::shutdown().

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
CORBA::ULong TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_hwm_ [private]
 

Control variables for the concurrency policies.

Definition at line 138 of file ESF_Delayed_Changes.h.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
ACE_SYNCH_MUTEX_T TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::busy_lock_ [private]
 

Definition at line 129 of file ESF_Delayed_Changes.h.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
COLLECTION TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::collection_ [private]
 

Definition at line 123 of file ESF_Delayed_Changes.h.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
ACE_Unbounded_Queue<ACE_Command_Base*> TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::command_queue_ [private]
 

Definition at line 141 of file ESF_Delayed_Changes.h.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::connected(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::disconnected(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::reconnected(), and TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::shutdown().

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
Busy_Lock TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::lock_ [private]
 

Definition at line 127 of file ESF_Delayed_Changes.h.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
CORBA::ULong TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::max_write_delay_ [private]
 

Definition at line 139 of file ESF_Delayed_Changes.h.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
CORBA::ULong TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::write_delay_count_ [private]
 

Definition at line 135 of file ESF_Delayed_Changes.h.

Referenced by TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::connected(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::disconnected(), TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::reconnected(), and TAO_ESF_Delayed_Changes< PROXY, COLLECTION, ITERATOR, >::shutdown().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:08:53 2006 for TAO_ESF by doxygen 1.3.6