#include <EventChannel.h>
Inheritance diagram for OmniEvents::EventChannel_i:
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 |
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.
|
Definition at line 59 of file EventChannel.cc. References OmniEvents::Servant::activateObjectWithId(), createPoa(), MAX_QUEUE_LENGTH, and PULL_RETRY_PERIOD. |
|
Definition at line 73 of file EventChannel.cc. References _consumerAdmin, OmniEvents::Servant::_poa, _supplierAdmin, OmniEvents::Servant::activateObjectWithId(), and createPoa(). |
|
Definition at line 102 of file EventChannel.cc. References _consumerAdmin, and _supplierAdmin. |
|
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(). |
|
Definition at line 53 of file EventChannel.cc. References _shutdownRequested. |
|
Definition at line 37 of file EventChannel.cc. References _consumerAdmin, and OmniEvents::Servant::_poa. |
|
Definition at line 45 of file EventChannel.cc. References OmniEvents::Servant::_poa, and _supplierAdmin. |
|
Definition at line 141 of file EventChannel.h. References _maxQueueLength. |
|
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(). |
|
Definition at line 140 of file EventChannel.h. References _pullRetryPeriod. |
|
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(). |
|
Definition at line 138 of file EventChannel.h. References _maxQueueLength. Referenced by OmniEvents::EventChannelFactory_i::create_object(). |
|
Definition at line 137 of file EventChannel.h. References _pullRetryPeriod. Referenced by OmniEvents::EventChannelFactory_i::create_object(). |
|
Definition at line 152 of file EventChannel.h. Referenced by EventChannel_i(), for_consumers(), output(), run(), and ~EventChannel_i(). |
|
Definition at line 156 of file EventChannel.h. Referenced by maxQueueLength(), output(), and setMaxQueueLength(). |
|
Definition at line 153 of file EventChannel.h. |
|
Definition at line 155 of file EventChannel.h. Referenced by output(), pullRetryPeriod(), and setPullRetryPeriod(). |
|
Definition at line 154 of file EventChannel.h. |
|
Definition at line 151 of file EventChannel.h. Referenced by EventChannel_i(), for_suppliers(), output(), run(), and ~EventChannel_i(). |