00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TAO_CEC_PROXYPUSHCONSUMER_H
00015 #define TAO_CEC_PROXYPUSHCONSUMER_H
00016
00017 #include "ace/pre.h"
00018
00019 #include "orbsvcs/CosEventChannelAdminS.h"
00020 #include "orbsvcs/CosEvent/event_serv_export.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif
00025
00026 #include "orbsvcs/ESF/ESF_Worker.h"
00027
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030 class TAO_CEC_EventChannel;
00031 class TAO_CEC_Dispatching;
00032 class TAO_CEC_ProxyPushSupplier;
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 class TAO_Event_Serv_Export TAO_CEC_ProxyPushConsumer
00048 : public POA_CosEventChannelAdmin::ProxyPushConsumer
00049 {
00050 public:
00051 typedef CosEventChannelAdmin::ProxyPushConsumer_ptr _ptr_type;
00052 typedef CosEventChannelAdmin::ProxyPushConsumer_var _var_type;
00053
00054
00055 TAO_CEC_ProxyPushConsumer (TAO_CEC_EventChannel* event_channel,
00056 const ACE_Time_Value &timeout);
00057
00058
00059 virtual ~TAO_CEC_ProxyPushConsumer (void);
00060
00061
00062 virtual void activate (
00063 CosEventChannelAdmin::ProxyPushConsumer_ptr &activated_proxy);
00064
00065
00066 virtual void deactivate (void);
00067
00068
00069 CORBA::Boolean is_connected (void) const;
00070
00071
00072
00073 CosEventComm::PushSupplier_ptr supplier (void) const;
00074
00075
00076
00077
00078
00079
00080 CORBA::Boolean supplier_non_existent (CORBA::Boolean_out disconnected);
00081
00082
00083 virtual void shutdown (void);
00084
00085
00086 CORBA::ULong _incr_refcnt (void);
00087 CORBA::ULong _decr_refcnt (void);
00088
00089
00090 virtual void connect_push_supplier (
00091 CosEventComm::PushSupplier_ptr push_supplier);
00092 virtual void push (const CORBA::Any& event);
00093 virtual void disconnect_push_consumer (void);
00094
00095
00096 virtual PortableServer::POA_ptr _default_POA (void);
00097 virtual void _add_ref (void);
00098 virtual void _remove_ref (void);
00099
00100 protected:
00101
00102
00103 void supplier (CosEventComm::PushSupplier_ptr supplier);
00104 void supplier_i (CosEventComm::PushSupplier_ptr supplier);
00105
00106 friend class TAO_CEC_ProxyPushConsumer_Guard;
00107
00108
00109
00110 CORBA::Boolean is_connected_i (void) const;
00111
00112
00113 void cleanup_i (void);
00114
00115
00116
00117 CosEventComm::PushSupplier_ptr apply_policy
00118 (CosEventComm::PushSupplier_ptr s);
00119
00120 private:
00121
00122 TAO_CEC_EventChannel* event_channel_;
00123
00124 ACE_Time_Value timeout_;
00125
00126
00127 ACE_Lock* lock_;
00128
00129
00130 CORBA::ULong refcount_;
00131
00132
00133
00134 CosEventComm::PushSupplier_var supplier_;
00135
00136
00137 CosEventComm::PushSupplier_var nopolicy_supplier_;
00138
00139
00140
00141 bool connected_;
00142
00143
00144 PortableServer::POA_var default_POA_;
00145 };
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 class TAO_Event_Serv_Export TAO_CEC_ProxyPushConsumer_Guard
00160 {
00161 public:
00162
00163 TAO_CEC_ProxyPushConsumer_Guard (ACE_Lock *lock,
00164 CORBA::ULong &refcount,
00165 TAO_CEC_EventChannel *ec,
00166 TAO_CEC_ProxyPushConsumer *proxy);
00167
00168
00169 ~TAO_CEC_ProxyPushConsumer_Guard (void);
00170
00171
00172 bool locked (void) const;
00173
00174 private:
00175
00176 ACE_Lock *lock_;
00177
00178
00179 CORBA::ULong &refcount_;
00180
00181
00182 TAO_CEC_EventChannel *event_channel_;
00183
00184
00185 TAO_CEC_ProxyPushConsumer *proxy_;
00186
00187
00188
00189 bool locked_;
00190 };
00191
00192 TAO_END_VERSIONED_NAMESPACE_DECL
00193
00194 #if defined (__ACE_INLINE__)
00195 #include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.inl"
00196 #endif
00197
00198 #include "ace/post.h"
00199
00200 #endif