#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 | disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)=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 ACE_ENV_ARG_DECL) |
virtual void | connected (TAO_EC_ProxyPushSupplier *supplier ACE_ENV_ARG_DECL) |
virtual void | reconnected (TAO_EC_ProxyPushSupplier *supplier ACE_ENV_ARG_DECL) |
virtual void | disconnected (TAO_EC_ProxyPushSupplier *supplier ACE_ENV_ARG_DECL) |
virtual void | connected (TAO_EC_ProxyPushConsumer *consumer ACE_ENV_ARG_DECL) |
virtual void | reconnected (TAO_EC_ProxyPushConsumer *consumer ACE_ENV_ARG_DECL) |
virtual void | disconnected (TAO_EC_ProxyPushConsumer *consumer ACE_ENV_ARG_DECL) |
virtual void | shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) |
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) |
Public Attributes | |
virtual void virtual activate(RtecEventChannelAdmin::ProxyPushConsumer_ptr &proxy ACE_ENV_ARG_DECL) ACE_THROW_SPEC((CORBA voi | deactivate )(ACE_ENV_SINGLE_ARG_DECL) |
Deactivate from the POA. | |
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 (ACE_ENV_SINGLE_ARG_DECL) |
Template method hooks. | |
virtual void | refcount_zero_hook (void) |
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 238 of file EC_ProxyConsumer.cpp. References ACE_GUARD_RETURN, and refcount_zero_hook().
00239 { 00240 { 00241 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00242 this->refcount_--; 00243 if (this->refcount_ != 0) 00244 return this->refcount_; 00245 } 00246 00247 this->refcount_zero_hook (); 00248 return 0; 00249 } |
|
Increment and decrement the reference count.
Definition at line 224 of file EC_ProxyConsumer.cpp. References ACE_GUARD_RETURN.
00225 { 00226 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00227 return this->refcount_++; 00228 } |
|
Release the filter and the supplier.
Definition at line 188 of file EC_ProxyConsumer.cpp. References TAO_EC_Supplier_Filter::_decr_refcnt(), connected_, filter_, and TAO_EC_Supplier_Filter::unbind(). Referenced by ~TAO_EC_ProxyPushConsumer().
00189 { 00190 this->supplier_ = 00191 RtecEventComm::PushSupplier::_nil (); 00192 this->connected_ = 0; 00193 00194 if (this->filter_ != 0) 00195 { 00196 this->filter_->unbind (this); 00197 this->filter_->_decr_refcnt (); 00198 this->filter_ = 0; 00199 } 00200 } |
|
Usually implemented as no-ops, but some configurations may require this methods. |
|
Concrete implementations can use this methods to keep track of the consumers interested in this events. |
|
Disconnect this from.
Referenced by TAO_EC_Reactive_SupplierControl::system_exception(). |
|
|
|
|
|
Return the current filter, assumes the locks are held.
Definition at line 58 of file EC_ProxyConsumer.i. 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.i. 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.i. References connected_. Referenced by is_connected(), supplier_non_existent(), and TAO_EC_ProxyPushConsumer_Guard::TAO_EC_ProxyPushConsumer_Guard().
00009 { 00010 return this->connected_; 00011 } |
|
The QoS (subscription) used to connect to the EC.
Definition at line 43 of file EC_ProxyConsumer.i. References ACE_GUARD_RETURN.
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.i. Referenced by TAO_EC_Per_Supplier_Filter::connected(), and TAO_EC_Per_Supplier_Filter::reconnected().
00053 { 00054 return this->qos_; 00055 } |
|
|
|
|
|
Definition at line 231 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().
00232 { 00233 // Use the event channel 00234 this->event_channel_->destroy_proxy (this); 00235 } |
|
The event channel is shutting down.
|
|
Template method hooks.
|
|
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.i. 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.i. References ACE_GUARD_RETURN. Referenced by 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.i. 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_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, is_connected_i(), CORBA::is_nil(), and supplier().
00049 { 00050 CORBA::Object_var supplier; 00051 { 00052 ACE_GUARD_THROW_EX ( 00053 ACE_Lock, ace_mon, *this->lock_, 00054 CORBA::INTERNAL ()); 00055 ACE_CHECK_RETURN (0); 00056 00057 disconnected = 0; 00058 if (this->is_connected_i () == 0) 00059 { 00060 disconnected = 1; 00061 return 0; 00062 } 00063 if (CORBA::is_nil (this->supplier_.in ())) 00064 { 00065 return 0; 00066 } 00067 supplier = CORBA::Object::_duplicate (this->supplier_.in ()); 00068 } 00069 00070 #if (TAO_HAS_MINIMUM_CORBA == 0) 00071 return supplier->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER); 00072 #else 00073 return 0; 00074 #endif /* TAO_HAS_MINIMUM_CORBA */ 00075 } |
|
Definition at line 136 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 162 of file EC_ProxyConsumer.h. Referenced by cleanup_i(), and is_connected_i(). |
|
Deactivate from the POA.
Definition at line 203 of file EC_ProxyConsumer.cpp.
00204 { 00205 ACE_TRY 00206 { 00207 PortableServer::ObjectId id = 00208 this->object_id (ACE_ENV_SINGLE_ARG_PARAMETER); 00209 ACE_TRY_CHECK; 00210 this->default_POA_->deactivate_object (id ACE_ENV_ARG_PARAMETER); 00211 ACE_TRY_CHECK; 00212 } 00213 ACE_CATCHANY 00214 { 00215 // Exceptions here should not be propagated. They usually 00216 // indicate that an object is beign disconnected twice, or some 00217 // race condition, but not a fault that the user needs to know 00218 // about. 00219 } 00220 ACE_ENDTRY; 00221 } |
|
Store the default POA.
Definition at line 168 of file EC_ProxyConsumer.h. |
|
The supplier admin, used for activation and memory managment.
Definition at line 149 of file EC_ProxyConsumer.h. |
|
The strategy to do filtering close to the supplier.
Definition at line 171 of file EC_ProxyConsumer.h. Referenced by cleanup_i(), and filter_i(). |
|
The locking strategy.
Definition at line 152 of file EC_ProxyConsumer.h. |
|
The publication and QoS information...
Definition at line 165 of file EC_ProxyConsumer.h. |
|
The reference count.
Definition at line 155 of file EC_ProxyConsumer.h. |
|
The supplier....
Definition at line 158 of file EC_ProxyConsumer.h. |