OmniEvents
OmniEvents::ProxyPullConsumer_i Class Reference

Implementation of the ProxyPullConsumer interface. More...

#include <ProxyPullConsumer.h>

Inheritance diagram for OmniEvents::ProxyPullConsumer_i:
Collaboration diagram for OmniEvents::ProxyPullConsumer_i:

Public Member Functions

void connect_pull_supplier (CosEventComm::PullSupplier_ptr pullSupplier)
 
void disconnect_pull_consumer ()
 
 ProxyPullConsumer_i (PortableServer::POA_ptr poa, list< CORBA::Any * > &q)
 
 ~ProxyPullConsumer_i ()
 
void collect ()
 Collects responses since the last trigger. More...
 
void triggerRequest ()
 When _req is NIL, sends out a new pull() or try_pull() call. More...
 
void reincarnate (const string &oid, const PersistNode &node)
 Re-create a servant from information saved in the log file. More...
 
void output (ostream &os)
 Save this object's state to a stream. More...
 
- Public Member Functions inherited from OmniEvents::Proxy
virtual ~Proxy ()
 
- Public Member Functions inherited from OmniEvents::Servant
virtual PortableServer::POA_ptr _default_POA ()
 
virtual ~Servant ()
 

Private Types

enum  Mode { Pull =0 , TryPull =1 }
 This proxy can call out in either pull() or try_pull() mode. More...
 

Private Attributes

CosEventComm::PullSupplier_var _target
 
list< CORBA::Any * > & _queue
 
Mode _mode
 
int _exceptionCount
 Only when two consecutive exceptions have been received from each mode, do we consider the connection dead. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OmniEvents::Proxy
 Proxy (PortableServer::POA_ptr poa)
 
void keyOutput (ostream &os, const char *name)
 Helper method for constructing persistency output. More...
 
void eraseKey (const char *name)
 Helper method for constructing persistency output. More...
 
void basicOutput (ostream &os, const char *name, CORBA::Object_ptr target=CORBA::Object::_nil(), const char *extraAttributes=NULL)
 Helper method for constructing persistency output. More...
 
- Protected Member Functions inherited from OmniEvents::Servant
 Servant (PortableServer::POA_ptr poa)
 
void activateObjectWithId (const char *oidStr)
 Calls activate_object_with_id() to activate this servant in its POA. More...
 
void deactivateObject ()
 Calls deactivate_object() to deactivate this servant in its POA. More...
 
- Protected Attributes inherited from OmniEvents::Proxy
CORBA::Request_var _req
 
- Protected Attributes inherited from OmniEvents::Servant
PortableServer::POA_var _poa
 

Detailed Description

Implementation of the ProxyPullConsumer interface.

Tries to get messages by using pull() then try_pull() method calls, but prefers pull(). Switches between pull() & try_pull() if it gets an exception. Only gives up when both methods have returned two consecutive exceptions.

Note, our own implementation of ProxyPullSupplier::pull() is very basic.

Definition at line 100 of file ProxyPullConsumer.h.

Member Enumeration Documentation

◆ Mode

This proxy can call out in either pull() or try_pull() mode.

Enumerator
Pull 
TryPull 

Definition at line 123 of file ProxyPullConsumer.h.

Constructor & Destructor Documentation

◆ ProxyPullConsumer_i()

OmniEvents::ProxyPullConsumer_i::ProxyPullConsumer_i ( PortableServer::POA_ptr  poa,
list< CORBA::Any * > &  q 
)

Definition at line 154 of file ProxyPullConsumer.cc.

◆ ~ProxyPullConsumer_i()

OmniEvents::ProxyPullConsumer_i::~ProxyPullConsumer_i ( )

Definition at line 165 of file ProxyPullConsumer.cc.

References DB.

Member Function Documentation

◆ collect()

◆ connect_pull_supplier()

void OmniEvents::ProxyPullConsumer_i::connect_pull_supplier ( CosEventComm::PullSupplier_ptr  pullSupplier)

◆ disconnect_pull_consumer()

◆ output()

void OmniEvents::ProxyPullConsumer_i::output ( ostream &  os)
virtual

Save this object's state to a stream.

Implements OmniEvents::Proxy.

Definition at line 274 of file ProxyPullConsumer.cc.

References _target, and OmniEvents::Proxy::basicOutput().

Referenced by connect_pull_supplier().

◆ reincarnate()

void OmniEvents::ProxyPullConsumer_i::reincarnate ( const string &  oid,
const PersistNode node 
)
virtual

Re-create a servant from information saved in the log file.

Implements OmniEvents::Proxy.

Definition at line 262 of file ProxyPullConsumer.cc.

References OmniEvents::Servant::activateObjectWithId(), OmniEvents::PersistNode::attrString(), and connect_pull_supplier().

◆ triggerRequest()

void OmniEvents::ProxyPullConsumer_i::triggerRequest ( )

When _req is NIL, sends out a new pull() or try_pull() call.

Definition at line 241 of file ProxyPullConsumer.cc.

References _mode, OmniEvents::Proxy::_req, _target, Pull, and TryPull.

Referenced by OmniEvents::ProxyPullConsumerManager::triggerRequest().

Member Data Documentation

◆ _exceptionCount

int OmniEvents::ProxyPullConsumer_i::_exceptionCount
private

Only when two consecutive exceptions have been received from each mode, do we consider the connection dead.

Definition at line 129 of file ProxyPullConsumer.h.

Referenced by collect().

◆ _mode

Mode OmniEvents::ProxyPullConsumer_i::_mode
private

Definition at line 124 of file ProxyPullConsumer.h.

Referenced by collect(), and triggerRequest().

◆ _queue

list<CORBA::Any*>& OmniEvents::ProxyPullConsumer_i::_queue
private

Definition at line 120 of file ProxyPullConsumer.h.

Referenced by collect().

◆ _target

CosEventComm::PullSupplier_var OmniEvents::ProxyPullConsumer_i::_target
private

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