#include <acsncSupplier.h>
List of all members.
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:
- check for local and remote memory leaks
- clean-up the usage of typeName_mp somehow
Constructor & Destructor Documentation
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 |
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 |
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] |
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
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.
The total number of events sent from this particular supplier.
A single structured event. This was taken out of the publishEvent() method for a small performance gain.
The proxy consumer object used by supplier to push events onto the NC
Handle destruction cleanly using our own CORBA reference.
Supplier Admin object is responsible for creating & managing proxy consumers w/ a common set of QoS property settings & filter objects.
The so-called "type" of the event being sent.
The documentation for this class was generated from the following file: