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
00057
00058 virtual ~TAO_CEC_ProxyPushConsumer (void);
00059
00060
00061 virtual void activate (
00062 CosEventChannelAdmin::ProxyPushConsumer_ptr &activated_proxy
00063 ACE_ENV_ARG_DECL)
00064 ACE_THROW_SPEC ((CORBA::SystemException));
00065
00066
00067 virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL)
00068 ACE_THROW_SPEC ((CORBA::SystemException));
00069
00070
00071 CORBA::Boolean is_connected (void) const;
00072
00073
00074
00075 CosEventComm::PushSupplier_ptr supplier (void) const;
00076
00077
00078
00079
00080
00081
00082 CORBA::Boolean supplier_non_existent (CORBA::Boolean_out disconnected
00083 ACE_ENV_ARG_DECL);
00084
00085
00086 virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
00087
00088
00089 CORBA::ULong _incr_refcnt (void);
00090 CORBA::ULong _decr_refcnt (void);
00091
00092
00093 virtual void connect_push_supplier (
00094 CosEventComm::PushSupplier_ptr push_supplier
00095 ACE_ENV_ARG_DECL_NOT_USED)
00096 ACE_THROW_SPEC ((CORBA::SystemException,
00097 CosEventChannelAdmin::AlreadyConnected));
00098 virtual void push (const CORBA::Any& event
00099 ACE_ENV_ARG_DECL_NOT_USED)
00100 ACE_THROW_SPEC ((CORBA::SystemException));
00101 virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
00102 ACE_THROW_SPEC ((CORBA::SystemException));
00103
00104
00105 virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
00106 virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
00107 virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
00108
00109 protected:
00110
00111
00112 void supplier (CosEventComm::PushSupplier_ptr supplier);
00113 void supplier_i (CosEventComm::PushSupplier_ptr supplier);
00114
00115 friend class TAO_CEC_ProxyPushConsumer_Guard;
00116
00117
00118
00119 CORBA::Boolean is_connected_i (void) const;
00120
00121
00122 void cleanup_i (void);
00123
00124 private:
00125
00126 TAO_CEC_EventChannel* event_channel_;
00127
00128
00129 ACE_Lock* lock_;
00130
00131
00132 CORBA::ULong refcount_;
00133
00134
00135 CosEventComm::PushSupplier_var supplier_;
00136
00137
00138
00139 bool connected_;
00140
00141
00142 PortableServer::POA_var default_POA_;
00143 };
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 class TAO_Event_Serv_Export TAO_CEC_ProxyPushConsumer_Guard
00158 {
00159 public:
00160
00161 TAO_CEC_ProxyPushConsumer_Guard (ACE_Lock *lock,
00162 CORBA::ULong &refcount,
00163 TAO_CEC_EventChannel *ec,
00164 TAO_CEC_ProxyPushConsumer *proxy);
00165
00166
00167 ~TAO_CEC_ProxyPushConsumer_Guard (void);
00168
00169
00170 bool locked (void) const;
00171
00172 private:
00173
00174 ACE_Lock *lock_;
00175
00176
00177 CORBA::ULong &refcount_;
00178
00179
00180 TAO_CEC_EventChannel *event_channel_;
00181
00182
00183 TAO_CEC_ProxyPushConsumer *proxy_;
00184
00185
00186
00187 bool locked_;
00188 };
00189
00190 TAO_END_VERSIONED_NAMESPACE_DECL
00191
00192 #if defined (__ACE_INLINE__)
00193 #include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.i"
00194 #endif
00195
00196 #include "ace/post.h"
00197
00198 #endif