CARMA C++
carma::util::NotificationConsumer Class Reference

A base class that accepts named events from a Push supplier. More...

#include <carma/util/NotificationConsumer.h>

Inherits StructuredPushConsumer.

Public Member Functions

virtual PortableServer::POA_ptr _default_POA ()
 
void deactivateConsumer ()
 Method to deactivate an active consumer. More...
 
virtual void disconnect_structured_push_consumer () throw (CORBA::SystemException)
 Callback function that gets called by the notification server if it decides to disconnect the push consumer. More...
 
bool isActive ()
 Method to test whether consumer is active. More...
 
 NotificationConsumer (Orb *localOrb, const std::string channelName, const std::string consumerName)
 Constructor for Notification Consumer - creates ORB internally. More...
 
virtual void offer_change (const CosNotification::EventTypeSeq &, const CosNotification::EventTypeSeq &) throw (CosNotifyComm::InvalidEventType, CORBA::SystemException)
 
virtual void push_structured_event (const CosNotification::StructuredEvent &event) throw (CosEventComm::Disconnected, CORBA::SystemException)
 Callback function that is called by the notification server when notifications arrive for this consumer. More...
 
virtual void run ()
 Blocking call that activates the callback for collecting events from the notification server. More...
 

Protected Member Functions

void setProxyPushSupplier ()
 create a proxy push supplier for our push consumer More...
 

Protected Attributes

const std::string channelName_
 
const std::string consumerName_
 
Orb * localOrb_
 
std::string localOrbName_
 
CORBA::ORB_var orb_
 
PortableServer::POA_var poa_
 
CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxyPushSupplier_
 

Detailed Description

A base class that accepts named events from a Push supplier.

This is the basis for event driven clients, with the push method being executed when the event is received. This class is usually extended and the push method is overridden. At the time of construction, this consumer object is bound to a notification channel, and an instance of a notification queue (through the consumerName).

Definition at line 24 of file NotificationConsumer.h.

Constructor & Destructor Documentation

carma::util::NotificationConsumer::NotificationConsumer ( Orb *  localOrb,
const std::string  channelName,
const std::string  consumerName 
)

Constructor for Notification Consumer - creates ORB internally.

Parameters
orbinput pointer to orb
channelNamename of channel for notifications
consumerNamename of the consumer
Exceptions
carma::util::ErrorExceptionif resolved object is nil.
CORBA::ORB::InvalidNameif NameService is not found
CORBA::SystemExceptionfor failed _narrow on NameService
CosNaming::NamingContext::CannotProceed
CosNaming::NamingContext::InvalidNameif the CosNaming::Name created from hierarchicalName has an invalid element
CORBA::ORB::InvalidNameif RootPOA is not found
CORBA::SystemExceptionfor failed _narrow on RootPOA
PortableServer::POA::InvalidPolicyif policyList contains an invalid policy
PortableServer::POA::AdapterAlreadyExistsif POA with given poaString has already been craeted
CORBA::Exceptioncannot resolve ORB

Member Function Documentation

void carma::util::NotificationConsumer::deactivateConsumer ( )

Method to deactivate an active consumer.

Intended to be used in a multithreaded environment since run() is a blocking call.

virtual void carma::util::NotificationConsumer::disconnect_structured_push_consumer ( )
throw (CORBA::SystemException
)
virtual

Callback function that gets called by the notification server if it decides to disconnect the push consumer.

(DO NOT override this method!!!)

bool carma::util::NotificationConsumer::isActive ( )

Method to test whether consumer is active.

Intended to be used in a multithreaded environment since run() is a blocking call.

virtual void carma::util::NotificationConsumer::push_structured_event ( const CosNotification::StructuredEvent &  event)
throw (CosEventComm::Disconnected,
CORBA::SystemException
)
virtual

Callback function that is called by the notification server when notifications arrive for this consumer.

virtual void carma::util::NotificationConsumer::run ( )
virtual

Blocking call that activates the callback for collecting events from the notification server.

Exceptions
CARMA_ERROR
PortableServer::POAManager::AdapterInactive
void carma::util::NotificationConsumer::setProxyPushSupplier ( )
protected

create a proxy push supplier for our push consumer

Exceptions
carma::util::ErrorExceptionif resolved object is nil.
CORBA::ORB::InvalidNameif NameService is not found
CORBA::SystemExceptionfor failed _narrow on NameService
CosNaming::NamingContext::CannotProceed
CosNaming::NamingContext::InvalidNameif the CosNaming::Name created from hierarchicalName has an invalid element

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