/******************************************************************************* * ALMA - Atacama Large Millimiter Array * (c) UNSPECIFIED - FILL IN, 2005 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * "@(#) $Id: testCDBProps.cpp,v 1.7 2008/10/09 07:57:41 cparedes Exp $" * * who when what * -------- -------- ---------------------------------------------- * dfugate 2005-04-25 created */ /************************************************************************ * NAME * * * SYNOPSIS * * * DESCRIPTION * * FILES * * ENVIRONMENT * * COMMANDS * * RETURN VALUES * * CAUTIONS * * EXAMPLES * * SEE ALSO * * BUGS * *------------------------------------------------------------------------ */ #include #include #include "EventComponentS.h" #include "acsncCDBProperties.h" #include using namespace baci; /** * This class is for testing the notification channel under an activator */ class CDBPropsCompImpl: public virtual acscomponent::ACSComponentImpl, public virtual POA_demo::ConsumerComp { public: /* ----------------------------------------------------------------*/ /** * Constructor * @param poa Poa which will activate this and also all other COBs. * @param name DO's name. This is also the name that will be used to find the * configuration data for the DO in the Configuration Database. */ CDBPropsCompImpl(const ACE_CString& name, maci::ContainerServices *cs) : acscomponent::ACSComponentImpl(name, cs) { ; } /** * Destructor */ virtual ~CDBPropsCompImpl() {;} virtual void initialize() { /* //first try on one that exists in the CDB CosNotification::AdminProperties joe; { joe = nc::CDBProperties::getCDBAdminProps("blar"); } std::cout << "getCDBAdminProps(blar):"; for (unsigned int i=0; i ParticularNotifyEventChannelFactory res = BaseHelper::getNotificationFactoryNameForChannel(cdb.in(), "PARTICULAR1"); std::cout << "particular1: " << (res.in() ? res.in() : "(null)") << std::endl; // channel mapping in CDB and service name expansion -> ParticularNotifyEventChannelFactory res = BaseHelper::getNotificationFactoryNameForChannel(cdb.in(), "PARTICULAR2"); std::cout << "particular2: " << (res.in() ? res.in() : "(null)") << std::endl; // wildchars channel mapping -> ControlNotifyService res = BaseHelper::getNotificationFactoryNameForChannel(cdb.in(), "CONTROL_CHANNEL"); std::cout << "wildcard: " << (res.in() ? res.in() : "(null)") << std::endl; // domain mapping -> AlarmNotifyEventChannelFactory res = BaseHelper::getNotificationFactoryNameForChannel(cdb.in(), "anyOnLaser", "ALARMSYSTEM"); std::cout << "domain: " << (res.in() ? res.in() : "(null)") << std::endl; // fallback to default -> encoded default NotifyEventChannelFactory res = BaseHelper::getNotificationFactoryNameForChannel(cdb.in(), "anyOnNonExistingDomain", "NONEXISTING_DOMAIN"); std::cout << "non-existing domain: " << (res.in() ? res.in() : "(null)") << std::endl; } private: }; /* --------------- [ MACI DLL support functions ] -----------------*/ #include MACI_DLL_SUPPORT_FUNCTIONS(CDBPropsCompImpl) /* ----------------------------------------------------------------*/