#include <EC_Gateway_IIOP.h>
Inheritance diagram for TAO_EC_Gateway_IIOP:
Public Member Functions | |
TAO_EC_Gateway_IIOP (void) | |
virtual | ~TAO_EC_Gateway_IIOP (void) |
int | init (RtecEventChannelAdmin::EventChannel_ptr supplier_ec, RtecEventChannelAdmin::EventChannel_ptr consumer_ec ACE_ENV_ARG_DECL) |
void | disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) |
The channel is disconnecting. | |
void | disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) |
The channel is disconnecting. | |
void | push (const RtecEventComm::EventSet &events ACE_ENV_ARG_DECL_WITH_DEFAULTS) |
int | shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) |
Disconnect and shutdown the gateway. | |
virtual void | close (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) |
virtual void | update_consumer (const RtecEventChannelAdmin::ConsumerQOS &sub ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException) |
virtual void | update_supplier (const RtecEventChannelAdmin::SupplierQOS &pub ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException) |
void | reconnect_consumer_ec (ACE_ENV_SINGLE_ARG_DECL) |
CORBA::Boolean | consumer_ec_non_existent (CORBA::Boolean_out disconnected ACE_ENV_ARG_DECL) |
Check whether the consumer event channel is non existent or not. | |
void | cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_DECL) |
int | cleanup_consumer_ec (void) |
int | cleanup_supplier_ec (void) |
void | suspend_supplier_ec (ACE_ENV_SINGLE_ARG_DECL) |
Suspend the connection to the supplier ec. | |
void | resume_supplier_ec (ACE_ENV_SINGLE_ARG_DECL) |
Resume the connection to the supplier ec. | |
Protected Types | |
typedef ACE_Map_Manager< RtecEventComm::EventSourceID, RtecEventChannelAdmin::ProxyPushConsumer_ptr, ACE_Null_Mutex > | Consumer_Map |
typedef ACE_Map_Iterator< RtecEventComm::EventSourceID, RtecEventChannelAdmin::ProxyPushConsumer_ptr, ACE_Null_Mutex > | Consumer_Map_Iterator |
Protected Member Functions | |
int | init_i (RtecEventChannelAdmin::EventChannel_ptr supplier_ec, RtecEventChannelAdmin::EventChannel_ptr consumer_ec ACE_ENV_ARG_DECL) |
Do the real work in init(). | |
Protected Attributes | |
TAO_SYNCH_MUTEX | lock_ |
Lock to synchronize internal changes. | |
CORBA::ULong | busy_count_ |
int | update_posted_ |
RtecEventChannelAdmin::ConsumerQOS | c_qos_ |
int | cleanup_posted_ |
int | supplier_ec_suspended_ |
RtecEventChannelAdmin::EventChannel_var | supplier_ec_ |
RtecEventChannelAdmin::EventChannel_var | consumer_ec_ |
The event channel acting as consumer of this gateway. | |
RtecBase::handle_t | supplier_info_ |
Our RT_Infos for the event channel that is the supplier. | |
RtecBase::handle_t | consumer_info_ |
Our RT_Infos for the event channel that is the consumer. | |
ACE_PushConsumer_Adapter< TAO_EC_Gateway_IIOP > | consumer_ |
Our consumer personality.... | |
int | consumer_is_active_ |
If it is not 0 then we must deactivate the consumer. | |
ACE_PushSupplier_Adapter< TAO_EC_Gateway_IIOP > | supplier_ |
Our supplier personality.... | |
int | supplier_is_active_ |
If it is not 0 then we must deactivate the supplier. | |
Consumer_Map | consumer_proxy_map_ |
RtecEventChannelAdmin::ProxyPushConsumer_var | default_consumer_proxy_ |
RtecEventChannelAdmin::ProxyPushSupplier_var | supplier_proxy_ |
TAO_ECG_ConsumerEC_Control * | ec_control_ |
TAO_EC_Gateway_IIOP_Factory * | factory_ |
The Gateway IIOP Factory for all the settings. | |
int | use_ttl_ |
If 1, we use the TTL flags, if 0, we just ignore TTL. | |
int | use_consumer_proxy_map_ |
Private Member Functions | |
void | close_i (ACE_ENV_SINGLE_ARG_DECL) |
void | disconnect_supplier_proxy_i (ACE_ENV_SINGLE_ARG_DECL) |
Disconnect the supplier proxy. | |
void | disconnect_consumer_proxies_i (ACE_ENV_SINGLE_ARG_DECL) |
Disconnect all consumer proxies. | |
void | cleanup_consumer_proxies_i (ACE_ENV_SINGLE_ARG_DECL) |
Remove all consumer proxies without calling disconnect on them. | |
void | update_consumer_i (const RtecEventChannelAdmin::ConsumerQOS &sub ACE_ENV_ARG_DECL) |
void | open_i (const RtecEventChannelAdmin::ConsumerQOS &sub ACE_ENV_ARG_DECL) |
Create all connections to consumer ec and to supplier ec. | |
CORBA::Boolean | is_consumer_ec_connected_i (void) const |
Helper method to see if consumer ec is connected. | |
void | push_to_consumer (RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer, const RtecEventComm::EventSet &event ACE_ENV_ARG_DECL) |
Push the event to the consumer. | |
void | cleanup_consumer_ec_i (void) |
void | cleanup_supplier_ec_i (void) |
This class mediates among two event channels, it connects as a consumer of events with a remote event channel, and as a supplier of events with the local EC. As a consumer it gives a QoS designed to only accept the events in which *local* consumers are interested. Eventually the local EC should create this object and compute its QoS in an automated manner; but this requires some way to filter out the peers registered as consumers, otherwise we will get loops in the QoS graph. It uses exactly the same set of events in the publications list when connected as a supplier.
Definition at line 65 of file EC_Gateway_IIOP.h.
|
Definition at line 220 of file EC_Gateway_IIOP.h. |
|
Definition at line 221 of file EC_Gateway_IIOP.h. |
|
|
Definition at line 56 of file EC_Gateway_IIOP.cpp. References ec_control_.
00057 { 00058 delete ec_control_; 00059 ec_control_ = 0; 00060 } |
|
Cleanup the connection to the consumer ec. Doesn't call anything on the ec again, just set the object to nil Definition at line 623 of file EC_Gateway_IIOP.cpp. References ACE_GUARD_RETURN, cleanup_consumer_ec_i(), and TAO_SYNCH_MUTEX. Referenced by TAO_ECG_Reactive_ConsumerEC_Control::system_exception().
00624 { 00625 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1); 00626 00627 this->cleanup_consumer_ec_i (); 00628 00629 return 0; 00630 } |
|
Definition at line 643 of file EC_Gateway_IIOP.cpp. References consumer_ec_. Referenced by cleanup_consumer_ec().
00644 { 00645 this->consumer_ec_ = 00646 RtecEventChannelAdmin::EventChannel::_nil (); 00647 } |
|
Cleanup all consumer proxies we have without trying to tell the consumer that we are going to disconnect. This can be used to cleanup the consumer proxy administration in case we know that the consumers are all unreachable. Referenced by TAO_ECG_Reconnect_ConsumerEC_Control::system_exception(), and TAO_ECG_Reactive_ConsumerEC_Control::system_exception(). |
|
Remove all consumer proxies without calling disconnect on them.
|
|
Cleanup the connection to the supplier ec. Doesn't call anything on the ec again, just set the object to nil Definition at line 633 of file EC_Gateway_IIOP.cpp. References ACE_GUARD_RETURN, cleanup_supplier_ec_i(), and TAO_SYNCH_MUTEX.
00634 { 00635 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1); 00636 00637 this->cleanup_supplier_ec_i (); 00638 00639 return 0; 00640 } |
|
Definition at line 650 of file EC_Gateway_IIOP.cpp. References supplier_ec_. Referenced by cleanup_supplier_ec().
00651 { 00652 this->supplier_ec_ = 00653 RtecEventChannelAdmin::EventChannel::_nil (); 00654 } |
|
The gateway must disconnect from all the relevant event channels, or any other communication media (such as multicast groups). Implements TAO_EC_Gateway. |
|
|
|
Check whether the consumer event channel is non existent or not.
Definition at line 663 of file EC_Gateway_IIOP.cpp. References CORBA::Object::_duplicate(), ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, is_consumer_ec_connected_i(), and TAO_SYNCH_MUTEX. Referenced by TAO_ECG_Reconnect_ConsumerEC_Control::query_eventchannel(), TAO_ECG_Reactive_ConsumerEC_Control::query_eventchannel(), and TAO_ECG_Reconnect_ConsumerEC_Control::try_reconnect().
00666 { 00667 CORBA::Object_var consumer_ec; 00668 { 00669 ACE_GUARD_THROW_EX ( 00670 TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00671 CORBA::INTERNAL ()); 00672 ACE_CHECK_RETURN (0); 00673 00674 disconnected = 0; 00675 if (this->is_consumer_ec_connected_i () == 0) 00676 { 00677 disconnected = 1; 00678 return 0; 00679 } 00680 00681 consumer_ec = CORBA::Object::_duplicate (this->consumer_ec_.in ()); 00682 } 00683 00684 #if (TAO_HAS_MINIMUM_CORBA == 0) 00685 return consumer_ec->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER); 00686 #else 00687 return 0; 00688 #endif /* TAO_HAS_MINIMUM_CORBA */ 00689 } |
|
Disconnect all consumer proxies.
|
|
The channel is disconnecting.
|
|
The channel is disconnecting.
|
|
Disconnect the supplier proxy.
|
|
To do its job this class requires to know the local and remote ECs it will connect to.
Definition at line 63 of file EC_Gateway_IIOP.cpp. References ACE_ENV_ARG_PARAMETER, ACE_GUARD_RETURN, init_i(), and TAO_SYNCH_MUTEX.
00066 { 00067 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1); 00068 00069 return this->init_i (supplier_ec, consumer_ec ACE_ENV_ARG_PARAMETER); 00070 } |
|
Do the real work in init().
Definition at line 73 of file EC_Gateway_IIOP.cpp. References ACE_ERROR_RETURN, TAO_ECG_ConsumerEC_Control::activate(), consumer_ec_, TAO_EC_Gateway_IIOP_Factory::create_consumerec_control(), ec_control_, CORBA::is_nil(), LM_ERROR, and supplier_ec_. Referenced by TAO_EC_Gateway_Sched::init(), and init().
00076 { 00077 if (CORBA::is_nil (this->supplier_ec_.in ()) && CORBA::is_nil (this->consumer_ec_.in ())) 00078 { 00079 this->supplier_ec_ = 00080 RtecEventChannelAdmin::EventChannel::_duplicate (supplier_ec); 00081 this->consumer_ec_ = 00082 RtecEventChannelAdmin::EventChannel::_duplicate (consumer_ec); 00083 00084 if (ec_control_ == 0) 00085 { 00086 ec_control_ = factory_->create_consumerec_control(this); 00087 ec_control_->activate(); 00088 } 00089 00090 return 0; 00091 } 00092 else 00093 ACE_ERROR_RETURN ((LM_ERROR, 00094 "TAO_EC_Gateway_IIOP - init_i " 00095 "Supplier and consumer event channel reference " 00096 "should be nil.\n"), -1); 00097 } |
|
Helper method to see if consumer ec is connected.
Definition at line 657 of file EC_Gateway_IIOP.cpp. References CORBA::is_nil(). Referenced by consumer_ec_non_existent().
00658 { 00659 return !CORBA::is_nil (this->consumer_ec_.in ()); 00660 } |
|
Create all connections to consumer ec and to supplier ec.
|
|
This is the consumer side behavior, it pushes the events to the local event channel. |
|
Push the event to the consumer.
|
|
Referenced by TAO_ECG_Reconnect_ConsumerEC_Control::reconnect(). |
|
Resume the connection to the supplier ec.
|
|
Disconnect and shutdown the gateway.
|
|
Suspend the connection to the supplier ec.
Referenced by TAO_ECG_Reconnect_ConsumerEC_Control::system_exception(). |
|
|
|
|
|
|
|
How many threads are running push() we cannot make changes until that reaches 0 Definition at line 174 of file EC_Gateway_IIOP.h. |
|
Definition at line 182 of file EC_Gateway_IIOP.h. |
|
We have a cleanup outstanding and must wait doing cleanup until all pushes are ready. Definition at line 188 of file EC_Gateway_IIOP.h. |
|
Our consumer personality....
Definition at line 208 of file EC_Gateway_IIOP.h. |
|
The event channel acting as consumer of this gateway.
Definition at line 200 of file EC_Gateway_IIOP.h. Referenced by cleanup_consumer_ec_i(), and init_i(). |
|
Our RT_Infos for the event channel that is the consumer.
Definition at line 205 of file EC_Gateway_IIOP.h. |
|
If it is not 0 then we must deactivate the consumer.
Definition at line 211 of file EC_Gateway_IIOP.h. |
|
We talk to the EC (as a supplier) using either an per-supplier proxy or a generic proxy for the type only subscriptions. We push the events to these proxies Definition at line 226 of file EC_Gateway_IIOP.h. |
|
Definition at line 227 of file EC_Gateway_IIOP.h. |
|
The consumer ec control which controls the behaviour in case of a misbehaving consumer ec Definition at line 235 of file EC_Gateway_IIOP.h. Referenced by init_i(), and ~TAO_EC_Gateway_IIOP(). |
|
The Gateway IIOP Factory for all the settings.
Definition at line 238 of file EC_Gateway_IIOP.h. |
|
Lock to synchronize internal changes.
Definition at line 170 of file EC_Gateway_IIOP.h. |
|
Our supplier personality....
Definition at line 214 of file EC_Gateway_IIOP.h. |
|
The event channel acting as supplier for this gateway so we can reconnect when the list changes. Definition at line 197 of file EC_Gateway_IIOP.h. Referenced by cleanup_supplier_ec_i(), and init_i(). |
|
Is the supplier ec suspended? Definition at line 193 of file EC_Gateway_IIOP.h. |
|
Our RT_Infos for the event channel that is the supplier.
Definition at line 203 of file EC_Gateway_IIOP.h. |
|
If it is not 0 then we must deactivate the supplier.
Definition at line 217 of file EC_Gateway_IIOP.h. |
|
We talk to the EC (as a consumer) using this proxy. We receive the events from these proxy Definition at line 231 of file EC_Gateway_IIOP.h. |
|
An update_consumer() message arrived *while* we were doing a push() the modification is stored, if multiple update_consumer messages arrive only the last one is executed. Definition at line 181 of file EC_Gateway_IIOP.h. |
|
The flag for using the consumer proxy map. With 1 the consumer proxy map is used, meaning that for each unique source id we use a different proxy push consumer, if 0, we only use one proxy push consumer (the default) for all source ids. Definition at line 247 of file EC_Gateway_IIOP.h. Referenced by TAO_EC_Gateway_IIOP(). |
|
If 1, we use the TTL flags, if 0, we just ignore TTL.
Definition at line 241 of file EC_Gateway_IIOP.h. Referenced by TAO_EC_Gateway_IIOP(). |