00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef TAO_ESF_DELAYED_CHANGES_H
00013 #define TAO_ESF_DELAYED_CHANGES_H
00014
00015 #include "orbsvcs/ESF/ESF_Proxy_Collection.h"
00016
00017 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00018 # pragma once
00019 #endif
00020
00021 #include "orbsvcs/ESF/ESF_Busy_Lock.h"
00022
00023 #include "ace/Containers.h"
00024
00025 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00026 class ACE_Command_Base;
00027 ACE_END_VERSIONED_NAMESPACE_DECL
00028
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030
00031 template<class Target,class Object> class TAO_ESF_Connected_Command;
00032 template<class Target,class Object> class TAO_ESF_Disconnected_Command;
00033 template<class Target,class Object> class TAO_ESF_Reconnected_Command;
00034 template<class Target> class TAO_ESF_Shutdown_Command;
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
00088 class TAO_ESF_Delayed_Changes : public TAO_ESF_Proxy_Collection<PROXY>
00089 {
00090 public:
00091 TAO_ESF_Delayed_Changes (void);
00092 TAO_ESF_Delayed_Changes (const COLLECTION &collection);
00093
00094 int busy (void);
00095 int idle (void);
00096 int execute_delayed_operations (void);
00097
00098 void connected_i (PROXY *proxy
00099 ACE_ENV_ARG_DECL);
00100 void reconnected_i (PROXY *proxy
00101 ACE_ENV_ARG_DECL);
00102 void disconnected_i (PROXY *proxy
00103 ACE_ENV_ARG_DECL);
00104 void shutdown_i (ACE_ENV_SINGLE_ARG_DECL);
00105
00106 typedef TAO_ESF_Connected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> Connected_Command;
00107 typedef TAO_ESF_Reconnected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> Reconnected_Command;
00108 typedef TAO_ESF_Disconnected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> Disconnected_Command;
00109 typedef TAO_ESF_Shutdown_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE> > Shutdown_Command;
00110
00111
00112 virtual void for_each (TAO_ESF_Worker<PROXY> *worker
00113 ACE_ENV_ARG_DECL);
00114 virtual void connected (PROXY *proxy
00115 ACE_ENV_ARG_DECL);
00116 virtual void reconnected (PROXY *proxy
00117 ACE_ENV_ARG_DECL);
00118 virtual void disconnected (PROXY *proxy
00119 ACE_ENV_ARG_DECL);
00120 virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
00121
00122 private:
00123 COLLECTION collection_;
00124
00125 typedef TAO_ESF_Busy_Lock_Adapter<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE> > Busy_Lock;
00126
00127 Busy_Lock lock_;
00128
00129 ACE_SYNCH_MUTEX_T busy_lock_;
00130
00131 ACE_SYNCH_CONDITION_T busy_cond_;
00132
00133 CORBA::ULong busy_count_;
00134
00135 CORBA::ULong write_delay_count_;
00136
00137
00138 CORBA::ULong busy_hwm_;
00139 CORBA::ULong max_write_delay_;
00140
00141 ACE_Unbounded_Queue<ACE_Command_Base*> command_queue_;
00142 };
00143
00144
00145
00146 TAO_END_VERSIONED_NAMESPACE_DECL
00147
00148 #if defined (__ACE_INLINE__)
00149 #include "orbsvcs/ESF/ESF_Delayed_Changes.i"
00150 #endif
00151
00152 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00153 #include "orbsvcs/ESF/ESF_Delayed_Changes.cpp"
00154 #endif
00155
00156 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00157 #pragma implementation ("ESF_Delayed_Changes.cpp")
00158 #endif
00159
00160 #endif