Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

OmniEvents::EventChannel_i Class Reference

Servant for CosEventChannelAdmin::EventChannel objects, also inherits from omni_thread. More...

#include <EventChannel.h>

Inheritance diagram for OmniEvents::EventChannel_i:

Inheritance graph
[legend]
Collaboration diagram for OmniEvents::EventChannel_i:

Collaboration graph
[legend]
List of all members.

Public Methods

CosEventChannelAdmin::ConsumerAdmin_ptr for_consumers ()
CosEventChannelAdmin::SupplierAdmin_ptr for_suppliers ()
void destroy ()
 EventChannel_i (const char *channelName)
 EventChannel_i (const char *channelName, const OEP_ecps &ecps)
 ~EventChannel_i ()
void run (void *arg)
 The main loop for a channel. More...

void output (ostream &os)
void setPullRetryPeriod (CORBA::ULong v)
void setMaxQueueLength (CORBA::ULong v)
CORBA::ULong pullRetryPeriod () const
CORBA::ULong maxQueueLength () const

Private Methods

void createPoa (const char *channelName)
 Constructs the main POA for this channel. More...


Private Attributes

SupplierAdmin_i_supplierAdmin
ConsumerAdmin_i_consumerAdmin
PortableServer::POAManager_var _poaManager
bool _shutdownRequested
CORBA::ULong _pullRetryPeriod
CORBA::ULong _maxQueueLength

Detailed Description

Servant for CosEventChannelAdmin::EventChannel objects, also inherits from omni_thread.

Each EventChannel contains five POAs, one for each of the proxy types, and one for the XXXAdmins and EventChannel itself. This POA also contains the ProxyManager objects that are used to manage three of the four proxy object types.

Here's a summary of the POAs, and their contents:

     +-POA: EventChannel-----------------------------------------------+
     |                                                                 |
     |                      Obj: EventChannel_i                        |
     |                                                                 |
     |       Obj: SupplierAdmin_i           Obj: ConsumerAdmin_i       |
     |                                                                 |
     |                                 Obj: ProxyPushSupplierManager   |
     |                                                                 |
     |   +-POA: ProxyPushConsumer---+   +-POA: ProxyPushSupplier---+   |
     |   |                          |   |                          |   |
     |   | Obj: ProxyPushConsumer_i |   | Obj: ProxyPushSupplier_i |   |
     |   | (DEFAULT SERVANT)        |   | Obj: ProxyPushSupplier_i |   |
     |   |                          |   | Obj: ProxyPushSupplier_i |   |
     |   |                          |   | .                        |   |
     |   |                          |   | .                        |   |
     |   |                          |   | .                        |   |
     |   |                          |   |                          |   |
     |   +--------------------------+   +--------------------------+   |
     |                                                                 |
     |  Obj: ProxyPullConsumerManager  Obj: ProxyPullSupplierManager   |
     |                                                                 |
     |   +-POA: ProxyPullConsumer---+   +-POA: ProxyPullSupplier---+   |
     |   |                          |   |                          |   |
     |   | Obj: ProxyPullConsumer_i |   | Obj: ProxyPullSupplier_i |   |
     |   | Obj: ProxyPullConsumer_i |   | Obj: ProxyPullSupplier_i |   |
     |   | Obj: ProxyPullConsumer_i |   | Obj: ProxyPullSupplier_i |   |
     |   | .                        |   | .                        |   |
     |   | .                        |   | .                        |   |
     |   | .                        |   | .                        |   |
     |   |                          |   |                          |   |
     |   +--------------------------+   +--------------------------+   |
     |                                                                 |
     +-----------------------------------------------------------------+
 

All five POAs are single threaded, and managed by the same POAmanager. This enables the top level event loop (EventChannel::run()) to hold all incoming calls while it passes events from the ProxyConsumers over to the ProxySuppliers. This single threaded model simplifies the implementation and avoids all of the locking overheads of a multi-threaded solution.

Definition at line 102 of file EventChannel.h.


Constructor & Destructor Documentation

OmniEvents::EventChannel_i::EventChannel_i const char *    channelName
 

Definition at line 59 of file EventChannel.cc.

References OmniEvents::Servant::activateObjectWithId(), createPoa(), MAX_QUEUE_LENGTH, and PULL_RETRY_PERIOD.

OmniEvents::EventChannel_i::EventChannel_i const char *    channelName,
const OEP_ecps   ecps
 

Definition at line 73 of file EventChannel.cc.

References _consumerAdmin, OmniEvents::Servant::_poa, _supplierAdmin, OmniEvents::Servant::activateObjectWithId(), and createPoa().

OmniEvents::EventChannel_i::~EventChannel_i  
 

Definition at line 102 of file EventChannel.cc.

References _consumerAdmin, and _supplierAdmin.


Member Function Documentation

void OmniEvents::EventChannel_i::createPoa const char *    channelName [private]
 

Constructs the main POA for this channel.

Policies are: PERSISTENT, USER_ID, SINGLE_THREAD_MODEL. POA name is set to channelName.

Definition at line 179 of file EventChannel.cc.

References OmniEvents::Servant::_poa, and _poaManager.

Referenced by EventChannel_i().

void OmniEvents::EventChannel_i::destroy  
 

Definition at line 53 of file EventChannel.cc.

References _shutdownRequested.

CosEventChannelAdmin::ConsumerAdmin_ptr OmniEvents::EventChannel_i::for_consumers  
 

Definition at line 37 of file EventChannel.cc.

References _consumerAdmin, and OmniEvents::Servant::_poa.

CosEventChannelAdmin::SupplierAdmin_ptr OmniEvents::EventChannel_i::for_suppliers  
 

Definition at line 45 of file EventChannel.cc.

References OmniEvents::Servant::_poa, and _supplierAdmin.

CORBA::ULong OmniEvents::EventChannel_i::maxQueueLength   const [inline]
 

Definition at line 141 of file EventChannel.h.

References _maxQueueLength.

void OmniEvents::EventChannel_i::output ostream &    os
 

Definition at line 161 of file EventChannel.cc.

References _consumerAdmin, _maxQueueLength, OmniEvents::Servant::_poa, _pullRetryPeriod, _supplierAdmin, OmniEvents::ConsumerAdmin_i::output(), and OmniEvents::SupplierAdmin_i::output().

CORBA::ULong OmniEvents::EventChannel_i::pullRetryPeriod   const [inline]
 

Definition at line 140 of file EventChannel.h.

References _pullRetryPeriod.

void OmniEvents::EventChannel_i::run void *    arg
 

The main loop for a channel.

Work is strictly separated into two phases. Most of the time, all of the POAs are active, and receiving incoming calls. Periodically, incoming calls are held and the channel collects new events from the consumers and sends them to the suppliers.

Incoming call handlers are all designed to complete in the absolute minimum time. This enables the POAs to be single threaded, and to hold incoming calls without having to wait a long time for ongoing invokations to complete. Sadly, it's not possible to implement ProxyPullSupplier::pull() 'properly' without blocking, so our version just raises TRANSIENT if there is no event immediately available.

Outgoing calls are always sent as deferred requests, to avoid blocking while we wait for them to return.

Definition at line 117 of file EventChannel.cc.

References _consumerAdmin, _poaManager, _shutdownRequested, _supplierAdmin, OmniEvents::SupplierAdmin_i::collect(), and OmniEvents::ConsumerAdmin_i::send().

void OmniEvents::EventChannel_i::setMaxQueueLength CORBA::ULong    v [inline]
 

Definition at line 138 of file EventChannel.h.

References _maxQueueLength.

Referenced by OmniEvents::EventChannelFactory_i::create_object().

void OmniEvents::EventChannel_i::setPullRetryPeriod CORBA::ULong    v [inline]
 

Definition at line 137 of file EventChannel.h.

References _pullRetryPeriod.

Referenced by OmniEvents::EventChannelFactory_i::create_object().


Member Data Documentation

ConsumerAdmin_i* OmniEvents::EventChannel_i::_consumerAdmin [private]
 

Definition at line 152 of file EventChannel.h.

Referenced by EventChannel_i(), for_consumers(), output(), run(), and ~EventChannel_i().

CORBA::ULong OmniEvents::EventChannel_i::_maxQueueLength [private]
 

Definition at line 156 of file EventChannel.h.

Referenced by maxQueueLength(), output(), and setMaxQueueLength().

PortableServer::POAManager_var OmniEvents::EventChannel_i::_poaManager [private]
 

Definition at line 153 of file EventChannel.h.

Referenced by createPoa(), and run().

CORBA::ULong OmniEvents::EventChannel_i::_pullRetryPeriod [private]
 

Definition at line 155 of file EventChannel.h.

Referenced by output(), pullRetryPeriod(), and setPullRetryPeriod().

bool OmniEvents::EventChannel_i::_shutdownRequested [private]
 

Definition at line 154 of file EventChannel.h.

Referenced by destroy(), and run().

SupplierAdmin_i* OmniEvents::EventChannel_i::_supplierAdmin [private]
 

Definition at line 151 of file EventChannel.h.

Referenced by EventChannel_i(), for_suppliers(), output(), run(), and ~EventChannel_i().


The documentation for this class was generated from the following files:
Generated on Fri Dec 12 10:53:13 2003 for OmniEvents by doxygen1.2.15