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