#include <acsncHelper.h>
Public Member Functions | |
Helper (const char *channelName, const char *notifyServiceDomainName=0) | |
void | resolveNamingService (CORBA::ORB_ptr orb_mp) |
bool | resolveNotifyChannel () |
bool | resolveInternalNotificationChannel () |
virtual void | reconnect (::NotifyMonitoringExt::EventChannelFactory *ecf) |
Static Public Member Functions | |
static char * | extractStructName (const char *idlStruct) |
Protected Member Functions | |
virtual const char * | getChannelKind () |
virtual const char * | getChannelDomain () |
virtual const char * | getNotificationFactoryName () |
virtual void | resolveNotificationFactory () |
virtual void | createNotificationChannel () |
virtual | ~Helper () |
virtual const CosNotification::QoSProperties | getQoSProps () |
virtual const CosNotification::AdminProperties | getAdminProps () |
void | integrationLog (const std::string &log) |
Protected Attributes | |
CosNaming::NamingContext_var | namingContext_m |
CosNotifyChannelAdmin::EventChannel_var | notifyChannel_m |
CosNotifyChannelAdmin::InterFilterGroupOperator | ifgop_m |
char * | channelName_mp |
char * | notifyServiceDomainName_mp |
char * | notificationServiceName_mp |
ORBHelper * | orbHelper_mp |
NotifyMonitoringExt::EventChannelFactory_var | notifyFactory_m |
CosNotifyChannelAdmin::EventChannelFactory_var | notifyFactoryOld_m |
CosNotifyChannelAdmin::ChannelID | channelID_m |
ReconnectionCallback * | callback_m |
Private Member Functions | |
void | operator= (const Helper &) |
Helper (const Helper &) | |
Private Attributes | |
bool | okToLog_m |
Class Helper is a base class used to provide common functionality between the Consumer and Supplier classes. That is, it hides much of the ACE/TAO code used to access the Naming Service and channels from these classes.
TODO:
nc::Helper::Helper | ( | const char * | channelName, | |
const char * | notifyServiceDomainName = 0 | |||
) |
Constructor
channelName | Name of the channel | |
notifyServiceDomainName | Name of the notification service domain name used to determine notification service.
|
virtual nc::Helper::~Helper | ( | ) | [protected, virtual] |
Destructor is protected.
nc::Helper::Helper | ( | const Helper & | ) | [private] |
ALMA C++ coding standards state copy constructors should be disabled.
virtual void nc::Helper::createNotificationChannel | ( | ) | [protected, virtual] |
Utility method. Create notification channel. Only used by Supplier to create NC.
ACSErrTypeCommon::CORBAProblemEx | ||
NotifyMonitoringExt::NameAlreadyUsed | when the factory tries to create a notification channel with the same name | |
NotifyMonitoringExt::NameMapError |
|
Reimplemented in nc::HelperTest.
static char* nc::Helper::extractStructName | ( | const char * | idlStruct | ) | [static] |
Helper method designed to eliminate "xxx::" from a passed string where "xxx" is some namespace. Designed to access the stringified name of an "ICD event".
idlStruct | a string that may or may not contain "xxx::" |
virtual const CosNotification::AdminProperties nc::Helper::getAdminProps | ( | ) | [protected, virtual] |
Utility method. Returns admin properties used to create a notification channel. Developers should override this method if the defaults are insufficient.
virtual const char* nc::Helper::getChannelDomain | ( | ) | [protected, virtual] |
This method returns a constant character pointer to the domain of notification channel which is normally equivalent to acscommon::ALMADOMAIN. The sole reason this method is provided is to accomodate subclasses which subscribe/publish non-ICD style events (ACS archiving channel for example).In that case, the developer would override this method.
Reimplemented in nc::ArchiveConsumer.
virtual const char* nc::Helper::getChannelKind | ( | ) | [protected, virtual] |
This method returns a constant character pointer to the "kind" of notification channel as registered with the naming service (i.e., the kind field of a CosNaming::Name) which is normally equivalent to acscommon::NC_KIND. The sole reason this method is provided is to accomodate subclasses which subscribe/publish non-ICD style events (ACS archiving channel for example).In that case, the developer would override this method.
Reimplemented in nc::ArchiveConsumer.
virtual const char* nc::Helper::getNotificationFactoryName | ( | ) | [inline, protected, virtual] |
This method returns a constant character pointer to the name of the notification service as registered with the CORBA Naming Service.
Reimplemented in nc::ArchiveConsumer.
References channelName_mp, nc::CDBProperties::getCDB(), BaseHelper::getNotificationFactoryNameForChannel(), notificationServiceName_mp, and notifyServiceDomainName_mp.
virtual const CosNotification::QoSProperties nc::Helper::getQoSProps | ( | ) | [protected, virtual] |
Utility method. Returns quality of service properties used to create a notification channel. Override this method if the defaults are insufficient.
void nc::Helper::integrationLog | ( | const std::string & | log | ) | [protected] |
The following was requested by Heiko Sommer and is needed for integrations. It should be removed at some later date.
void nc::Helper::operator= | ( | const Helper & | ) | [private] |
ALMA C++ coding standards state assignment operators should be disabled.
virtual void nc::Helper::reconnect | ( | ::NotifyMonitoringExt::EventChannelFactory * | ecf | ) | [virtual] |
This method allow to the Helper reconnect to the Notification Channel in case of Notify Service crashes. It is used by the the Persistance Notify Service extension and must be called only from the Reconnection Callback.
ecf | Pointer to the EventChannelFactory |
Reimplemented in nc::Consumer, and nc::Supplier.
bool nc::Helper::resolveInternalNotificationChannel | ( | ) |
This is used by Comsumers and Suppliers to get the notification channel. It first tries to resolved and if it fails, it tries to create it. If it fails to create it, it waits 2 seconds and tries again, 20 times. If it still fails, returns false
void nc::Helper::resolveNamingService | ( | CORBA::ORB_ptr | orb_mp | ) |
Resolve the TAO naming service. In reality, this is the only CORBA service we need to create a notification channel. The naming service can be used to get references to anything registered with it.
orb_mp | orb_mp is what we use to get a reference to the naming service. This method assumes that orb_mp was started with a correct reference to the Naming Service. It should be noted that by passing (CORBA::ORB *) 0, this method will default to Container's ORB (which is preferred). |
ACSErrTypeCommon::CORBAProblemEx | ||
ACSErrTypeCommon::CouldntCreateThreadEx |
virtual void nc::Helper::resolveNotificationFactory | ( | ) | [protected, virtual] |
Utility method. Try to resolve the Notify factory from the Naming service. Only used by Supplier to create NC.
ACSErrTypeCommon::CORBAProblemEx |
|
bool nc::Helper::resolveNotifyChannel | ( | ) |
This is used to determine if the notification channel we want to use has been registered with the Naming Service. If it has, we use that directly.
ACSErrTypeCommon::CORBAProblemEx |
|
ReconnectionCallback* nc::Helper::callback_m [protected] |
CosNotifyChannelAdmin::ChannelID nc::Helper::channelID_m [protected] |
Keep a reference to the channel. Should this be removed in future releases of ACS???
char* nc::Helper::channelName_mp [protected] |
Name of the notification channel.
Referenced by getNotificationFactoryName().
CosNotifyChannelAdmin::InterFilterGroupOperator nc::Helper::ifgop_m [protected] |
The group operator between admin-proxy's. The purpose of this variable is to define how multiple Filters are considered in a proxy admin. Basically this variable does not matter since filtering at the admin level is not allowed!
CosNaming::NamingContext_var nc::Helper::namingContext_m [protected] |
A naming context (i.e., Naming Service reference)
char* nc::Helper::notificationServiceName_mp [protected] |
Name of "resovled" notification service.
Referenced by getNotificationFactoryName().
CosNotifyChannelAdmin::EventChannel_var nc::Helper::notifyChannel_m [protected] |
The notification channel used to send/receive events. This is created by the notification channel factory. This channel is bound to the naming service using channelName_mp.
NotifyMonitoringExt::EventChannelFactory_var nc::Helper::notifyFactory_m [protected] |
Channel factory. Used to create new channels. The extended mode of TAO is used to prevent the creation of a channel multiple times
CosNotifyChannelAdmin::EventChannelFactory_var nc::Helper::notifyFactoryOld_m [protected] |
Channel factory. Used to create new channels. In the case of a non TAO implementation or the initialization of the service without the extended mode, the standard mode is used
char* nc::Helper::notifyServiceDomainName_mp [protected] |
Name of the nofitication service domain.
Referenced by getNotificationFactoryName().
bool nc::Helper::okToLog_m [private] |
The following was requested by Heiko Sommer and is needed for integrations. It should be removed at some later date.
ORBHelper* nc::Helper::orbHelper_mp [protected] |
In case of standalone mode, this must be used!