Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# TAO_EC_Gateway_IIOP Class Reference

Event Channel Gateway using IIOP. More...

`#include <EC_Gateway_IIOP.h>`

Inheritance diagram for TAO_EC_Gateway_IIOP:

[legend]
Collaboration diagram for TAO_EC_Gateway_IIOP:

[legend]
List of all members.

## Public Methods

| 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 Methods

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 Methods

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)

## Detailed Description

Event Channel Gateway using IIOP.

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.

Note:
  An alternative implementation would be to register with the remote EC as a supplier, and then filter on the remote EC, but one of the objectives is to minimize network traffic. On the other hand the events will be pushed to remote consumers, event though they will be dropped upon receipt (due to the TTL field); IMHO this is another suggestion that the EC needs to know (somehow) which consumers are truly its peers in disguise.

Todo:
  : The class makes an extra copy of the events, we need to investigate if closer collaboration with its collocated EC could be used to remove that copy.

## Member Typedef Documentation

typedef ACE_Map_Manager<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> TAO_EC_Gateway_IIOP::Consumer_Map`[protected]`

typedef ACE_Map_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> TAO_EC_Gateway_IIOP::Consumer_Map_Iterator`[protected]`

## Constructor & Destructor Documentation

TAO_EC_Gateway_IIOP::TAO_EC_Gateway_IIOP | ( | void |  | ) |

TAO_EC_Gateway_IIOP::~TAO_EC_Gateway_IIOP | ( | void |  | ) | `[virtual]`

## Member Function Documentation

int TAO_EC_Gateway_IIOP::cleanup_consumer_ec | ( | void |  | ) |

| Cleanup the connection to the consumer ec. Doesn't call anything on the ec again, just set the object to nil

void TAO_EC_Gateway_IIOP::cleanup_consumer_ec_i | ( | void |  | ) | `[private]`

void TAO_EC_Gateway_IIOP::cleanup_consumer_proxies | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) |

| 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.

void TAO_EC_Gateway_IIOP::cleanup_consumer_proxies_i | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) | `[private]`

| Remove all consumer proxies without calling disconnect on them.

int TAO_EC_Gateway_IIOP::cleanup_supplier_ec | ( | void |  | ) |

| Cleanup the connection to the supplier ec. Doesn't call anything on the ec again, just set the object to nil

void TAO_EC_Gateway_IIOP::cleanup_supplier_ec_i | ( | void |  | ) | `[private]`

void TAO_EC_Gateway_IIOP::close | ( | ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS |  | ) | `[virtual]`

| The gateway must disconnect from all the relevant event channels, or any other communication media (such as multicast groups). Implements TAO_EC_Gateway.

void TAO_EC_Gateway_IIOP::close_i | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) | `[private]`

CORBA::Boolean TAO_EC_Gateway_IIOP::consumer_ec_non_existent | ( | CORBA::Boolean_out disconnected | ACE_ENV_ARG_DECL | ) |

| Check whether the consumer event channel is non existent or not.

void TAO_EC_Gateway_IIOP::disconnect_consumer_proxies_i | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) | `[private]`

| Disconnect all consumer proxies.

void TAO_EC_Gateway_IIOP::disconnect_push_consumer | ( | ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS |  | ) |

| The channel is disconnecting.

void TAO_EC_Gateway_IIOP::disconnect_push_supplier | ( | ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS |  | ) |

| The channel is disconnecting.

void TAO_EC_Gateway_IIOP::disconnect_supplier_proxy_i | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) | `[private]`

| Disconnect the supplier proxy.

int TAO_EC_Gateway_IIOP::init | ( | RtecEventChannelAdmin::EventChannel_ptr | supplier_ec,
|  | RtecEventChannelAdmin::EventChannel_ptr consumer_ec | ACE_ENV_ARG_DECL
| ) |

To do its job this class requires to know the local and remote ECs it will connect to.

Returns:
  0 in case of success, -1 in case of failure

int TAO_EC_Gateway_IIOP::init_i | ( | RtecEventChannelAdmin::EventChannel_ptr | supplier_ec,
|  | RtecEventChannelAdmin::EventChannel_ptr consumer_ec | ACE_ENV_ARG_DECL
| ) | `[protected]`

| Do the real work in init().

CORBA::Boolean TAO_EC_Gateway_IIOP::is_consumer_ec_connected_i | ( | void |  | ) | const`[private]`

| Helper method to see if consumer ec is connected.

void TAO_EC_Gateway_IIOP::open_i | ( | const RtecEventChannelAdmin::ConsumerQOS &sub | ACE_ENV_ARG_DECL | ) | `[private]`

| Create all connections to consumer ec and to supplier ec.

void TAO_EC_Gateway_IIOP::push | ( | const RtecEventComm::EventSet &events | ACE_ENV_ARG_DECL_WITH_DEFAULTS | ) |

| This is the consumer side behavior, it pushes the events to the local event channel.

void TAO_EC_Gateway_IIOP::push_to_consumer | ( | RtecEventChannelAdmin::ProxyPushConsumer_ptr | consumer,
|  | const RtecEventComm::EventSet &event | ACE_ENV_ARG_DECL
| ) | `[private]`

| Push the event to the consumer.

void TAO_EC_Gateway_IIOP::reconnect_consumer_ec | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) |

void TAO_EC_Gateway_IIOP::resume_supplier_ec | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) |

| Resume the connection to the supplier ec.

int TAO_EC_Gateway_IIOP::shutdown | ( | ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS |  | ) |

| Disconnect and shutdown the gateway.

void TAO_EC_Gateway_IIOP::suspend_supplier_ec | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) |

| Suspend the connection to the supplier ec.

virtual void TAO_EC_Gateway_IIOP::update_consumer | ( | const RtecEventChannelAdmin::ConsumerQOS &sub | ACE_ENV_ARG_DECL_WITH_DEFAULTS | ) | throw (CORBA::SystemException)`[virtual]`

void TAO_EC_Gateway_IIOP::update_consumer_i | ( | const RtecEventChannelAdmin::ConsumerQOS &sub | ACE_ENV_ARG_DECL | ) | `[private]`

virtual void TAO_EC_Gateway_IIOP::update_supplier | ( | const RtecEventChannelAdmin::SupplierQOS &pub | ACE_ENV_ARG_DECL_WITH_DEFAULTS | ) | throw (CORBA::SystemException)`[virtual]`

## Member Data Documentation

CORBA::ULong TAO_EC_Gateway_IIOP::busy_count_`[protected]`

| How many threads are running push() we cannot make changes until that reaches 0

RtecEventChannelAdmin::ConsumerQOS TAO_EC_Gateway_IIOP::c_qos_`[protected]`

int TAO_EC_Gateway_IIOP::cleanup_posted_`[protected]`

| We have a cleanup outstanding and must wait doing cleanup until all pushes are ready.

ACE_PushConsumer_Adapter<TAO_EC_Gateway_IIOP> TAO_EC_Gateway_IIOP::consumer_`[protected]`

| Our consumer personality....

RtecEventChannelAdmin::EventChannel_var TAO_EC_Gateway_IIOP::consumer_ec_`[protected]`

| The event channel acting as consumer of this gateway.

RtecBase::handle_t TAO_EC_Gateway_IIOP::consumer_info_`[protected]`

| Our RT_Infos for the event channel that is the consumer.

int TAO_EC_Gateway_IIOP::consumer_is_active_`[protected]`

| If it is not 0 then we must deactivate the consumer.

Consumer_Map TAO_EC_Gateway_IIOP::consumer_proxy_map_`[protected]`

| 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

RtecEventChannelAdmin::ProxyPushConsumer_var TAO_EC_Gateway_IIOP::default_consumer_proxy_`[protected]`

TAO_ECG_ConsumerEC_Control* TAO_EC_Gateway_IIOP::ec_control_`[protected]`

| The consumer ec control which controls the behaviour in case of a misbehaving consumer ec

TAO_EC_Gateway_IIOP_Factory* TAO_EC_Gateway_IIOP::factory_`[protected]`

| The Gateway IIOP Factory for all the settings.

TAO_SYNCH_MUTEX TAO_EC_Gateway_IIOP::lock_`[protected]`

| Lock to synchronize internal changes.

ACE_PushSupplier_Adapter<TAO_EC_Gateway_IIOP> TAO_EC_Gateway_IIOP::supplier_`[protected]`

| Our supplier personality....

RtecEventChannelAdmin::EventChannel_var TAO_EC_Gateway_IIOP::supplier_ec_`[protected]`

| The event channel acting as supplier for this gateway so we can reconnect when the list changes.

int TAO_EC_Gateway_IIOP::supplier_ec_suspended_`[protected]`

| Is the supplier ec suspended?

RtecBase::handle_t TAO_EC_Gateway_IIOP::supplier_info_`[protected]`

| Our RT_Infos for the event channel that is the supplier.

int TAO_EC_Gateway_IIOP::supplier_is_active_`[protected]`

| If it is not 0 then we must deactivate the supplier.

RtecEventChannelAdmin::ProxyPushSupplier_var TAO_EC_Gateway_IIOP::supplier_proxy_`[protected]`

| We talk to the EC (as a consumer) using this proxy. We receive the events from these proxy

int TAO_EC_Gateway_IIOP::update_posted_`[protected]`

| 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.

int TAO_EC_Gateway_IIOP::use_consumer_proxy_map_`[protected]`

| 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.

int TAO_EC_Gateway_IIOP::use_ttl_`[protected]`

| If 1, we use the TTL flags, if 0, we just ignore TTL.

The documentation for this class was generated from the following files:

- EC_Gateway_IIOP.h
- EC_Gateway_IIOP.cpp