#include <EventChannel.h>
Inheritance diagram for OmniEvents::EventChannel_i:
Public Member Functions | |
CosEventChannelAdmin::ConsumerAdmin_ptr | for_consumers () |
CosEventChannelAdmin::SupplierAdmin_ptr | for_suppliers () |
void | destroy () |
CORBA::Boolean | is_alive () |
'ping' method inherited from FT::PullMonitorable. | |
EventChannel_i (EventChannelStore *store=NULL) | |
~EventChannel_i () | |
Cleans up the _poa, if this object is deleted before its thread starts. | |
void | activate (const char *channelName, const PersistNode *node=NULL) |
Creates the channel's POA, and any child objects. | |
void | run (void *arg) |
Entry point for the channel's thread. | |
void | mainLoop () |
The main loop for a channel. | |
void | output (ostream &os) |
ConsumerAdmin_i & | consumerAdmin () const |
const PersistNode & | properties () const |
CORBA::ULong | pullRetryPeriod_ms () const |
CORBA::ULong | maxQueueLength () const |
CORBA::ULong | maxNumProxies () const |
unsigned long | cyclePeriod_ns () const |
Private Member Functions | |
void | setInsName (const string v) |
Construct a new Mapper object, and registers it in the INSPOA. | |
void | createPoa (const char *channelName) |
Constructs the main POA for this channel. | |
Private Attributes | |
EventChannelStore * | _eventChannelStore |
SupplierAdmin_i * | _supplierAdmin |
ConsumerAdmin_i * | _consumerAdmin |
PortableServer::POAManager_var | _poaManager |
bool | _shutdownRequested |
PersistNode | _properties |
Mapper * | _mapper |
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 107 of file EventChannel.h.
|
Definition at line 73 of file EventChannel.cc. |
|
Cleans up the _poa, if this object is deleted before its thread starts.
Definition at line 122 of file EventChannel.cc. References OmniEvents::Servant::_poa, and DB. |
|
Creates the channel's POA, and any child objects. Must to be called just after construction, and before start()/run(). Definition at line 85 of file EventChannel.cc. References OmniEvents::PersistNode::_attr, _consumerAdmin, OmniEvents::Servant::_poa, _properties, _supplierAdmin, OmniEvents::Servant::activateObjectWithId(), OmniEvents::PersistNode::attrString(), OmniEvents::PersistNode::child(), createPoa(), OmniEvents::ConsumerAdmin_i::reincarnate(), OmniEvents::SupplierAdmin_i::reincarnate(), and setInsName(). Referenced by main(). |
|
Definition at line 158 of file EventChannel.h. References _consumerAdmin. Referenced by OmniEvents::SupplierAdmin_i::SupplierAdmin_i(). |
|
Constructs the main POA for this channel. Policies are: PERSISTENT, USER_ID, SINGLE_THREAD_MODEL. POA name is set to channelName. Definition at line 272 of file EventChannel.cc. References OmniEvents::Servant::_poa, _poaManager, OmniEvents::Orb::_RootPOA, DB, destroy(), and OmniEvents::Orb::inst(). Referenced by activate(). |
|
Definition at line 171 of file EventChannel.h. References _properties, OmniEvents::PersistNode::attrLong(), and CYCLE_PERIOD_NS. Referenced by mainLoop(), and OmniEvents::SupplierAdmin_i::SupplierAdmin_i(). |
|
Definition at line 51 of file EventChannel.cc. References _consumerAdmin, _mapper, _shutdownRequested, _supplierAdmin, OmniEvents::Mapper::destroy(), OmniEvents::SupplierAdmin_i::disconnect(), and OmniEvents::ConsumerAdmin_i::disconnect(). Referenced by createPoa(). |
|
Definition at line 35 of file EventChannel.cc. References _consumerAdmin, and _shutdownRequested. |
|
Definition at line 43 of file EventChannel.cc. References _shutdownRequested, and _supplierAdmin. |
|
'ping' method inherited from FT::PullMonitorable.
Definition at line 117 of file EventChannel.h. |
|
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 207 of file EventChannel.cc. References _consumerAdmin, _poaManager, _shutdownRequested, _supplierAdmin, OmniEvents::SupplierAdmin_i::collect(), cyclePeriod_ns(), and OmniEvents::ConsumerAdmin_i::send(). Referenced by run(). |
|
Definition at line 169 of file EventChannel.h. References _properties, OmniEvents::PersistNode::attrLong(), and MAX_NUM_PROXIES. Referenced by OmniEvents::ProxyPullSupplierManager::incarnate(). |
|
Definition at line 167 of file EventChannel.h. References _properties, OmniEvents::PersistNode::attrLong(), and MAX_QUEUE_LENGTH. |
|
Definition at line 232 of file EventChannel.cc. References _consumerAdmin, OmniEvents::Servant::_poa, _properties, _supplierAdmin, OmniEvents::ConsumerAdmin_i::output(), OmniEvents::SupplierAdmin_i::output(), and OmniEvents::PersistNode::output(). Referenced by run(). |
|
Definition at line 160 of file EventChannel.h. References _properties. Referenced by OmniEvents::ConsumerAdmin_i::ConsumerAdmin_i(). |
|
Definition at line 165 of file EventChannel.h. References _properties, OmniEvents::PersistNode::attrLong(), and PULL_RETRY_PERIOD_MS. Referenced by OmniEvents::SupplierAdmin_i::collect(), and OmniEvents::SupplierAdmin_i::SupplierAdmin_i(). |
|
Entry point for the channel's thread. Calls mainLoop() and waits for it to exit. Handles any exceptions, and shuts down the channel once the main loop has finished. Definition at line 145 of file EventChannel.cc. References _eventChannelStore, OmniEvents::Servant::_poa, _poaManager, DB, OmniEvents::EventChannelStore::erase(), OmniEvents::omniEventsLog::exists(), HERE, OmniEvents::EventChannelStore::insert(), OmniEvents::Orb::inst(), mainLoop(), OmniEvents::WriteLock::os, output(), and OmniEvents::Orb::reportObjectFailure(). |
|
Construct a new Mapper object, and registers it in the INSPOA.
Definition at line 244 of file EventChannel.cc. References _mapper, and OmniEvents::Mapper::destroy(). Referenced by activate(). |
|
Definition at line 188 of file EventChannel.h. Referenced by activate(), consumerAdmin(), destroy(), for_consumers(), mainLoop(), and output(). |
|
Definition at line 186 of file EventChannel.h. Referenced by run(). |
|
Definition at line 192 of file EventChannel.h. Referenced by destroy(), and setInsName(). |
|
Definition at line 189 of file EventChannel.h. Referenced by createPoa(), mainLoop(), and run(). |
|
Definition at line 191 of file EventChannel.h. Referenced by activate(), cyclePeriod_ns(), maxNumProxies(), maxQueueLength(), output(), properties(), and pullRetryPeriod_ms(). |
|
Definition at line 190 of file EventChannel.h. Referenced by destroy(), for_consumers(), for_suppliers(), and mainLoop(). |
|
Definition at line 187 of file EventChannel.h. Referenced by activate(), destroy(), for_suppliers(), mainLoop(), and output(). |