Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

nc::Supplier Class Reference

#include <acsncSupplier.h>

Inheritance diagram for nc::Supplier:
Inheritance graph
[legend]
Collaboration diagram for nc::Supplier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Supplier (const char *channelName, acscomponent::ACSComponentImpl *component)
 Supplier (const char *channelName, CORBA::ORB_ptr orb_mp, acscomponent::ACSComponentImpl *component)
 Supplier (const char *channelName, int argc, char *argv[], acscomponent::ACSComponentImpl *component)
virtual void disconnect ()
void publishEvent (const CosNotification::StructuredEvent &event)
virtual void publishEvent (const CORBA::Any &eventData)
virtual void disconnect_structured_push_supplier ()
virtual void subscription_change (const CosNotification::EventTypeSeq &eventsAdded, const CosNotification::EventTypeSeq &eventsRemoved)
void reconnect (::NotifyMonitoringExt::EventChannelFactory *ecf)
void setAntennaName (std::string antennaName)

Protected Member Functions

virtual ~Supplier ()
void populateHeader (CosNotification::StructuredEvent &event)
virtual void populateHeader (const CORBA::Any &any)
void setEventType (const char *)
void createSupplier ()
void destroyNotificationChannel ()
void init (CORBA::ORB_ptr orb)

Protected Attributes

CosNotifyChannelAdmin::SupplierAdmin_var SupplierAdmin_m
CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxyConsumer_m
CosNotifyComm::StructuredPushSupplier_var reference_m
acscomponent::ACSComponentImplcomponent_mp
char * typeName_mp
unsigned long long count_m
Logging::RepeatGuardLogger
< Logging::BaseLog
guardbl
CosNotification::StructuredEvent event_m
std::string antennaName

Private Member Functions

void operator= (const Supplier &)
 Supplier (const Supplier &)

Private Attributes

CosNotifyChannelAdmin::AdminID adminid
CosNotifyChannelAdmin::ProxyID proxyConsumerID
CircularQueue eventBuff

Detailed Description

Supplier provides an implementation of the structured event push supplier interface from the notification service (NC). It is designed to assist the developer in publishing CORBA structured events to a given channel. Instances of Supplier can contact the notification service using the Container, a SimpleClient, and various other means using the numerous constructors provided.

For those who "know what they're doing", Supplier can be used directly in lieu of the SimpleSupplier class to publish entire CORBA structured events (see the publishEvent() methods). This functionality should be used with extreme caution if used at all.

TODO:


Constructor & Destructor Documentation

nc::Supplier::Supplier ( const char *  channelName,
acscomponent::ACSComponentImpl component 
)

Standard constructor - used within a component. If this constructor is used, we use container's ORB to access Manager and then retrieve a reference to the Naming Service.

Parameters:
channlName The name of the channel events will be published to.
component A reference to a component is needed for the Event
nc::Supplier::Supplier ( const char *  channelName,
CORBA::ORB_ptr  orb_mp,
acscomponent::ACSComponentImpl component 
)

Generic constructor. This constructor is provided for API users who create their own ORB that has a reference to the Naming Service. SimpleClient provides such access to an ORB.

Parameters:
channlName The name of the channel events will be published to.
orb_mp ORB that has a valid reference to the Naming Service.
component A reference to a component is needed for the Event
nc::Supplier::Supplier ( const char *  channelName,
int  argc,
char *  argv[],
acscomponent::ACSComponentImpl component 
)

Optional constructor - used outside of ACS. This constructor is very resource intensive (it spawns it's own ORB) and should only to be utilized when there is a reason not to use Manager to get at the Naming Service. If argc==0, default parameters (i.e., environment variables) specify how to get to the Naming Service.

Parameters:
channlName The name of the channel events will be published to.
argc Number of ORB parameters in argv or 0
argv ORB params. Typically something like:
orbArg[0] = ""
orbArg[1] = "-ORBDottedDecimalAddresses=1"
orbArg[2] = "-ORBInitRef NameService=corbaloc::host:xxxx/NameService"
Sample Usage:
  • Supplier(names,0,(char **)0); - Generates ORB arguments on the fly from environment variables.
  • Supplier(names,argc,argv); - Uses passed ORB arguments.
component A reference to a component is needed for the Event
virtual nc::Supplier::~Supplier (  )  [protected, virtual]

Destructor is protected.

nc::Supplier::Supplier ( const Supplier  )  [private]

ALMA C++ coding standards state copy constructors should be disabled.


Member Function Documentation

void nc::Supplier::createSupplier (  )  [protected]

Utility method. Create the Supplier Admin; create & init the supplier.

Returns:
void
Exceptions:
ACSErrTypeCommon::CORBAProblemEx 

void nc::Supplier::destroyNotificationChannel (  )  [protected]

Utility method. Destroys a notification channel. ONLY USE THIS METHOD IF YOU KNOW FOR CERTAIN THERE IS ONLY ONE SUPPLIER FOR THE CHANNEL!!! Use with extreme caution! This method will most likely become deprecated in future releases of ACS!

Exceptions:
ACSErrTypeCommon::CORBAProblemEx 
Returns:
void

virtual void nc::Supplier::disconnect (  )  [virtual]

Called to disconnect the Supplier from the channel. Must be used instead of deleting the object.


Reimplemented in nc::RTSupplier.

virtual void nc::Supplier::disconnect_structured_push_supplier (  )  [virtual]

Do not under any circumstances invoke this method from your code! ACE/TAO (implementor of the Notification Service) is notorious about changing the behaviour of the underlying NC CORBA objects with each release. As of ACS 3.1, this method disconnects all consumers from the channel!


void nc::Supplier::init ( CORBA::ORB_ptr  orb  )  [protected]

Utility method. Initialization method where code common to all constructors is kept.

Parameters:
orb ORB which has a reference to the Naming Service.
Exceptions:
ACSErrTypeCommon::CORBAProblemEx 

void nc::Supplier::operator= ( const Supplier  )  [private]

ALMA C++ coding standards state assignment operators should be disabled.

void nc::Supplier::populateHeader ( CosNotification::StructuredEvent &  event  )  [protected]

Fills the fixed header with Event Description information.

Parameters:
event The structured event which holds the header & data.
Exceptions:
ACSErrTypeCommon::CORBAProblemEx 

virtual void nc::Supplier::populateHeader ( const CORBA::Any &  any  )  [protected, virtual]

Extracts the event type name from the any parameter and encodes that into the current structured event to be published. So if any contains a FRIDGE::temperatureDataBlockEvent structure, "temperatureDataBlock" is encoded into the type_name field of event_m.

Exceptions:
ACSErrTypeCommon::CORBAProblemEx 

void nc::Supplier::publishEvent ( const CosNotification::StructuredEvent &  event  ) 

Call this to publish an entire CORBA structured event. This is a blocking call which does not return control until the event has arrived whereever the Notification Service is actually running. Makes a call to the push_structured_event() method of consumers.

Exceptions:
CORBA::TRANSIENT In case that the Notification Service is down
nc::EventDroppedException In the case that que event buffer queue discard a meesage.
ACSErrTypeCommon::CORBAProblemEx 
Returns:
void

virtual void nc::Supplier::publishEvent ( const CORBA::Any &  eventData  )  [virtual]

Call this to publish a CORBA Any and implicitly have the structured event "filled-out". It actually makes a call to the push_structured_event() method of consumers.

Exceptions:
ACSErrTypeCommon::CORBAProblemEx 

void nc::Supplier::reconnect ( ::NotifyMonitoringExt::EventChannelFactory *  ecf  )  [virtual]

Override of reconnect method

See also:
acsnc::Helper::reconnect

Reimplemented from nc::Helper.

void nc::Supplier::setAntennaName ( std::string  antennaName  ) 
void nc::Supplier::setEventType ( const char *   )  [protected]

Sets the type_name field in the structured event. Method should probably be removed sometime in the near future but what impact will this have?

Returns:
void

virtual void nc::Supplier::subscription_change ( const CosNotification::EventTypeSeq &  eventsAdded,
const CosNotification::EventTypeSeq &  eventsRemoved 
) [virtual]

Called by supplier's consumer proxy object to inform us of changes to the subscription information by the notification channel's consumers. Essentially, this is called each time a consumer subscribes to the NC or disconnects. Do not call it from your code!

Parameters:
eventsAdded Event types that consumers want to see.
eventsRemoved Event types consumers no longer care about.
Exceptions:
CosNotifyComm::InvalidEventType 
Returns:
void


Member Data Documentation

CosNotifyChannelAdmin::AdminID nc::Supplier::adminid [private]
std::string nc::Supplier::antennaName [protected]

This is a reference to the component this supplier is contained within. The Executive subsystem has requested that the component's name be packed into structured events and that is the reason we need this.

unsigned long long nc::Supplier::count_m [protected]

The total number of events sent from this particular supplier.

CosNotification::StructuredEvent nc::Supplier::event_m [protected]

A single structured event. This was taken out of the publishEvent() method for a small performance gain.

CosNotifyChannelAdmin::StructuredProxyPushConsumer_var nc::Supplier::proxyConsumer_m [protected]

The proxy consumer object used by supplier to push events onto the NC

CosNotifyChannelAdmin::ProxyID nc::Supplier::proxyConsumerID [private]
CosNotifyComm::StructuredPushSupplier_var nc::Supplier::reference_m [protected]

Handle destruction cleanly using our own CORBA reference.

CosNotifyChannelAdmin::SupplierAdmin_var nc::Supplier::SupplierAdmin_m [protected]

Supplier Admin object is responsible for creating & managing proxy consumers w/ a common set of QoS property settings & filter objects.

char* nc::Supplier::typeName_mp [protected]

The so-called "type" of the event being sent.


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