TAO_RTEvent  2.0.8
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
TAO_EC_Gateway_IIOP Class Reference

Event Channel Gateway using IIOP. More...

#include <EC_Gateway_IIOP.h>

Inheritance diagram for TAO_EC_Gateway_IIOP:
Inheritance graph
[legend]
Collaboration diagram for TAO_EC_Gateway_IIOP:
Collaboration graph
[legend]

List of all members.

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)
void disconnect_push_supplier (void)
 The channel is disconnecting.
void disconnect_push_consumer (void)
 The channel is disconnecting.
void push (const RtecEventComm::EventSet &events)
int shutdown (void)
 Disconnect and shutdown the gateway.
virtual void close (void)
virtual void update_consumer (const RtecEventChannelAdmin::ConsumerQOS &sub)
virtual void update_supplier (const RtecEventChannelAdmin::SupplierQOS &pub)
void reconnect_consumer_ec (void)
CORBA::Boolean consumer_ec_non_existent (CORBA::Boolean_out disconnected)
 Check whether the consumer event channel is non existent or not.
void cleanup_consumer_proxies (void)
int cleanup_consumer_ec (void)
int cleanup_supplier_ec (void)
void suspend_supplier_ec (void)
 Suspend the connection to the supplier ec.
void resume_supplier_ec (void)
 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)
 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....
bool consumer_is_active_
 If it is true then we must deactivate the consumer.
ACE_PushSupplier_Adapter
< TAO_EC_Gateway_IIOP
supplier_
 Our supplier personality....
bool supplier_is_active_
 If it is true 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_Controlec_control_
TAO_EC_Gateway_IIOP_Factoryfactory_
 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 (void)
void disconnect_supplier_proxy_i (void)
 Disconnect the supplier proxy.
void disconnect_consumer_proxies_i (void)
 Disconnect all consumer proxies.
void cleanup_consumer_proxies_i (void)
 Remove all consumer proxies without calling disconnect on them.
void update_consumer_i (const RtecEventChannelAdmin::ConsumerQOS &sub)
void open_i (const RtecEventChannelAdmin::ConsumerQOS &sub)
 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)
 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 ( void  )

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 ( void  ) [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 ( void  ) [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 ( void  ) [private]
CORBA::Boolean TAO_EC_Gateway_IIOP::consumer_ec_non_existent ( CORBA::Boolean_out  disconnected)

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

void TAO_EC_Gateway_IIOP::disconnect_consumer_proxies_i ( void  ) [private]

Disconnect all consumer proxies.

void TAO_EC_Gateway_IIOP::disconnect_push_consumer ( void  )

The channel is disconnecting.

void TAO_EC_Gateway_IIOP::disconnect_push_supplier ( void  )

The channel is disconnecting.

void TAO_EC_Gateway_IIOP::disconnect_supplier_proxy_i ( void  ) [private]

Disconnect the supplier proxy.

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

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 
) [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) [private]

Create all connections to consumer ec and to supplier ec.

void TAO_EC_Gateway_IIOP::push ( const RtecEventComm::EventSet events)

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 
) [private]

Push the event to the consumer.

void TAO_EC_Gateway_IIOP::reconnect_consumer_ec ( void  )
void TAO_EC_Gateway_IIOP::resume_supplier_ec ( void  )

Resume the connection to the supplier ec.

int TAO_EC_Gateway_IIOP::shutdown ( void  )

Disconnect and shutdown the gateway.

void TAO_EC_Gateway_IIOP::suspend_supplier_ec ( void  )

Suspend the connection to the supplier ec.

void TAO_EC_Gateway_IIOP::update_consumer ( const RtecEventChannelAdmin::ConsumerQOS sub) [virtual]
void TAO_EC_Gateway_IIOP::update_consumer_i ( const RtecEventChannelAdmin::ConsumerQOS sub) [private]
void TAO_EC_Gateway_IIOP::update_supplier ( const RtecEventChannelAdmin::SupplierQOS pub) [virtual]

Member Data Documentation

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

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.

Our RT_Infos for the event channel that is the consumer.

If it is true then we must deactivate the consumer.

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]

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

The Gateway IIOP Factory for all the settings.

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.

Is the supplier ec suspended?

Our RT_Infos for the event channel that is the supplier.

If it is true 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

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.

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.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines