#include <EC_ProxyConsumer.h>
Inheritance diagram for TAO_EC_ProxyPushConsumer:
Public Types | |
typedef RtecEventChannelAdmin::ProxyPushConsumer | Interface |
typedef RtecEventChannelAdmin::ProxyPushConsumer_var | _var_type |
typedef RtecEventChannelAdmin::ProxyPushConsumer_ptr | _ptr_type |
Public Member Functions | |
TAO_EC_ProxyPushConsumer (TAO_EC_Event_Channel_Base *event_channel) | |
constructor... | |
virtual | ~TAO_EC_ProxyPushConsumer (void) |
destructor... | |
virtual void | activate (RtecEventChannelAdmin::ProxyPushConsumer_ptr &proxy)=0 |
Activate in the POA. | |
virtual void | deactivate (void) |
Deactivate from the POA. | |
virtual void | disconnect_push_consumer ()=0 |
Disconnect this from. | |
CORBA::Boolean | is_connected (void) const |
Return 0 if no supplier is connected... | |
RtecEventComm::PushSupplier_ptr | supplier (void) const |
const RtecEventChannelAdmin::SupplierQOS & | publications (void) const |
The QoS (subscription) used to connect to the EC. | |
CORBA::Boolean | supplier_non_existent (CORBA::Boolean_out disconnected) |
virtual void | connected (TAO_EC_ProxyPushSupplier *supplier) |
virtual void | reconnected (TAO_EC_ProxyPushSupplier *supplier) |
virtual void | disconnected (TAO_EC_ProxyPushSupplier *supplier) |
virtual void | connected (TAO_EC_ProxyPushConsumer *consumer) |
virtual void | reconnected (TAO_EC_ProxyPushConsumer *consumer) |
virtual void | disconnected (TAO_EC_ProxyPushConsumer *consumer) |
virtual void | shutdown (void) |
The event channel is shutting down. | |
const RtecEventChannelAdmin::SupplierQOS & | publications_i (void) const |
CORBA::ULong | _incr_refcnt (void) |
Increment and decrement the reference count. | |
CORBA::ULong | _decr_refcnt (void) |
Protected Member Functions | |
void | supplier (RtecEventComm::PushSupplier_ptr supplier) |
void | supplier_i (RtecEventComm::PushSupplier_ptr supplier) |
CORBA::Boolean | is_connected_i (void) const |
The private version (without locking) of is_connected(). | |
TAO_EC_Supplier_Filter * | filter_i (void) const |
Return the current filter, assumes the locks are held. | |
void | cleanup_i (void) |
Release the filter and the supplier. | |
Protected Attributes | |
TAO_EC_Event_Channel_Base * | event_channel_ |
The supplier admin, used for activation and memory managment. | |
ACE_Lock * | lock_ |
The locking strategy. | |
CORBA::ULong | refcount_ |
The reference count. | |
RtecEventComm::PushSupplier_var | supplier_ |
The supplier.... | |
int | connected_ |
RtecEventChannelAdmin::SupplierQOS | qos_ |
The publication and QoS information... | |
PortableServer::POA_var | default_POA_ |
Store the default POA. | |
TAO_EC_Supplier_Filter * | filter_ |
The strategy to do filtering close to the supplier. | |
Private Member Functions | |
virtual void | shutdown_hook (void) |
Template method hooks. | |
virtual void | refcount_zero_hook (void) |
virtual PortableServer::ObjectId | object_id (void)=0 |
Friends | |
class | TAO_EC_ProxyPushConsumer_Guard |
Implement the RtecEventChannelAdmin::ProxyPushConsumer interface, remember that this class is used to communicate with a PushSupplier, so, in effect, this is the ambassador for a supplier inside the event channel.
It makes a copy of the SupplierQOS and the supplier object reference. It uses bind/unbind to control the lifetime of the Supplier_Filter object. The object commits suicide when disconnect_push_consumer() is called.
No provisions for locking, access must be serialized externally.
Definition at line 56 of file EC_ProxyConsumer.h.
|
Definition at line 61 of file EC_ProxyConsumer.h. |
|
Definition at line 60 of file EC_ProxyConsumer.h. |
|
Definition at line 59 of file EC_ProxyConsumer.h. |
|
constructor...
Definition at line 23 of file EC_ProxyConsumer.cpp. References TAO_EC_Event_Channel_Base::consumer_poa(), TAO_EC_Event_Channel_Base::create_consumer_lock(), and RtecEventChannelAdmin::SupplierQOS::is_gateway.
00024 : event_channel_ (ec), 00025 refcount_ (1), 00026 connected_ (0), 00027 filter_ (0) 00028 { 00029 this->lock_ = 00030 this->event_channel_->create_consumer_lock (); 00031 00032 this->default_POA_ = 00033 this->event_channel_->consumer_poa (); 00034 00035 this->qos_.is_gateway = 0; 00036 } |
|
destructor...
Definition at line 38 of file EC_ProxyConsumer.cpp. References cleanup_i(), and TAO_EC_Event_Channel_Base::destroy_consumer_lock().
00039 { 00040 this->event_channel_->destroy_consumer_lock (this->lock_); 00041 this->cleanup_i (); 00042 } |
|
Definition at line 221 of file EC_ProxyConsumer.cpp. References ACE_GUARD_RETURN, and refcount_zero_hook(). Referenced by TAO_EC_Default_ProxyPushConsumer::_remove_ref().
00222 { 00223 { 00224 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00225 this->refcount_--; 00226 if (this->refcount_ != 0) 00227 return this->refcount_; 00228 } 00229 00230 this->refcount_zero_hook (); 00231 return 0; 00232 } |
|
Increment and decrement the reference count.
Definition at line 207 of file EC_ProxyConsumer.cpp. References ACE_GUARD_RETURN. Referenced by TAO_EC_Default_ProxyPushConsumer::_add_ref().
00208 { 00209 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00210 return this->refcount_++; 00211 } |
|
Activate in the POA.
Implemented in TAO_EC_Default_ProxyPushConsumer. |
|
Release the filter and the supplier.
Definition at line 174 of file EC_ProxyConsumer.cpp. References TAO_EC_Supplier_Filter::_decr_refcnt(), connected_, filter_, and TAO_EC_Supplier_Filter::unbind(). Referenced by TAO_EC_Default_ProxyPushConsumer::connect_push_supplier(), TAO_EC_Default_ProxyPushConsumer::disconnect_push_consumer(), shutdown(), and ~TAO_EC_ProxyPushConsumer().
00175 { 00176 this->supplier_ = 00177 RtecEventComm::PushSupplier::_nil (); 00178 this->connected_ = 0; 00179 00180 if (this->filter_ != 0) 00181 { 00182 this->filter_->unbind (this); 00183 this->filter_->_decr_refcnt (); 00184 this->filter_ = 0; 00185 } 00186 } |
|
Usually implemented as no-ops, but some configurations may require this methods. Definition at line 115 of file EC_ProxyConsumer.cpp.
00116 { 00117 } |
|
Concrete implementations can use this methods to keep track of the consumers interested in this events. Definition at line 76 of file EC_ProxyConsumer.cpp. References TAO_EC_Supplier_Filter::connected(), TAO_EC_ProxyPushConsumer_Guard::filter, and TAO_EC_ProxyPushConsumer_Guard::locked().
00077 { 00078 TAO_EC_ProxyPushConsumer_Guard ace_mon (this->lock_, 00079 this->refcount_, 00080 this->event_channel_, 00081 this); 00082 if (!ace_mon.locked ()) 00083 return; 00084 00085 ace_mon.filter->connected (supplier); 00086 } |
|
Deactivate from the POA.
Definition at line 189 of file EC_ProxyConsumer.cpp. References object_id(). Referenced by shutdown().
00190 { 00191 try 00192 { 00193 PortableServer::ObjectId id = 00194 this->object_id (); 00195 this->default_POA_->deactivate_object (id); 00196 } 00197 catch (const CORBA::Exception&) 00198 { 00199 // Exceptions here should not be propagated. They usually 00200 // indicate that an object is beign disconnected twice, or some 00201 // race condition, but not a fault that the user needs to know 00202 // about. 00203 } 00204 } |
|
Disconnect this from.
Implemented in TAO_EC_Default_ProxyPushConsumer, and TAO_EC_TPC_ProxyPushConsumer. Referenced by TAO_EC_Reactive_SupplierControl::supplier_not_exist(), and TAO_EC_Reactive_SupplierControl::system_exception(). |
|
Definition at line 125 of file EC_ProxyConsumer.cpp.
00126 { 00127 } |
|
Definition at line 102 of file EC_ProxyConsumer.cpp. References TAO_EC_Supplier_Filter::disconnected(), TAO_EC_ProxyPushConsumer_Guard::filter, and TAO_EC_ProxyPushConsumer_Guard::locked().
00103 { 00104 TAO_EC_ProxyPushConsumer_Guard ace_mon (this->lock_, 00105 this->refcount_, 00106 this->event_channel_, 00107 this); 00108 if (!ace_mon.locked ()) 00109 return; 00110 00111 ace_mon.filter->disconnected (supplier); 00112 } |
|
Return the current filter, assumes the locks are held.
Definition at line 58 of file EC_ProxyConsumer.inl. References filter_. Referenced by TAO_EC_ProxyPushConsumer_Guard::TAO_EC_ProxyPushConsumer_Guard().
00059 { 00060 return this->filter_; 00061 } |
|
Return 0 if no supplier is connected...
Definition at line 14 of file EC_ProxyConsumer.inl. References ACE_GUARD_RETURN, and is_connected_i().
00015 { 00016 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00017 00018 return this->is_connected_i (); 00019 } |
|
The private version (without locking) of is_connected().
Definition at line 8 of file EC_ProxyConsumer.inl. References connected_. Referenced by TAO_EC_Default_ProxyPushConsumer::connect_push_supplier(), TAO_EC_Default_ProxyPushConsumer::disconnect_push_consumer(), is_connected(), supplier_non_existent(), and TAO_EC_ProxyPushConsumer_Guard::TAO_EC_ProxyPushConsumer_Guard().
00009 { 00010 return this->connected_; 00011 } |
|
Implemented in TAO_EC_Default_ProxyPushConsumer. Referenced by deactivate(). |
|
The QoS (subscription) used to connect to the EC.
Definition at line 43 of file EC_ProxyConsumer.inl. References ACE_GUARD_RETURN. Referenced by TAO_EC_Priority_Scheduling::add_proxy_supplier_dependencies(), TAO_EC_Kokyu_Scheduling::add_proxy_supplier_dependencies(), TAO_EC_Priority_Scheduling::schedule_event(), TAO_EC_Kokyu_Scheduling::schedule_event(), TAO_EC_Reactive_ObserverStrategy::supplier_qos_update(), TAO_EC_Basic_ObserverStrategy::supplier_qos_update(), and TAO_EC_Accumulate_Consumer_Headers::work().
00044 { 00045 // @@ TODO There should some way to signal errors here. 00046 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, this->qos_); 00047 00048 return this->qos_; 00049 } |
|
The QoS (subscription) used to connect to the EC, assumes the locks are held, use with care! Definition at line 52 of file EC_ProxyConsumer.inl. Referenced by TAO_EC_Per_Supplier_Filter::connected(), and TAO_EC_Per_Supplier_Filter::reconnected().
00053 { 00054 return this->qos_; 00055 } |
|
Definition at line 120 of file EC_ProxyConsumer.cpp.
00121 { 00122 } |
|
Definition at line 89 of file EC_ProxyConsumer.cpp. References TAO_EC_ProxyPushConsumer_Guard::filter, TAO_EC_ProxyPushConsumer_Guard::locked(), and TAO_EC_Supplier_Filter::reconnected().
00090 { 00091 TAO_EC_ProxyPushConsumer_Guard ace_mon (this->lock_, 00092 this->refcount_, 00093 this->event_channel_, 00094 this); 00095 if (!ace_mon.locked ()) 00096 return; 00097 00098 ace_mon.filter->reconnected (supplier); 00099 } |
|
Definition at line 214 of file EC_ProxyConsumer.cpp. References TAO_EC_Event_Channel_Base::destroy_proxy(). Referenced by _decr_refcnt(), and TAO_EC_ProxyPushConsumer_Guard::~TAO_EC_ProxyPushConsumer_Guard().
00215 { 00216 // Use the event channel 00217 this->event_channel_->destroy_proxy (this); 00218 } |
|
The event channel is shutting down.
Definition at line 135 of file EC_ProxyConsumer.cpp. References ACE_GUARD_THROW_EX, cleanup_i(), connected_, deactivate(), filter_, CORBA::is_nil(), TAO_EC_Supplier_Filter::shutdown(), shutdown_hook(), and supplier().
00136 { 00137 RtecEventComm::PushSupplier_var supplier; 00138 00139 { 00140 ACE_GUARD_THROW_EX ( 00141 ACE_Lock, ace_mon, *this->lock_, 00142 RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); 00143 00144 supplier = this->supplier_._retn (); 00145 this->connected_ = 0; 00146 00147 this->shutdown_hook (); 00148 00149 if (this->filter_ != 0) 00150 { 00151 this->filter_->shutdown (); 00152 00153 this->cleanup_i (); 00154 } 00155 } 00156 00157 this->deactivate (); 00158 00159 if (CORBA::is_nil (supplier.in ())) 00160 return; 00161 00162 try 00163 { 00164 supplier->disconnect_push_supplier (); 00165 } 00166 catch (const CORBA::Exception&) 00167 { 00168 // Ignore exceptions, we must isolate other clients from 00169 // failures on this one. 00170 } 00171 } |
|
Template method hooks.
Definition at line 130 of file EC_ProxyConsumer.cpp. Referenced by shutdown().
00131 { 00132 } |
|
Set the supplier, used by some implementations to change the policies used when invoking operations on the supplier. Definition at line 35 of file EC_ProxyConsumer.inl. References ACE_GUARD, and supplier_i().
00036 { 00037 ACE_GUARD (ACE_Lock, ace_mon, *this->lock_); 00038 00039 this->supplier_i (supplier); 00040 } |
|
Return the consumer object reference. It returns nil() if it has not connected yet. Definition at line 22 of file EC_ProxyConsumer.inl. References ACE_GUARD_RETURN. Referenced by shutdown(), and supplier_non_existent().
00023 { 00024 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00025 return RtecEventComm::PushSupplier::_duplicate (this->supplier_.in ()); 00026 } |
|
Definition at line 29 of file EC_ProxyConsumer.inl. Referenced by supplier().
00030 { 00031 this->supplier_ = supplier; 00032 } |
|
Invoke the _non_existent() pseudo-operation on the supplier. If it is disconnected then it returns true and sets the flag. Definition at line 46 of file EC_ProxyConsumer.cpp. References CORBA::Object::_duplicate(), ACE_GUARD_THROW_EX, is_connected_i(), CORBA::is_nil(), and supplier(). Referenced by TAO_EC_Ping_Supplier::work().
00048 { 00049 CORBA::Object_var supplier; 00050 { 00051 ACE_GUARD_THROW_EX ( 00052 ACE_Lock, ace_mon, *this->lock_, 00053 CORBA::INTERNAL ()); 00054 00055 disconnected = 0; 00056 if (this->is_connected_i () == 0) 00057 { 00058 disconnected = 1; 00059 return 0; 00060 } 00061 if (CORBA::is_nil (this->supplier_.in ())) 00062 { 00063 return 0; 00064 } 00065 supplier = CORBA::Object::_duplicate (this->supplier_.in ()); 00066 } 00067 00068 #if (TAO_HAS_MINIMUM_CORBA == 0) 00069 return supplier->_non_existent (); 00070 #else 00071 return 0; 00072 #endif /* TAO_HAS_MINIMUM_CORBA */ 00073 } |
|
Definition at line 127 of file EC_ProxyConsumer.h. |
|
If the flag is not zero then we are connected, notice that the supplier can be nil. Definition at line 153 of file EC_ProxyConsumer.h. Referenced by cleanup_i(), is_connected_i(), and shutdown(). |
|
Store the default POA.
Definition at line 159 of file EC_ProxyConsumer.h. |
|
The supplier admin, used for activation and memory managment.
Definition at line 140 of file EC_ProxyConsumer.h. |
|
The strategy to do filtering close to the supplier.
Definition at line 162 of file EC_ProxyConsumer.h. Referenced by cleanup_i(), filter_i(), and shutdown(). |
|
The locking strategy.
Definition at line 143 of file EC_ProxyConsumer.h. |
|
The publication and QoS information...
Definition at line 156 of file EC_ProxyConsumer.h. |
|
The reference count.
Definition at line 146 of file EC_ProxyConsumer.h. |
|
The supplier....
Definition at line 149 of file EC_ProxyConsumer.h. |