00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TAO_EC_PROXYSUPPLIER_H
00016 #define TAO_EC_PROXYSUPPLIER_H
00017
00018 #include "ace/pre.h"
00019
00020 #include "orbsvcs/RtecEventChannelAdminS.h"
00021
00022 #include "orbsvcs/Event/EC_Filter.h"
00023
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif
00027
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030 class TAO_EC_Event_Channel_Base;
00031 class TAO_EC_ProxyPushConsumer;
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 class TAO_RTEvent_Serv_Export TAO_EC_ProxyPushSupplier : public TAO_EC_Filter
00057 {
00058 public:
00059 typedef RtecEventChannelAdmin::ProxyPushSupplier Interface;
00060 typedef RtecEventChannelAdmin::ProxyPushSupplier_var _var_type;
00061 typedef RtecEventChannelAdmin::ProxyPushSupplier_ptr _ptr_type;
00062
00063
00064 TAO_EC_ProxyPushSupplier (TAO_EC_Event_Channel_Base* event_channel, int validate_connection);
00065
00066
00067 virtual ~TAO_EC_ProxyPushSupplier (void);
00068
00069
00070 virtual void activate (
00071 RtecEventChannelAdmin::ProxyPushSupplier_ptr &proxy) = 0;
00072
00073
00074 virtual void deactivate (void) throw ();
00075
00076
00077 virtual void disconnect_push_supplier () = 0;
00078
00079
00080 CORBA::Boolean is_connected (void) const;
00081
00082
00083 CORBA::Boolean is_suspended (void) const;
00084
00085
00086
00087
00088
00089 RtecEventComm::PushConsumer_ptr consumer (void) const;
00090
00091
00092 const RtecEventChannelAdmin::ConsumerQOS& subscriptions (void) const;
00093
00094
00095
00096 virtual void connected (TAO_EC_ProxyPushConsumer *consumer);
00097 virtual void reconnected (TAO_EC_ProxyPushConsumer *consumer);
00098 virtual void disconnected (TAO_EC_ProxyPushConsumer *consumer);
00099
00100
00101
00102 virtual void connected (TAO_EC_ProxyPushSupplier *supplier);
00103 virtual void reconnected (TAO_EC_ProxyPushSupplier *supplier);
00104 virtual void disconnected (TAO_EC_ProxyPushSupplier *supplier);
00105
00106
00107 virtual void shutdown (void);
00108
00109
00110
00111
00112
00113
00114
00115
00116 void push_to_consumer (RtecEventComm::PushConsumer_ptr consumer,
00117 const RtecEventComm::EventSet &event);
00118 void reactive_push_to_consumer (RtecEventComm::PushConsumer_ptr consumer,
00119 const RtecEventComm::EventSet &event);
00120
00121
00122
00123
00124
00125
00126 CORBA::Boolean consumer_non_existent (CORBA::Boolean_out disconnected);
00127
00128
00129 CORBA::ULong _incr_refcnt (void);
00130 CORBA::ULong _decr_refcnt (void);
00131
00132
00133 virtual int filter (const RtecEventComm::EventSet &event,
00134 TAO_EC_QOS_Info& qos_info);
00135 virtual int filter_nocopy (RtecEventComm::EventSet &event,
00136 TAO_EC_QOS_Info &qos_info);
00137 virtual void push (const RtecEventComm::EventSet &event,
00138 TAO_EC_QOS_Info& qos_info);
00139 virtual void push_nocopy (RtecEventComm::EventSet &event,
00140 TAO_EC_QOS_Info &qos_info);
00141 virtual void clear (void);
00142 virtual CORBA::ULong max_event_size (void) const;
00143 virtual int can_match (const RtecEventComm::EventHeader &header) const;
00144 virtual int add_dependencies (const RtecEventComm::EventHeader &header,
00145 const TAO_EC_QOS_Info &qos_info);
00146
00147 protected:
00148
00149
00150 void consumer (RtecEventComm::PushConsumer_ptr consumer);
00151 void consumer_i (RtecEventComm::PushConsumer_ptr consumer);
00152
00153 void suspend_connection_i (void);
00154 void resume_connection_i (void);
00155 void suspend_connection_locked (void);
00156 void resume_connection_locked (void);
00157
00158
00159 CORBA::Boolean is_connected_i (void) const;
00160
00161
00162 void cleanup_i (void);
00163
00164
00165 TAO_EC_Event_Channel_Base* event_channel_;
00166
00167
00168 ACE_Lock* lock_;
00169
00170
00171 CORBA::ULong refcount_;
00172
00173
00174 RtecEventComm::PushConsumer_var consumer_;
00175
00176
00177 CORBA::Boolean suspended_;
00178
00179
00180 RtecEventChannelAdmin::ConsumerQOS qos_;
00181
00182
00183 PortableServer::POA_var default_POA_;
00184
00185
00186 TAO_EC_Filter* child_;
00187
00188
00189 int consumer_validate_connection_;
00190 private:
00191
00192
00193 virtual void refcount_zero_hook (void);
00194 virtual void pre_dispatch_hook (RtecEventComm::EventSet&);
00195 virtual PortableServer::ObjectId
00196 object_id (void)
00197 = 0;
00198 };
00199
00200 TAO_END_VERSIONED_NAMESPACE_DECL
00201
00202 #if defined (__ACE_INLINE__)
00203 #include "orbsvcs/Event/EC_ProxySupplier.inl"
00204 #endif
00205
00206 #include "ace/post.h"
00207
00208 #endif